API Directory › 🔗 Blockchain & Web3 › Bitquery
API KeyHTTPSCORS

Bitquery API

GraphQL APIs for on-chain data, DEX trades and analytics across chains.

Auth
API Key
HTTPS
Yes
CORS
Yes
Open Bitquery docs ↗

What it does

Bitquery is a GraphQL API for on-chain data across 40+ blockchains: transfers, DEX trades, smart-contract events, balances, token holders, NFT activity and mempool streams — queryable with filters, aggregations and time ranges, plus real-time GraphQL subscriptions.

Base URL

https://streaming.bitquery.io/graphql

Authentication

Register for an account. The current API uses an OAuth 2.0 Bearer access token (generate it from your dashboard) sent as Authorization: Bearer YOUR_TOKEN. The legacy v1 endpoint (graphql.bitquery.io) used an X-API-KEY header and is being phased out.

Code examples

curl
curl -s -X POST https://streaming.bitquery.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BITQUERY_TOKEN" \
  -d '{"query":"{ EVM(network: eth) { Transfers(limit: {count: 3}) { Transfer { Amount Currency { Symbol } } } } }"}'
Python
import requests

q = """{ EVM(network: eth) {
  DEXTrades(limit: {count: 5}, orderBy: {descending: Block_Time}) {
    Trade { Buy { Currency { Symbol } Amount } Sell { Currency { Symbol } } } } } }"""
r = requests.post("https://streaming.bitquery.io/graphql",
  json={"query": q},
  headers={"Authorization": f"Bearer {TOKEN}"}, timeout=30)
print(r.json()["data"]["EVM"]["DEXTrades"])

Rate limits & quotas

Free ‘Developer’ tier: a modest monthly points budget (queries cost points by complexity), limited history depth, and a low requests-per-minute cap. Real-time subscriptions and deep historical/archive queries need a paid plan. Over budget returns a GraphQL error, sometimes with HTTP 402/429.

Key response fields

data.EVM / data.Solana / data.BitcoinTop-level network wrapper you query under
Transfers / DEXTrades / Calls / Events / BalanceUpdatesThe dataset selectors
… Block { Time Number }Every record can include block context
errors[]GraphQL-level errors: schema mismatch, over-budget, timeout

Common errors

401Missing or expired Bearer token.
400Query doesn’t match the (large) schema — use the IDE at ide.bitquery.io to build it.
402 / 429Points budget or rate limit exhausted.
(timeout)Unbounded or heavily aggregated query — add limit and a tighter time filter.

When to use it (and alternatives)

Strong for cross-chain analytics and DEX/trade data expressed as one GraphQL query — dashboards, trading tools, token-flow analysis. For a single protocol’s entities use The Graph; for wallet-portfolio data, Covalent or Moralis.

FAQ

V1 or V2?

Use the V2 ‘streaming’ endpoint (streaming.bitquery.io/graphql) with an OAuth Bearer token. The V1 graphql.bitquery.io + X-API-KEY setup is legacy and being retired — the schemas differ, so don’t mix them.

How do I build a query?

Use the hosted GraphQL IDE (ide.bitquery.io). It has schema autocomplete and example queries per chain/dataset — far easier than writing the nested structure by hand.

Why is my query timing out?

Aggregations over long ranges are expensive. Add a Block: { Time: { ... } } filter, a limit, and select only the fields you need.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Blockchain & Web3 APIs

← Back

More Blockchain & Web3 APIs · All 196 APIs