API ReferenceToken APIGet Pairs & LiquidityGet Specific Token Pair AddressGet DEX token pair addressGEThttps://deep-index.moralis.io/api/v2.2/:token0_address/:token1_address/pairAddressGet the pair address for a token0/token1 combination on a DEX, interchangeable order.PATH PARAMStoken0_addressstringrequiredThe token0 addresstoken1_addressstringrequiredThe token1 addressQUERY PARAMSchainstringThe chain to queryeth0x1sepolia0xaa36a7polygon0x89bsc0x38bsc testnet0x61avalanche0xa86afantom0xfacronos0x19arbitrum0xa4b1chiliz0x15b38chiliz testnet0x15b32gnosis0x64gnosis testnet0x27d8base0x2105base sepolia0x14a34optimism0xaholesky0x4268polygon amoy0x13882linea0xe708moonbeam0x504moonriver0x505moonbase0x507linea sepolia0xe705flow0x2ebflow-testnet0x221ronin0x7e4ronin-testnet0x7e5lisk0x46flisk-sepolia0x106apulse0x171sei-testnet0x530sei0x531to_blockstringThe block number to get the reserves fromto_datestringGet the reserves up to this date (format in seconds or datestring accepted by momentjs)Provide the param 'to_block' or 'to_date'If 'to_date' and 'to_block' are provided, 'to_block' will be used.exchangestringrequiredThe factory name or address of the token exchangeResponses200Returns the pair address of the two tokens.400Bad Request404Not Found429Too Many Requests500Internal Server ErrorAPI KEYTest Live APIcURLNode.jsPythonGoPHPcurl --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' // Node.js v18+ has native fetch support// No additional dependencies requiredconst options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' },};fetch('https://deep-index.moralis.io/api/v2.2/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39/0xdac17f958d2ee523a2206206994597c13d831ec7/pairAddress?chain=eth&exchange=uniswapv2', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));# Dependencies to install:# $ python -m pip install requestsimport requestsurl = "https://deep-index.moralis.io/api/v2.2/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39/0xdac17f958d2ee523a2206206994597c13d831ec7/pairAddress?chain=eth&exchange=uniswapv2"headers = { "Accept": "application/json", "X-API-Key": "YOUR_API_KEY"}response = requests.request("GET", url, headers=headers)print(response.text)package mainimport ( "fmt" "net/http" "io")func main() { url := "https://deep-index.moralis.io/api/v2.2/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39/0xdac17f958d2ee523a2206206994597c13d831ec7/pairAddress?chain=eth&exchange=uniswapv2" req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("X-API-Key", "YOUR_API_KEY") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}<?php// Dependencies to install:// $ composer require guzzlehttp/guzzlerequire_once('vendor/autoload.php');$client = new \GuzzleHttp\Client();$response = $client->request('GET', 'https://deep-index.moralis.io/api/v2.2/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39/0xdac17f958d2ee523a2206206994597c13d831ec7/pairAddress?chain=eth&exchange=uniswapv2', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 Returns the pair address of the two tokens.{ "token0": { "address": "0x2b591e99afe9f32eaa6214f7b7629768c40eeb39", "name": "HEX", "symbol": "HEX", "decimals": 9, "logo": "https://cdn.moralis.io/eth/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39.png", "logo_hash": "b3bd1b5512965d7b6aeee903dcc6d28b116d58c788eb41e9c1690baed878beaa", "thumbnail": "https://cdn.moralis.io/eth/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39_thumb.png", "block_number": 14836562, "validated": "", "created_at": "2022-01-20T09:39:55.818Z" }, "token1": { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "name": "Tether USD", "symbol": "USDT", "decimals": 6, "logo": "https://cdn.moralis.io/eth/0xdac17f958d2ee523a2206206994597c13d831ec7.png", "logo_hash": "ee7aa2cdf100649a3521a082116258e862e6971261a39b5cd4e4354fcccbc54d", "thumbnail": "https://cdn.moralis.io/eth/0xdac17f958d2ee523a2206206994597c13d831ec7_thumb.png", "block_number": "4638568", "validated": 1, "created_at": "2022-01-20T09:39:55.818Z" }, "pairAddress": "0xbbb9bf440d0f686487925fef3b0a0f9aa67753f6"}