Binance BSC logs API request data failed

181 Views Asked by At

I am submitting a request for data from the Binanance API as follows:

https://api.bscscan.com/api
    ?module=logs
    &action=getLogs
    &fromblock=24726622
    &toBlock=24726632
    &address=0x94084b7a8d80b2c3cc0dccd87cb6ae3cc67d364d
    &topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
    &apikey=JRYDR6FBWRKY5C8NMZJKFB8GEP1QHFQJQT

However, I can't get any data from this URL. I have double-checked, and I know that the parameters are correct.

Here is an example of using Binanace's API, which works well:

https://api.bscscan.com/api
   ?module=logs
   &action=getLogs
   &fromBlock=4993830
   &toBlock=4993832
   &address=0xe561479bebee0e606c19bb1973fc4761613e3c42
   &topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
   &apikey=YourApiKeyToken

Why is that working but mine not working?

1

There are 1 best solutions below

0
On

I would highly suggest using Postman, which you can use to quickly test requests. I ran your request, with api-key, through Postman and was able to get a 200 response with data. See this screenshot.

Please note I blanked out the api key value. I suggest you do the same in your post unless its fake.

I had to remove the line breaks in the code you pasted. Could this possibly be the issue?