The complexity of working with blockchain data
Tags: communitycontributio, community
Published: 2020-12-02 07:13:05

---
title: The complexity of working with blockchain data
published: true
date: 2020-11-18 13:05:47 UTC
tags: CommunityContributio,community
canonical_url: https://bitquery.io/blog/working-with-blockchain-data?utm_source=rss&utm_medium=rss&utm_campaign=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.

![crypto dashboard](https://bitquery.io/wp-content/uploads/2020/11/image-3.png)

## **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](https://explorer.bitquery.io/ethereum/address/0x82eaa009e9cae43955a3ef9d1de3bf68f5154200/transactions). 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.

![python code](https://bitquery.io/wp-content/uploads/2020/11/image-2.png)

## **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](https://explorer.bitquery.io/) 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:

- [Ethereum DEX GraphQL APIs with Examples](https://bitquery.io/blog/ethereum-dex-graphql-api)
- [How to get newly created Ethereum Tokens?](https://bitquery.io/blog/newly-created-etheruem-token)
- [How to investigate an Ethereum address?](https://bitquery.io/blog/investigate-ethereum-address)
- [API to get Ethereum Smart Contract Events](https://bitquery.io/blog/ethereum-events-api)
- [Simple APIs to get Latest Uniswap Pair Listing](https://bitquery.io/blog/uniswap-pool-api)
- [ETH2.0 Analytical Explorer, Widgets, and GraphQL APIs](https://bitquery.io/blog/eth2-explorer-api-widgets)
- [The Graph vs Bitquery – Solving Blockchain Data Problems](https://bitquery.io/blog/thegraph-and-bitquery)
- [Analyzing Decentralized Exchange using Bitquery Blockchain Explorer](https://bitquery.io/blog/dex-blockchain-explorer)

#### **About** Bitquery

[**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are:

- **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://blog.bitquery.io/coinpath-blockchain-money-flow-apis) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://blog.bitquery.io/coinpath-api-get-start).

- **[Digital Assets API](https://bitquery.io/products/digital_assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. 

- **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc.

If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info) or email us at [hello@bitquery.io](mailto:hello@bitquery.io). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world.

The post [The complexity of working with blockchain data](https://bitquery.io/blog/working-with-blockchain-data) appeared first on [Bitquery](https://bitquery.io).