Using the API

A GraphQL API for exploring blockchain data. Get started in minutes with our beta endpoint and developer tools.
To play around with the data, you can use our reference implementation
  •  explorer.thegrid.id 
  • or use our main discovery experince, that is based on the explorer at  thegrid.id 
This can also generate queries, however be aware that the queries that are generated do use variables.
Check our Github for repos that contain the explorer and other scripts:
  •  https://github.com/orgs/The-Grid-Data/repositories 

Quickstart


Beta endpoint (TGS7 and Beyond):
To start playing with it quickly:
Link Try it now
  • Sample Query (cURL)
curl -X POST \
 -H "Content-Type: application/json" \
 -d '{
   "query": "query MyQuery { profileInfos(limit: 10) { name descriptionShort icon logo } }"
 }' \
 https://beta.node.thegrid.id/graphql

Python implementation

import requests
import json


# API endpoint
API_URL = "https://beta.node.thegrid.id/graphql"


# GraphQL query
query = """
query MyQuery {
   profileInfos(limit: 10) {
       name
       descriptionShort
       icon
       logo
   }
}
"""


payload = {"query": query}
headers = {'Content-Type': 'application/json'}


try:
   response = requests.post(API_URL, json=payload, headers=headers)
   response.raise_for_status()
   
   result = response.json()
   print("Success!")
   print(json.dumps(result, indent=2))
   
except requests.exceptions.RequestException as e:
   print(f"Error: {e}")
except json.JSONDecodeError:
   print(f"Invalid JSON response: {response.text}")

Response format
{
 "data": {
   "profileInfos": [
     {
       "name": "Example Profile",
       "descriptionShort": "A profile description example",
       "icon": "https://img.thegrid.id/harvest/icon.svg",
       "logo": "https://img.thegrid.id/harvest/logo.svg"
     }
   ]
 }
}
Error Handling
{
 "data": {
   "roots": null
 },
 "errors": [
   {
     "message": "internal error",
     "path": [
       "roots"
     ]
   }
 ]
}