What you need
- A Dynamic API token with the
environment.settings.readscope. See API token permissions. - Server-side storage for the catalog and its
ETagvalue.
Fetch the catalog
CallGET /api/v0/tokenCatalog with your API token. The endpoint paginates results: limit sets the page size (1 to 100, default 50) and cursor continues from a previous page:
curl
nextCursor is a string, pass it as cursor on the next request to fetch the following page. When nextCursor is null, the page is the last one and the catalog is fully read.
The logoURI field is optional. Identify a token by its chain, network, and contract address instead of its symbol, because the same symbol can exist on multiple networks.
Poll without downloading unchanged data
Each page response includes anETag header and a version field. The ETag identifies one specific page request, so it only matches a later request with the same limit and cursor. The version hashes the entire catalog, so the first page’s version changes whenever any token changes.
To poll efficiently, save the first page’s ETag together with your stored catalog. On the next scheduled request, send that value in If-None-Match on the first page only:
304 Not Modifiedmeans the catalog is unchanged. Keep using the saved copy.200 OKwith a newversionmeans the catalog changed. Read every page untilnextCursorisnulland replace the saved snapshot andETag.
TypeScript
ETag without its matching catalog is not useful.
Handle errors
Treat each successful sync as a complete replacement snapshot. Do not discard the last valid snapshot when a refresh fails.