Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key

Get DEX token pair address

GEThttps://deep-index.moralis.io/api/v2.2/:token0_address/:token1_address/pairAddress

Fetch the pair data of the provided token0+token1 combination. The token0 and token1 options are interchangable (ie. there is no different outcome in "token0=WETH and token1=USDT" or "token0=USDT and token1=WETH")

PATH PARAMS
token0_addressstringrequired
The token0 address
token1_addressstringrequired
The token1 address
QUERY PARAMS
chainstring
The chain to query
to_blockstring
The block number to get the reserves from
to_datestring

Get the reserves up to this date (any format that is accepted by momentjs)

  • Provide the param 'to_block' or 'to_date'
  • If 'to_date' and 'to_block' are provided, 'to_block' will be used.
exchangestringrequired
The factory name or address of the token exchange
Responses
200Returns the pair address of the two tokens.
400Bad Request
404Not Found
429Too Many Requests
500Internal Server Error
API KEY
curl --request GET \
--url 'https://deep-index.moralis.io/api/v2.2/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39/0xdac17f958d2ee523a2206206994597c13d831ec7/pairAddress?chain=eth&exchange=uniswapv2' \
--header 'accept: application/json' \
--header 'X-API-Key: YOUR_API_KEY'
Response Example
{
"token0": "",
"token1": "",
"pairAddress": "0xbbb9bf440d0f686487925fef3b0a0f9aa67753f6"
}