The Graph Subgraphs API

The Subgraphs API from The Graph — 2 operation(s) for subgraphs.

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/the-graph-subgraphs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

the-graph-subgraphs-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: The Graph Gateway ( GraphQL) Subgraphs API
  description: The Graph decentralized network gateway accepts POST GraphQL queries against individual subgraphs. The query URL embeds the API key directly in the path; alternatively the API key may be supplied as an Authorization Bearer token. Each subgraph defines its own GraphQL schema.
  version: '1.0'
  contact:
    name: The Graph Docs
    url: https://thegraph.com/docs/en/subgraphs/querying/introduction/
servers:
- url: https://gateway.thegraph.com
  description: The Graph decentralized gateway
security:
- bearerAuth: []
- {}
tags:
- name: Subgraphs
paths:
  /api/{apiKey}/subgraphs/id/{subgraphId}:
    parameters:
    - name: apiKey
      in: path
      required: true
      description: API key issued via Subgraph Studio.
      schema:
        type: string
    - name: subgraphId
      in: path
      required: true
      description: Deployed subgraph ID.
      schema:
        type: string
    post:
      summary: Execute a GraphQL query against a subgraph
      operationId: querySubgraph
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - query
              properties:
                query:
                  type: string
                variables:
                  type: object
                operationName:
                  type: string
      responses:
        '200':
          description: GraphQL response with data/errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                  errors:
                    type: array
                    items:
                      type: object
      tags:
      - Subgraphs
  /api/subgraphs/id/{subgraphId}:
    parameters:
    - name: subgraphId
      in: path
      required: true
      description: Deployed subgraph ID. API key provided via Authorization header.
      schema:
        type: string
    post:
      summary: Execute a GraphQL query against a subgraph (header-auth variant)
      operationId: querySubgraphHeaderAuth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - query
              properties:
                query:
                  type: string
                variables:
                  type: object
                operationName:
                  type: string
      responses:
        '200':
          description: GraphQL response with data/errors.
      tags:
      - Subgraphs
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: The Graph API key passed as an Authorization Bearer token.