Tokens
The XSwap Tokens API returns token metadata for a given chain—or a single token if you supply its address.
Endpoint
GET https://xswap.link/api/tokens/v1
Content-Type: application/jsonAll query parameters are passed as a JSON payload in the data query parameter, URL-encoded.
Request
Required Parameters
Name
Type
Description
integratorId
string
Your registered integrator ID
chainIds
string[]
Chain IDs (e.g. ["1", "56"])
Optional Parameters
Name
Type
Description
ecosystem
string
Filter by ecosystem (e.g. "EVM").
Currently only
EVMis supported
addresses
string[]
Token contract addresses
Response
Field
Type
Description
address
string
Token contract address
symbol
string
Token symbol (e.g. "ETH")
name
string
Token name (e.g. "Ether")
decimals
number
Number of decimals
image
string
URL to token’s rounded 64x64 webp logo
Example Requests
;(async () => {
const payload = {
integratorId: "xxx"
chainId: "1"
};
const encoded = encodeURIComponent(JSON.stringify(payload));
const url = `https://xswap.link/api/tokens/v1?data=${encoded}`;
const res = await fetch(url, {
method: "GET",
headers: { "Content-Type": "application/json" },
});
const tokens = await res.json();
console.log("All tokens for given chainId:", tokens);
})();Example Response
[
{
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"decimals": 18,
"name": "Ether",
"image": "https://xswap.link/assets/tokens/1_0x0000000000000000000000000000000000000000_ETH.webp"
},
{
"address": "0x8fe815417913a93ea99049fc0718ee1647a2a07c",
"symbol": "XSWAP",
"decimals": 18,
"name": "XSWAP Token",
"image": "https://xswap.link/assets/tokens/1_0x8fe815417913a93ea99049fc0718ee1647a2a07c_XSWAP.webp"
},
...
]Last updated