/tokens - Request supported tokens by a swap provider
The /tokens
endpoint provides a list of tokens for a specified provider. This endpoint requires a query parameter to determine which provider's tokens you want to retrieve.
Method: GET
URL: https://api.swapkit.dev/tokens
Example Request
Example shortened response
Response fields
The relevant response fields are:
provider
and name
string
The name of the provider specified in the query.
timestamp
string
The timestamp of when the response was generated.
count
number
The number of tokens included in the response.
tokens
array
An array of token objects, each representing a token available for the specified provider.
For each token, information is provided to properly differentiate it from others:
chain
string
The blockchain the token is associated with (e.g., ETH
, BTC
, SOL
).
address
string
The contract address of the token (only provided if it is not the gas token of the network).
chainId
string
The ID of the chain. It could be a numeric ID (e.g., 42161
for Arbitrum) or a name like solana
.
ticker
string
The ticker symbol of the token (e.g., ETH
, BTC
).
identifier
string
An identifier for the token that combines chain and token address, used to identify the token in SwapKit API.
symbol
string
The token symbol, which includes address information.
name
string
The full name of the token.
decimals
number
The number of decimal places the token supports.
logoURI
string
A URL pointing to the token's logo image.
coingeckoId
string
The identifier of the token on CoinGecko (if available).
Notes
The
identifier
is what SwapKit uses to uniquely identify a token in all its requests and responses. It includes the chain, the name and the token address. It is how the token should be named when using the/quote
endpoint.The identifier is built by putting together Chain.Ticker-ContractAddress (e.g.,
"ETH.USDC-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
).Gas assets like BTC, ETH or SOL don't require a contract address, so their identifier is just
BTC.BTC
for example.
Tokens with an
address
field are specific instances of a token on a given chain (e.g.,USDC
on Ethereum or Solana). While thecoingeckoId
could be shared, we provide the relevant contract address for the token in the specific chain.
Last updated