The Complexity of Working with Blockchain Data
Note: In this article, Robert (Lead developer, XENTAVO) shares his experience of working with the blockchain data APIs and the problems he faced along the way. Robert is a Bitquery API user.
Most of our clients need customized reports measuring, for example, the current value of their tokens or the value of their portfolio combined with some key indicators. These reports rely on real-time data. For us, the best way to manage these reports is to use a Raspberry Pi device connected to a Hyperpixel 4 display. Our clients can simply place the Raspberry Pi device right on their desk, making it easy for us to collect real-time data and maintain individual reports remotely. Our developers have designed robust checks and balances system to ensure this data is accurate and reliable. We code primarily in Python.
Dealing with Cryptocurrency API
When creating blockchain reports, we do need an API for every new application. In some cases, we are using up to 20 different APIs, all with different settings and from different providers.
Not all APIs are created equal. For any specific task you can likely find multiple competing APIs that use different approaches and provide varying levels of documentation and support. The selection of the API is one of the key issues leading to success or failure of any implementation.
Selecting the correct API is time-consuming, and when the wrong API is chosen, it can lead to unnecessary processing time and costs. The criteria to select the correct API is cost (cost to develop and run the API), quality (incidents, code quality and automated error handling) and output (reuse of API and performance).
Error Handling
Additionally, APIs in our industry are not always reliable. There is often at least one API that is causing some sort of issue. In particular, Error 502 or 504 Gateway Errors pop up frequently.
Error codes are almost the last thing that you want to see in an API response. Generally speaking, it means one of two things: something was so wrong in your request or your handling that the API simply couldn’t parse the passed data, or the API itself has so many problems that even the most well-formed request is going to fail. In either situation, traffic comes crashing to a halt, and the troubleshooting process begins.
Data accuracy
Even when there isn’t an error, an API can deliver an incorrect value. This can happen, for example, when looking at transaction hashes of rebase tokens (such as Ampleforth). If token quantities are changed without being marked by a transaction hash, the values will not add up.
For example, let’s look at the Ampleforth in the address 0x82Eaa009E9CAE43955a3EF9D1DE3bF68f5154200. At the time of this writing, this address has 2193.34 AMPL. However, if you analyze the individual transactions, the sum is 8326.64 AMPL. The difference is coming from the rebase of AMPL. For developers, this discrepancy makes it difficult to know when to rely on the value presented by an API.
Multiple providers
It is easier to manage your APIs if they are coming from a single vendor. There is a lot of knowledge involved in selecting and managing even one API, let alone several.
Questions you will have to ask for each API include: Do we need an API key? Is a billing account attached to the project? Is the provided billing method valid (for example, an expired credit card)? Is there an exceeded self-imposed daily limit on the API? Does your API key have an IP address restriction? Keeping track of these details with several different API vendors can be a huge headache.
Bitquery API and Explorer
The above-mentioned issues are the main reasons we started using Bitquery APIs. Bitquery offers a set of tools that make it easy to plug and play, and we know their data is reliable. We use the Bitquery explorer to plan and configure the accessing of specific data. This tool allows us to effectively test the structure and result of our calls. Once we finish configuring our script, we plug the new script into our code. This process helps us significantly reduce the development time for our applications. In terms of speed, reliability, and simplified error handling, we find the Bitquery solution unbeatable.
Note: This article is contributed by Roberto Rey, a Lead Developer at XENTAVO, a Bitquery API user.
You might also be interested in:
- Building a Blockchain Intelligence System
- How to use GraphQL Alias and Aggregation?
- Offline Dashboards | Client only Blockchain data visualization and tools
- Ethereum DEX GraphQL APIs with Examples
- How to get newly created Ethereum Tokens?
- How to investigate an Ethereum address?
- API to get Ethereum Smart Contract Events
- Simple APIs to get Latest Uniswap Pair Listing
- ETH2.0 Analytical Explorer, Widgets, and GraphQL APIs
- The Graph vs Bitquery – Solving Blockchain Data Problems
- Analyzing Decentralized Exchange using Bitquery Blockchain Explorer
About Bitquery
Bitquery is your comprehensive toolkit designed with developers in mind, simplifying blockchain data access. Our products offer practical advantages and flexibility.
-
APIs - Explore API: Easily retrieve precise real-time and historical data for over 40 blockchains using GraphQL. Seamlessly integrate blockchain data into your applications, making data-driven decisions effortless.
-
Coinpath® - Try Coinpath: Streamline compliance and crypto investigations by tracing money movements across 40+ blockchains. Gain insights for efficient decision-making.
-
Data in Cloud - Try Demo Bucket: Access indexed blockchain data cost-effectively and at scale for your data pipeline. We currently support Ethereum, BSC, Solana, with more blockchains on the horizon, simplifying your data access.
-
Explorer - Try Explorer: Discover an intuitive platform for exploring data from 40+ blockchains. Visualize data, generate queries, and integrate effortlessly into your applications.
Bitquery empowers developers with straightforward blockchain data tools. If you have questions or need assistance, connect with us on our Telegram channel or via email at sales@bitquery.io. Stay updated on the latest in cryptocurrency by subscribing to our newsletter below.
Subscribe to our newsletter
Subscribe and never miss any updates related to our APIs, new developments & latest news etc. Our newsletter is sent once a week on Monday.