Ethereum: Request Limit in Blockchain.info API
As a developer working with Ethereum’s blockchain, you may have come across the request limit
in various APIs. Specifically, when using the [Blockchain.com]( API to retrieve single blocks from the Ethereum network.
Here’s what I noticed:
GET /api/blockchain_api/v1/eth_blockchain/?block_hash=
The request is made with a maximum number of requests per hour. If you try to send multiple requests within one hour, it might lead to unexpected behavior or errors. The request limit
indicates the maximum number of times you can send an HTTP request to this API endpoint in a single hour.
To avoid hitting the request limit
, you need to make your own API call with a unique query parameter for each block. You can do that by appending a new query parameter, such as
, to the existing URL:
GET /api/blockchain_api/v1/eth_blockchain/?block_hash=&previous_hash=
By doing so, you’re making your own API call with a unique block hash and previous block hash each time. This approach ensures that you won’t hit the request limit
in one hour.
Note:
You can adjust this parameter as needed to fit your testing requirements. However, keep in mind that using a different query parameter for each request may not be ideal.
In summary, when making API calls to retrieve single blocks from the Ethereum network using Blockchain.com’s API, it’s essential to respect the request limit
by appending a new query parameter with every block hash request. This ensures you’re not hitting the limit and maintaining the integrity of your testing environment.