Skip to content
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.

Can I use this API to check a specific pair or token info? #10

Open
juan-silveira opened this issue Mar 2, 2021 · 49 comments
Open

Can I use this API to check a specific pair or token info? #10

juan-silveira opened this issue Mar 2, 2021 · 49 comments

Comments

@juan-silveira
Copy link

I'm new at this tech, and I'm kind of used to use a regular API calls, how can I start to use this one?

The pair that I'm trying to retrieve info is this: https://pancakeswap.info/pair/0xb54cd95eea2b2f7adb4dccd5b5e1d6c4a6ffe472

@ChefKai
Copy link
Contributor

ChefKai commented Apr 1, 2021

Hello, the API does not currently support retrieving information about a specific token/pair, but it's a planned feature and should be here soon :)

@leopons
Copy link

leopons commented Apr 10, 2021

Hi guys, do you have an idea of when it will be released ?
Just to get a feeling if it will be more like a week or a month.
Thanks :)

@ShinoyVK
Copy link

ShinoyVK commented Apr 10, 2021

hello,
Can anyone please give me suggestions to fetch details of a specific pair or any alternate method to do the same.

Thanks in advance.

@thisprojectworks
Copy link

Hello!

I think it would be very useful to have this information on the pairs:

  • Volume
  • Amount of each token
  • Liquidity size
  • Transactions

Thanks for your work.

@cbijon
Copy link

cbijon commented Apr 10, 2021

Hello,

same for a specific token please like :

https://pancakeswap.info/token/0xb54cd95eea2b2f7adb4dccd5b5e1d6c4a6ffe472/price : current price BNB / USD

https://pancakeswap.info/token/0xb54cd95eea2b2f7adb4dccd5b5e1d6c4a6ffe472/transaction : volume , last 10 or 100 transactions

Best regards,

Charles

This was referenced Apr 12, 2021
@vastamaki
Copy link

@ChefKai Any status update about this?

@ChefKai
Copy link
Contributor

ChefKai commented Apr 18, 2021

Release plan is around next week ~

@stychu stychu mentioned this issue Apr 22, 2021
This was referenced Apr 25, 2021
@EPstudios
Copy link

Any update on this?

@chop-pixel
Copy link

chop-pixel commented Apr 26, 2021

Hello, the API does not currently support retrieving information about a specific token/pair, but it's a planned feature and should be here soon :)

Release plan is around next week ~

Since we are unable to retrieve info for a specific token/pair at present, in the interim, is there a means by which we can retrieve info for ALL tokens/pair, after which we can then filter to our hearts content ? - at present we are only getting the 'top ~1000 pairs'

@wynlo
Copy link

wynlo commented Apr 28, 2021

Hey, are there any updates regarding this functionality?

@mrcolak
Copy link

mrcolak commented Apr 28, 2021

Release plan is around next week ~

We are all waiting for this fabulous endpoint 😍

@benbanicar
Copy link

benbanicar commented Apr 28, 2021

Release plan is around next week ~

Hey, Is there any news? We look forward to hear from you👀.

@ivancsicsmarkus
Copy link

Do you have an ETA for this?

@GMaiolo
Copy link

GMaiolo commented Apr 30, 2021

@ChefKai any updated ETA? Thanks.

@Valaia
Copy link

Valaia commented Apr 30, 2021

Still no update? People clearly want this..

@mrcolak
Copy link

mrcolak commented Apr 30, 2021

I believe they are too busy with the LP migration.

@masterkain
Copy link

I'd like this, please 👍

@globalgive
Copy link

Adding to the pile of people requesting an update to this...

@manzuni
Copy link

manzuni commented May 3, 2021

This would be a fantastic api endpoint! Any update?

@gogetta69
Copy link

Why have it in the documents if it's planned but not yet released. You could have at least stated that in the documents that its coming in the future.

@LucasssD
Copy link

LucasssD commented May 4, 2021

Why have it in the documents if it's planned but not yet released. You could have at least stated that in the documents that its coming in the future.

Exactly, you need to go to issues to know that this endpoint is not released yet. Probably it's not even implemented yet.
What a dump approach...

@ChefKai
Copy link
Contributor

ChefKai commented May 4, 2021

Hello everyone 👋

We have just released the endpoint for querying a token, on both v1 and v2; you can use it right away!
Documentation
Pair endpoint will follow shortly and an update will be sent here.

Thanks for your patience! Do not forget that the code is all open-source, and pull request are welcome!

@masterkain
Copy link

pro stuff, thanks

@ivancsicsmarkus
Copy link

@ChefKai how is "price denominated in USD" calculated for a token? Is it based on the USDT pair or is it calculated in a different way?

@ChefKai
Copy link
Contributor

ChefKai commented May 4, 2021

Hello!

I think it would be very useful to have this information on the pairs:

  • Volume
  • Amount of each token
  • Liquidity size
  • Transactions

Thanks for your work.

That is planned when the next subgraph is deployed (which should be after the .info bounty program is finished). If you wish to keep track of this request, please open a new issue.

