The Graph (Subgraph) API logo

The Graph (Subgraph) API

The Graph (Subgraph) API

The Graph is a decentralized Web3 data indexing network — query blockchain data via GraphQL via subgraphs deployed by developers with various data schemas.

Visit site ↗Documentation ↗Health checked 9h ago
Use it when

Decentralized (no single provider dependency)

Watch for

Steep learning curve (must understand subgraph manifest + AssemblyScript handlers)

First check

Create API key at thegraph.com/studio. POST GraphQL query to https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/{SUBGRAPH_ID}

Auth
api_key
CORS
?
HTTPS
Yes
Signup
?
Latency
143 ms
Protocol
GraphQL
Pricing
freemium

Uptime · 30-day window

Probes: 1Uptime: 100%Avg latency: 143ms
01

About this API

The Graph is Web3's "Google Indexing" — indexing raw on-chain transaction, contract event data into schemas (subgraphs) queryable via GraphQL. Background: using plain Ethereum RPC to query "Uniswap's 30-day pool swap totals" requires scanning millions of events — slow and expensive; with Uniswap's official subgraph, one GraphQL query returns results. All major DeFi protocols (Uniswap, Aave, Compound, Curve, Sushi) have official subgraphs; NFT collections have third-party subgraphs. The Graph network is decentralized — subgraphs hosted by community indexer nodes; developers pay queries with GRT tokens. Free tier 100k queries/month works for small projects. Hosted Service (centralized) was deprecated in 2024; must use Decentralized Network.

02

What you can build

  • 1DeFi protocol data dashboards
  • 2NFT collection analytics
  • 3Decentralized DApp backends
  • 4Web3 data indexing without reinventing
03

Strengths & limitations

Strengths

  • Decentralized (no single provider dependency)
  • GraphQL more flexible than RPC
  • Rich subgraph ecosystem (Uniswap, Aave, Compound all have official subgraphs)

Limitations

  • Steep learning curve (must understand subgraph manifest + AssemblyScript handlers)
  • Hosted Service deprecated; must use Decentralized Network
  • Some subgraphs index slowly
04

Example request

Generic template — replace <endpoint> with the real path from the docs.
curl https://thegraph.com/<endpoint> \
  -H "Authorization: Bearer $API_KEY"
# Some providers use X-Api-Key instead — verify in the docs.
05

Getting started

Create API key at thegraph.com/studio. POST GraphQL query to https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/{SUBGRAPH_ID}

06

FAQ

What if no ready-made subgraph exists?+

Write and deploy your own. Steep learning curve (subgraph manifest + handlers) but official tutorials exist.

How are GRT tokens used?+

Pay via Studio/Gateway. $10 GRT typically buys hundreds of thousands of queries.

07

Technical details

CORS: ?HTTPS: YesSignup: ?Open source: No
Auth type
api_key
Pricing
freemium
Rate limit
free 100k queries/月;超额按 GRT 代币计费
Protocols
GraphQL
SDKs
javascript, typescript, python
Response time
143 ms
Last health check
5/12/2026, 7:38:29 AM
08

Tags