The Snapshot Subgraph
You can see an interactive query playground on the Snapshot subgraph’s page on The Graph Explorer, where you can test any query. Check out the following examples:Schema
The schema for this subgraph is defined here in Snapshot’s GitHub.
Snapshot Subgraph endpoint
https://gateway.thegraph.com/api/\[api-key]/subgraphs/id/4YgtogVaqoM8CErHWDK8mKQ825BcVdKB8vBYmb4avAQo This is visible from the Snapshot subgraph’s page on Graph Explorer.
How to obtain your own API key
- Go to thegraph.com/studio and connect your wallet.
- Go to https://thegraph.com/studio/apikeys/ to create an API key.
- You can use this API key on any subgraph on Graph Explorer, and it’s not limited to just Snapshot.
Other Snapshot Subgraphs
See all other subgraphs published by Snapshot Labs.How to Query through the API
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.Sample code (Node.js):
How to use the Visual Query Editor
You can use the GraphiQL Explorer to compose your GraphQL queries by clicking on the fields you want.