@ChefKai
Copy link
Contributor

ChefKai commented May 4, 2021

@ChefKai how is "price denominated in USD" calculated for a token? Is it based on the USDT pair or is it calculated in a different way?

We use a selective list of trusted assets (WBNB, BUSD, USDT, USDC, UST, VAI, BTCB, WETH, BETH) that a token must have a pair with in order to start indexing his price in USD and BNB; this avoid getting corrupted data when a token is having low liquidity as well, and/or a will to harm the ecosystem. You can check the logic within the pancakeswap/pancake-subgraph repository.

@dchakarov
Copy link

Does that explain why some tokens have a price of $0 @ChefKai?

@ChefKai
Copy link
Contributor

ChefKai commented May 4, 2021

Does that explain why some tokens have a price of $0 @ChefKai?

Yes it can be; it's either a delay in the subgraph indexing the data, or a lack of liquidity for the pair, or a lack of 'trusted' pairs; in such case, it's advised to directly query the token price though a Binance Smart Chain node; or use a 3rd-party API that might fill this needs (BitQuery, Covalent, ...).

@gogetta69
Copy link

Hello everyone 👋

We have just released the endpoint for querying a token, on both v1 and v2; you can use it right away!
Documentation
Pair endpoint will follow shortly and an update will be sent here.

Thanks for your patience! Do not forget that the code is all open-source, and pull request are welcome!

Ah man thank you so much for this. Glad to be holding some cake!

@BoboBruno
Copy link

Nice, but it won't work for many small tokens I tried. Any idea on how to fix this? Poocoin / Bogged work fine.

@ranamalo
Copy link

ranamalo commented May 5, 2021

Is there a way to either get the current value (total liquidity /total supply) in USD of an LP token or get the current total supply for an LP token so I can calculate it myself?

@BoboBruno
Copy link

Is there a way to either get the current value (total liquidity /total supply) in USD of an LP token or get the current total supply for an LP token so I can calculate it myself?

