nixonjoshua98 / dexscreener

Python API wrapper for dexscreener.com
https://docs.dexscreener.com/api/reference
MIT License
91 stars 19 forks source link

Getting All available pairs #8

Closed paramkr2 closed 2 months ago

paramkr2 commented 2 months ago

Is there any way to get all pair/pool Addresses listed on dexscreener. Thanks.

paramkr2 commented 2 months ago

To clarify, I am looking for functionality that retrieves all available pool/pair addresses on a particular chain, such as Ethereum or BSC.

I can currently retrieve all pair addresses directly from the chain using the following code by:

const { ethers } = require("ethers");
const provider = new ethers.providers.JsonRpcProvider(");
const factory = new ethers.Contract("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", ["function allPairs(uint256) view returns (address)", "function allPairsLength() view returns (uint256)"], provider);

async function getAllPairs() {
    const length = await factory.allPairsLength();
    for (let i = 0; i < length; i++) console.log(await factory.allPairs(i));
}

However, I am interested in knowing if it is possible to achieve the same result using the Dexscreener API. Their API documentation does not mention a method for fetching all pair addresses in one request.

Thx.

nixonjoshua98 commented 2 months ago

If its not in their documentation then its not possible.