Documentation
Endpoint
GET /api/avatar
Parameters
All parameters are passed as GET parameters in the URL query string. For example,
https://api.com/avatar?seed=0x&size=64
will generate an avatar for "0x" at 64px.
The endpoint url be used directly with an image tag:
<img src="https://api.com/avatar?seed=0x&size=64" />
?seed
Type: string Required: Yes
The blockchain address to generate an avatar for. Supports both Ethereum and Solana addresses.
Examples:
<img src="https://api.com/avatar?seed=0x8c56a34129dcf0711fE57E47fDcb733FCe40A29f" />
<img src="https://api.com/avatar?seed=8BH9pjtgyZDC4iAQH5ZiYDZ1MDWC98xki2V8NzqqKW3K" />
?size
Type: number Default: 64
The size of the avatar in pixels (width and height). Must be between 1 and 640 pixels.
Recommended sizes for crisp results: 32, 64, 128, 256
?normalizeSeed
Type: true | false
Optional
Default: true
Whether to normalize seed value for blockie generation.
Applies to ethereum addresses only (because Solana addresses are case-sensitive)
Conventionally, ethereum addresses are converted to lowercase for blockies. You can disable this behavior.
Note: If address is resolved from an ens name ("address.eth"), and this option is false, a checksummed address will be used
?borderRadius
Type: number Optional
Note: The use of this option is not recommended, because you can always achieve better results by applying
border-radiuson the client side.
Corner radius for rounded avatars. Omit for square avatars.
- Range: 0 to (size/2) pixels
- For circular avatars, use
borderRadius = size / 2 - Example:
size=64&borderRadius=32creates a perfect circle
?blockieStyle
Type: zerion | blockie
Optional
Default: zerion
Applies for Solana addresses.
Default value of zerion uses a special blockie style for Solana addresses so that they are easy to distinguish from ethereum ones. You can opt-out of this style by using blockie value
Examples
Basic usage
/api/avatar?seed=0x8c56a34129dcf0711fE57E47fDcb733FCe40A29f&size=64
Rounded avatar
/api/avatar?seed=0x8c56a34129dcf0711fE57E47fDcb733FCe40A29f&size=128&borderRadius=16
Circular avatar
/api/avatar?seed=8BH9pjtgyZDC4iAQH5ZiYDZ1MDWC98xki2V8NzqqKW3K&size=256&borderRadius=128
HTML implementation
<img
src="/api/avatar?seed=0x8c56a34129dcf0711fE57E47fDcb733FCe40A29f&size=64"
width="64"
height="64"
alt="Avatar"
/>
Response
- Content-Type:
image/png - Format: PNG image with 2x pixel density for crisp display
- Caching: Images are deterministic - identical parameters always produce the same result