Build an Astar NFT collection gallery
Combine the collection detail with its token pages. The detail supplies contract context and counts; the token endpoint supplies ownership and artwork.
COLLECTION=0x0000000000000000000000000000000000000001curl -sS -H "Authorization: Bearer $ARADIA_API_TOKEN" \ "https://api.aradia.app/v1/collections/$COLLECTION"curl -sS -H "Authorization: Bearer $ARADIA_API_TOKEN" \ "https://api.aradia.app/v1/collections/$COLLECTION/nfts?limit=100"const base = "https://api.aradia.app/v1";const headers = { Authorization: `Bearer ${process.env.ARADIA_API_TOKEN}` };const collection = "0x0000000000000000000000000000000000000001";
const [detailResponse, tokensResponse] = await Promise.all([ fetch(`${base}/collections/${collection}`, { headers }), fetch(`${base}/collections/${collection}/nfts?limit=100`, { headers }),]);if (!detailResponse.ok || !tokensResponse.ok) throw new Error("Collection request failed");
const [{ data: detail }, tokens] = await Promise.all([ detailResponse.json(), tokensResponse.json(),]);const items = tokens.data.map((nft) => ({ ...nft, src: nft.media_url ?? nft.image_url }));import osimport requests
base = "https://api.aradia.app/v1"collection = "0x0000000000000000000000000000000000000001"headers = {"Authorization": f"Bearer {os.environ['ARADIA_API_TOKEN']}"}
detail = requests.get(f"{base}/collections/{collection}", headers=headers, timeout=30)tokens = requests.get( f"{base}/collections/{collection}/nfts", params={"limit": 100}, headers=headers, timeout=30,)detail.raise_for_status()tokens.raise_for_status()gallery = [{**nft, "src": nft.get("media_url") or nft.get("image_url")} for nft in tokens.json()["data"]]Pagination rule
Section titled “Pagination rule”Do not increment a page number. Copy after_token_id and after_id from next_page_params. Token IDs must remain strings from request to render, even when they look numeric.
Related reference: GET /v1/collections/{address} and GET /v1/collections/{address}/nfts.
