Subgraphs
Query data with Subgraphs on The Graph.
Last updated
Was this helpful?
Query data with Subgraphs on The Graph.
Last updated
Was this helpful?
Snapshot’s onchain data can be easily queried with open APIs known as subgraphs. Subgraphs are decentralized APIs powered by The Graph, a protocol for indexing & querying data from blockchains.
You can see an interactive query playground on the , where you can test any query.
Check out the following examples:
Example output
https://gateway.thegraph.com/api/[api-key]/subgraphs/id/4YgtogVaqoM8CErHWDK8mKQ825BcVdKB8vBYmb4avAQo
You can pass any GraphQL query to the Snapshot endpoint and receive data in JSON format.
This following code example will return the exact same output as above.
You can use the GraphiQL Explorer to compose your GraphQL queries by clicking on the fields you want.
The Graph is a decentralized protocol that enables seamless querying and indexing of blockchain data. It simplifies the complex process of querying blockchain data through the use of subgraphs (open APIs).
Anyone can query subgraphs on The Graph
All users get 100,000 free queries per month
Unlocking more queries is a seamless experience, you can pay with crypto or a credit card
The schema for this subgraph is defined .
This is visible from the on Graph Explorer.
Go to and connect your wallet.
Go to to create an API key.
You can use this API key on any subgraph on , and it’s not limited to just Snapshot.
For more information about querying data from your subgraph, .
To explore all the ways you can optimize & customize your subgraph for a better performance, read more about .