On this page
API reference
Collection and token images
Read reviewed images with conditional requests and choose full, display or row sizes.
GET /img/:chainId/:collection#
Return the selected reviewed collection’s image. Use If-None-Match with the previous ETag for a conditional read.
Path and query parameters#
| Name | Type | Required | Meaning | Default | Limits |
|---|---|---|---|---|---|
chainId |
integer | Yes | NFT chain ID. | — | 1 for this API. |
collection |
address | Yes | Selected Ethereum ERC-721 contract. | — | 20 bytes, 0x prefix. |
size |
string | No | Display thumbnail or original. | thumb | thumb, full. |
Response fields#
| Field | Type | Meaning |
|---|---|---|
body |
image bytes | Detected type in Content-Type. A conditional 304 has an empty body. |
ETag |
header | Object validator for a matching If-None-Match request. |
Content-Security-Policy, X-Content-Type-Options, Cross-Origin-Resource-Policy |
headers | Image isolation, type enforcement and cross-origin embedding policy. |
Cache. public, max-age=86400, stale-while-revalidate=604800, stale-if-error=604800 for a stored image or matching 304. Pending and error responses use no-store.
Limit. No route-specific limiter.
Errors#
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request |
A path, query or body field failed validation. |
| 404 | not_found |
The collection, feed or venue is unavailable on this site. |
| 404 | not_found |
The collection is unreviewed or has no image. |
Example request#
bash
curl https://marketplace.example/img/1/0x4a8b01e437c65fa8612e8b699266c0e0a98ff65cExample response#
http
HTTP/2 200
content-type: image/webp
cache-control: public, max-age=86400, stale-while-revalidate=604800, stale-if-error=604800GET /img/:chainId/:collection/:tokenId#
Return a reviewed NFT’s image. A pending display thumbnail can be a transparent GIF. Row thumbnails use Accept negotiation and can return Vary: Accept.
Path and query parameters#
| Name | Type | Required | Meaning | Default | Limits |
|---|---|---|---|---|---|
chainId |
integer | Yes | NFT chain ID. | — | 1 for this API. |
collection |
address | Yes | Selected Ethereum ERC-721 contract. | — | 20 bytes, 0x prefix. |
tokenId |
decimal string | Yes | NFT identifier for the image. | — | 1–78 decimal digits. |
size |
string | No | Display thumbnail, original or a compact row image. | thumb | thumb, full, row. Row is for Space Poggers. |
Response fields#
| Field | Type | Meaning |
|---|---|---|
body |
image bytes | Detected type in Content-Type. A conditional 304 has an empty body. |
ETag |
header | Object validator for a matching If-None-Match request. |
Content-Security-Policy, X-Content-Type-Options, Cross-Origin-Resource-Policy |
headers | Image isolation, type enforcement and cross-origin embedding policy. |
Cache. public, max-age=86400, stale-while-revalidate=604800, stale-if-error=604800 for a stored image or matching 304. Pending and error responses use no-store.
Limit. No route-specific limiter.
Errors#
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request |
A path, query or body field failed validation. |
| 404 | not_found |
The collection, feed or venue is unavailable on this site. |
| 404 | not_found |
The collection or token has no available image. |
| 406 | invalid_request |
No image matches the accepted formats. |
Example request#
bash
curl 'https://marketplace.example/img/1/0x4a8b01e437c65fa8612e8b699266c0e0a98ff65c/344?size=full'Example response#
http
HTTP/2 200
content-type: image/png
cache-control: public, max-age=86400, stale-while-revalidate=604800, stale-if-error=604800