You can use the BSCscan API. I made it work this way, simply look at the holdings of the Pancakeswap pair address and use (USD total)/(#custom tokens) to get the price.

@millefh
Copy link

millefh commented May 7, 2021

Hello everyone 👋

We have just released the endpoint for querying a token, on both v1 and v2; you can use it right away!
Documentation
Pair endpoint will follow shortly and an update will be sent here.

Thanks for your patience! Do not forget that the code is all open-source, and pull request are welcome!

Any news on this?

@lcvass
Copy link

lcvass commented May 9, 2021

Anyone managed to fetch liquidity for a few pairs? I can get it using the /pairs/ endpoint but that would mean using ~46GB bandwidth daily for 1 request/second.

@ShinoyVK
Copy link

Hello Everyone,
is there any graph that is synced to 100% for pancake ?

@ShinoyVK
Copy link

@ChefKai
When I checked in the documentation, I could find an exchange link for the graph. But right now the exchange says it's failed. (Not synced to the latest block).
When can we expect a completely synced graph exchange. Or is there an exchange that is 100% synced like that of uniswap?

@radditarium
Copy link

Release plan is around next week ~

https://exchange.pancakeswap.finance/#/swap?outputCurrency=0xbb8170ad35325522c0026d67584d4fefbd08b750

Currency not showing in API which occur problem in listing on Blockfolio and CMC to get tracked price

@emsumagangjr
Copy link

Is there a way to either get the current value (total liquidity /total supply) in USD of an LP token or get the current total supply for an LP token so I can calculate it myself?

You can use the BSCscan API. I made it work this way, simply look at the holdings of the Pancakeswap pair address and use (USD total)/(#custom tokens) to get the price.

Newbie here, can you elaborate on this?
I want to convert the price to USD
https://api.pancakeswap.info/api/v2/tokens/0xb27adaffb9fea1801459a1a81b17218288c097cc

Thank you.

@lcvass
Copy link

lcvass commented Jun 10, 2021

Newbie here, can you elaborate on this?
I want to convert the price to USD
https://api.pancakeswap.info/api/v2/tokens/0xb27adaffb9fea1801459a1a81b17218288c097cc

Thank you.

You can choose a pool including that token and get the relative price. Using "Get BEP20-Token Account Balance for TokenContractAddress" section of BSCscan API docs, one call for each liquidity and divide one by another. I was using this but new API usage limits made it almost useless.

@BoboBruno
Copy link

Newbie here, can you elaborate on this?
I want to convert the price to USD
https://api.pancakeswap.info/api/v2/tokens/0xb27adaffb9fea1801459a1a81b17218288c097cc
Thank you.

You can choose a pool including that token and get the relative price. Using "Get BEP20-Token Account Balance for TokenContractAddress" section of BSCscan API docs, one call for each liquidity and divide one by another. I was using this but new API usage limits made it almost useless.

Yeah the API limits are cumbersome, but you can set up a CRON job (if you're making a ticker for a website) to avoid polling the API all too often.

@emsumagangjr
Copy link

Newbie here, can you elaborate on this?
I want to convert the price to USD
https://api.pancakeswap.info/api/v2/tokens/0xb27adaffb9fea1801459a1a81b17218288c097cc
Thank you.

You can choose a pool including that token and get the relative price. Using "Get BEP20-Token Account Balance for TokenContractAddress" section of BSCscan API docs, one call for each liquidity and divide one by another. I was using this but new API usage limits made it almost useless.

Yeah the API limits are cumbersome, but you can set up a CRON job (if you're making a ticker for a website) to avoid polling the API all too often.

Thanks guys, totally newbie here, I'll try to comprehend in your reply's.

Maybe, it will be easier to let you know what I am trying to achieve here.
Basically, I want to convert the price from pancakeswap api to get a similar price to poocoin.app (USD Price).

Once again, thanks for helping.

@Dikshasoft
Copy link

Release plan is around next week ~

https://exchange.pancakeswap.finance/#/swap?outputCurrency=0xbb8170ad35325522c0026d67584d4fefbd08b750

Currency not showing in API which occur problem in listing on Blockfolio and CMC to get tracked price

I have the same issue and looking for support here:

https://api.pancakeswap.info/api/tokens/0x198deDfEB86eDa80836FE47FE8A0B496E71b71a9
https://api.pancakeswap.info/api/v2/tokens/0x198deDfEB86eDa80836FE47FE8A0B496E71b71a9

@lcvass
Copy link

lcvass commented Jun 11, 2021

Basically, I want to convert the price from pancakeswap api to get a similar price to poocoin.app (USD Price).

Don't use this API for now. Because tokens aren't pooled against USD they're using some approximation that, for now, is busted. The BNB price tends to be closer for me but still bad. If you just need $CAKE prices, Binance CEX may be a good place to fetch.

@BoboBruno
Copy link

Release plan is around next week ~

https://exchange.pancakeswap.finance/#/swap?outputCurrency=0xbb8170ad35325522c0026d67584d4fefbd08b750
Currency not showing in API which occur problem in listing on Blockfolio and CMC to get tracked price

I have the same issue and looking for support here:

https://api.pancakeswap.info/api/tokens/0x198deDfEB86eDa80836FE47FE8A0B496E71b71a9
https://api.pancakeswap.info/api/v2/tokens/0x198deDfEB86eDa80836FE47FE8A0B496E71b71a9

Where do you want to display the information? On a website? If so, set up a CRON job launching a PHP script which calls the BSCscan API and fetches the number of tokens (BNB/custom token) from the PancakeSwap pair address. You divide them to get the price (if you need it in dollar, you can fetch the BNB price from BSCscan API as well). That CRON job can then save the data to disk, and you fetch it from the website by importing it.

@Dikshasoft
Copy link

@BoboBruno Actually these APIs(https://api.pancakeswap.info/api/v2/tokens/0x198deDfEB86eDa80836FE47FE8A0B496E71b71a9) are being used by Coingeco/CMC to list the token into their platform. and they do not accept another way/APIs unfortunately.

I'm thinking that this might be to do with some syncing issues with Pancake APIs(?), I had created this token 3 days ago, and somehow in the NewPancakeSwapListings Group(https://t.me/NewPancakeSwapListings) it showed it's listed today(see attached).

I tried checking other Token from this group and all of them had the same issues. so could this be syncing problem?
pancake listing

@mike503
Copy link

mike503 commented Jun 13, 2021

+1 on this. for "ULTRA" (UltraSafe) for example...

pancakeswap.exchange
0.0000000185783 BUSD per ULTRA
0.0000000000553871 BNB per ULTRA

https://api.pancakeswap.info/api/v2/tokens/0x0b3f42481c228f70756dbfa0309d3ddc2a5e0f6a
0.00000002050100753410445863427917532999105 USD (or BUSD, assumed) per ULTRA
0.00000000006416554281700878607935634887435502 BNB per ULTRA

that's a 9% difference I cannot account for. even slippage, fees, etc... can't see how that much difference can occur.

@Dikshasoft
Copy link

@BoboBruno Actually these APIs(https://api.pancakeswap.info/api/v2/tokens/0x198deDfEB86eDa80836FE47FE8A0B496E71b71a9) are being used by Coingeco/CMC to list the token into their platform. and they do not accept another way/APIs unfortunately.

I'm thinking that this might be to do with some syncing issues with Pancake APIs(?), I had created this token 3 days ago, and somehow in the NewPancakeSwapListings Group(https://t.me/NewPancakeSwapListings) it showed it's listed today(see attached).

I tried checking other Token from this group and all of them had the same issues. so could this be syncing problem?
pancake listing

@BoboBruno @ChefKai - can you please check on this and confirm, the API needs to work before we can request CMC/CG.

Thank you in advance

@CasualEngineerZombie
Copy link

Good day people of the dark realm. 🙂 Is there any method on earth to get the total liquidity of a specific token in Pancakeswap?

@bbudickk
Copy link

Good day people of the dark realm. 🙂 Is there any method on earth to get the total liquidity of a specific token in Pancakeswap?

hey! maybe did you find the way, how to do it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests