Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Catalogue sync - tokens.json, networks.json and paths

Sync SwapKit's whole token and route catalogue in a few dozen static-file requests — which tokens exist, which chains, and what each token can be swapped into — instead of calling /swapTo once per tok

If you mirror SwapKit's catalogue into your own backend — to show users only the pairs SwapKit can quote, or to route requests between aggregators — sync these three static files instead of calling /swapTo once per token.

File
What it holds

tokens.json

Every token SwapKit supports, with its identifier, chain, contract address and decimals

networks.json

Every chain in tokens.json, its native token and how many tokens it has

paths/{srcChainId}.json

For every token on one source chain, the tokens it can be swapped into

All three are static JSON files served from SwapKit's CDN at https://tokens.swapkit.dev. They need no API key, they're compressed automatically, and they support conditional requests. A full sync is one tokens.json, one networks.json, and one paths file per chain — 37 requests today — and a sync where nothing changed is the same requests answered with 304 Not Modified.

Routes are listed at the asset level: ETH.LINK can reach almost every Ethereum token, while BTC.BTC reaches only the Ethereum tokens a cross-chain route delivers. A route in these files is one SwapKit can quote; whether a particular request succeeds still depends on its amount — see What the files don't tell you.


Endpoints

Method
URL
Returns

GET

https://tokens.swapkit.dev/tokens.json

Every token

GET

https://tokens.swapkit.dev/networks.json

Every chain

GET

https://tokens.swapkit.dev/paths/{srcChainId}.json

Every route from one source chain

  • No authentication. Don't send an x-api-key; these requests don't count against your API key's rate limits.

  • HEAD works too, if you only want the current ETag and Last-Modified.

  • {srcChainId} is a chainId from networks.json, used as-is: paths/1.json, paths/42161.json, paths/bitcoin.json, paths/solana.json.

  • A 404 on a paths file means "no routes yet". A chain newly added to networks.json can be listed a few hours before its paths file is first written; treat it as having no routes and try again on the next sync.

  • Fetch only the chains networks.json lists. A paths file for a chain that has since left the catalogue may still be served; ignore it.

Sync flow

  1. GET /tokens.json — load every token, keyed by identifier.

  2. GET /networks.json — the chains, and so the list of paths files to fetch.

  3. For each chainId in networks.json: GET /paths/{chainId}.json.

Make every request conditional (next section). Read tokens.json before the paths files, so every identifier a paths file names can be resolved.


Conditional requests and ETag

Every response carries an ETag and a Last-Modified header. A file is rewritten only when its content changes, so both stay the same between changes, and a request that presents them gets 304 Not Modified with no body.

  • Store the ETag per file, exactly as received, and send it back in If-None-Match. Each file — every paths file included — has its own ETag; one file changing says nothing about the others.

  • Weak and strong forms both match. A compressed response carries a weak tag (W/"…"), an uncompressed one the same value without the W/ prefix. Either form gets a 304 whichever encoding you ask for, so you don't need to normalise it.

  • If-Modified-Since works as well, with the Last-Modified value from the previous response. Use one or the other; ETag is the more precise.

  • Treat the ETag as an opaque string. Don't parse it or compare it to anything but a previous ETag for the same URL.

  • On 304, keep what you have. There is no body; reuse your stored copy of that file.

  • version is for your logic, the ETag is for transport. Use the ETag to decide whether to download a file, and version (see Freshness and versioning) to decide what a change means for the data you've stored.

Compression

Every file is served compressed — brotli (br) or gzip, whichever your client lists in Accept-Encoding — and nothing on SwapKit's side needs configuring. What you need to check is your HTTP client: some decompress for you, some don't.

Prefer brotli where your client supports it. The paths files repeat the same identifiers across their destination lists, and brotli exploits that far better than gzip: paths/1.json is 773 KB uncompressed, 400 KB with gzip and 44 KB with brotli. A full sync is about 490 KB with brotli and about 1 MB with gzip (see File sizes).

Client
Asks for compression
Decompresses for you

fetch — browsers, Node.js 18+, Bun, Deno

Yes (br, gzip)

Yes

Node.js https / http modules

No — set the header

No — use node:zlib

Python requests

Yes (gzip; br once the brotli package is installed)

Yes

Python urllib.request

No — set the header

No — use gzip (the standard library has no brotli decoder)

Go net/http

Yes (gzip only), unless you set Accept-Encoding yourself

Yes, on the same condition — for br, set the header and decode with a brotli package

Java java.net.http.HttpClient

No — set the header

No — use GZIPInputStream (or a brotli library such as Brotli4j)

OkHttp (Kotlin / Android)

Yes (gzip)

Yes

curl

Only with --compressed

Only with --compressed

Each example fetches a file compressed, then re-requests it with If-None-Match and gets a 304, except the Go (brotli) tab, which shows only the decode.

File sizes

Measured on 2026-10-07. Sizes move as tokens and routes change, so don't hard-code limits from them.

File
Uncompressed
brotli
gzip

tokens.json

1.2 MB

208 KB

218 KB

networks.json

3.4 KB

1 KB

1 KB

paths/1.json (Ethereum, largest)

773 KB

44 KB

400 KB

paths/56.json (BSC)

267 KB

22 KB

118 KB

A chain with a handful of tokens

1–35 KB

1–7 KB

1–7 KB

All 35 paths files together

2.3 MB

281 KB

786 KB

A first sync is about 490 KB with brotli (about 1 MB with gzip); every sync after that is a few dozen 304s plus whichever files changed.


tokens.json

URL: https://tokens.swapkit.dev/tokens.json

Field
Type
Description

identifier

string

The SwapKit identifier — the value /v3/quote takes as sellAsset / buyAsset, and the value the paths files use.

chain

string

SwapKit chain code, the prefix of the identifier (ETH, BTC, SOL).

chainId

string

SwapKit chain ID: a numeric ID for EVM chains (1, 42161) or a name (bitcoin, solana).

network

string

The chain's CoinGecko asset-platform ID (ethereum, binance-smart-chain). For chains CoinGecko has no asset platform for — Bitcoin, Litecoin and other native-coin-only chains, plus a few newer chains such as Arc (arc) and Robinhood Chain (robinhood) — the CoinGecko ID of the chain's native coin.

contractAddress

string | null

The token's contract, mint or account address. null for a chain's native coin — always present, never omitted.

decimals

number

The token's decimals.

symbol

string

The token's ticker (USDC) — not the symbol field of /tokens, which includes the address.

name, logoURI, coingeckoId

string

Display metadata. Optional — omitted when unknown.

geoBlockRule

string

Present only when a jurisdiction restriction applies — see Tokenized equities & geo-restrictions.

tokens.json lists the same tokens as GET /tokens?provider=all, one entry per identifier, sorted by identifier (case-insensitive).


networks.json

URL: https://tokens.swapkit.dev/networks.json

Field
Type
Description

chainId

string

SwapKit chain ID. Also the name of the chain's paths file: paths/{chainId}.json.

chain

string

SwapKit chain code.

network

string

Same as network in tokens.json.

nativeToken

string | null

The identifier of the chain's native token, spelled as in tokens.json. null when the catalogue doesn't list it.

tokens

number

How many tokens tokens.json lists on this chain.

Every chain in networks.json has tokens in tokens.json, and every chain in tokens.json appears in networks.json.


paths/{srcChainId}.json

URL: https://tokens.swapkit.dev/paths/{srcChainId}.json — for example paths/1.json (Ethereum) or paths/solana.json.

Most tokens on a chain can be swapped into exactly the same set of tokens, so each file lists every distinct destination list once in dstSets, and paths points each source token at its list. Written out per token instead, a single chain could run to hundreds of megabytes.

Trimmed from the live paths/1.json — the real lists hold about 1,300 identifiers each. List names change between versions.

Field
Type
Description

srcChainId

string

The chain this file covers. Every srcToken is on this chain.

count

number

Number of entries in paths.

dstSets

object

Destination lists by name. Each list holds SwapKit identifiers, on any chain, sorted case-insensitively.

paths[].srcToken

string

A token on srcChainId that SwapKit can swap from.

paths[].dstSet

string

The name of the dstSets list this token can be swapped into.

Rules for reading a paths file:

  • Skip the token itself. A list may contain the source token — that is what lets many tokens share one list. Treat srcToken == destination as not a route.

  • List names are local. d0 in paths/1.json is unrelated to d0 in paths/solana.json, and names can change between versions. Resolve them when you load a file; don't store them.

  • A token missing from paths has no route from this chain today. Chains with no routable tokens still have a file, with an empty paths.


Identifiers

Every file uses SwapKit identifiers, the same strings /v3/quote takes, so a route from these files can be quoted without translation.

  • The part before the first . is the chain code: ETH.USDC-0x…, SOL.USDC-EPjF…, NEAR.wBTC-2260…factory.bridge.near. Native coins have no address part: BTC.BTC, ETH.ETH.

  • Every identifier a paths file names comes from the tokens.json published when that paths file was built. Paths files are rebuilt on a shorter cycle than tokens.json (see Freshness), so after tokens.json changes they catch up within one cycle.

  • Match identifiers exactly as published — every file spells a token the same way. Addresses on Solana, Tron, TON and other non-EVM chains are case-sensitive.

  • To map an identifier to your own chainId + address key, use chainId and contractAddress from tokens.json.


Freshness and versioning

  • Cadence. tokens.json and networks.json are rebuilt every 8 hours, the paths files every 6 hours. A file is rewritten only when its content changes, so its ETag and Last-Modified stay the same otherwise.

  • Caching. Files are served with Cache-Control: public, max-age=300, so a change can take up to five minutes to reach you after it's written. Polling every 15 minutes with conditional requests is plenty; almost every request is an empty 304.

  • version follows token-list semver:

Bump
When

major

Something you may have stored is no longer valid: a token or route removed, or a token's chainId, contractAddress or decimals changed.

minor

Tokens, chains or routes added.

patch

Metadata only — a name, a logo, a network value.

timestamp is when the file's content last changed.

Expect paths files to change more often than tokens.json. Which routes are available moves with provider status and liquidity, so a paths file can gain and lose destinations between rebuilds, and a lost destination is a major bump. Treat any new version of a paths file as a replacement: swap in the whole file rather than merging it into what you had, and don't alert on its major bumps. A major bump on tokens.json is rarer and worth reviewing: a token was removed, or its contract or decimals changed.


Example: sync loop


What the files don't tell you

A route listed in these files is one SwapKit can quote. A particular request can still fail for reasons only known at quote time:

  • Amount limits — minimums, maximums and per-route size ceilings. See Route availability and providers errors.

  • Liquidity — the route exists but can't fill the amount: insufficientLiquidity, or no route for that size.

  • Regional restrictions — some tokenized equities are rejected with 451 for callers in restricted jurisdictions. The files list every token for every caller; use geoBlockRule. See Tokenized equities & geo-restrictions.

  • Your API key's settings — the files reflect SwapKit's global provider and chain availability. If a provider or chain is switched off for your key only, the files still list its routes.

These surface as normal /v3/quote responses, so handle them the way you already do.

Last updated