Skip to main content
The GraphQL endpoint is the right choice when you want to shape your response — picking exactly the fields you need across multiple data products in one request. If REST is “look up this one thing”, GraphQL is “answer this one analytical question.”

Endpoint

POST https://graphql.chainstream.io/graphql
Or use the GraphQL IDE to explore interactively.

Authentication

Two equivalent paths — pick whichever fits your client:
# API Key (browser, server, most clients)
-H "X-API-KEY: $CHAINSTREAM_API_KEY"
-H "Content-Type: application/json"

# SIWX wallet token (agents / on-host wallets)
-H "Authorization: SIWX <token>"
-H "Content-Type: application/json"
GraphQL and REST share the same API Key and subscription quota — no separate purchase.

First query

query TopSolanaTokens {
  tokens(chain: SOLANA, orderBy: VOLUME_24H_DESC, limit: 5) {
    address
    symbol
    priceUsd
    marketCap
    recentTrades(limit: 3) {
      timestamp
      sizeUsd
      side
    }
  }
}
One request returns tokens, metadata and their recent trades — no N+1 roundtrips.

When to use

  • Analytical queries crossing multiple data products
  • Dashboards that need many fields without overfetching
  • Reporting / BI workloads
  • Server-side rendering where you pre-shape the response
When not to: real-time streams (use WebSocket/Kafka) and hot-path reads where REST caching is cheaper.

Invoke from CLI

The chainstream CLI ships with graphql schema (for discovery) and graphql query (for execution) — no need to wire up a client library for quick checks or shell automation:
# Discover the 27 cubes
chainstream graphql schema --summary
chainstream graphql schema --type DEXTrades

# Run a query from a file
chainstream graphql query --file ./query.graphql --json

Schema

Schema overview

Types, relationships and conventions.

Getting started

Complete first-query walkthrough.

Next

GraphQL IDE

Explore the schema and run queries interactively.

chainstream-graphql skill

Structured Agent Skill for GraphQL workflows.

CLI `graphql` subcommand

chainstream graphql schema and query reference.

SDKs

Typed GraphQL wrappers via codegen.