Get pairs
GET/v3/pairsDescription
Get a list of all the pairs that are available for exchange considering the user’s location.
If the exchange is blocked in the user’s location (based on their IP), this endpoint will respond with an empty array.
How to filter available pairs
In your app, you can filter the available pairs, so the user can select from the combinations that are swapable.
filter pairs
const pairs = await fetch(
`https://exchange.exodus.io/v3/pairs?format=csv`,
).then((res) => res.json());
const availableFromAssets = assets.filter((asset) =>
pairs.some((pair) => {
const [from] = pair.split("_");
return from === asset.id;
}),
);
const availableToAssets = assets.filter((asset) =>
pairs.some((pair) => {
const [from, to] = pair.split("_");
return from === fromAssetId && to === asset.id;
}),
);
Header Parameters
Name | Description | Required |
---|---|---|
App-Name | App-Name for the authorization | yes |
App-Version | App-Version for the authorization | no |
Forwarded | If you are proxying requests to the API, you must include the "Forwarded" header with the original request IP address. This is used for geolocation availability purposes. | no |
Query Parameters
Name | Description | Required | Defaults | Options |
---|---|---|---|---|
to | [ 2 .. 10 ] characters | no | ||
from | [ 2 .. 10 ] characters | no | ||
format | Change the response type to optimize the network transfer size. | no | json | json, csv |
Response
If the request is from a ?format=json
the response will be like this:
JSON RESPONSE
[
{
"id": "BTC_ETH",
"from": "BTC",
"to": "ETH"
},
{
"id": "ETH_USDT",
"from": "ETH",
"to": "USDT"
}
]
If the request is from a ?format=csv
the response will be like this:
CSV RESPONSE
BTC_ETH,ETH_USDT
Last updated on