> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raze.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Query the history service over GraphQL — one request, many inputs

## Endpoint

All history GraphQL traffic goes to a single endpoint:

```
POST /api/sol/graphql
```

Available globally at `https://api.raze.bot/api/sol/graphql`. GeoDNS routes the request to the nearest history host automatically.

## Authentication

Same API key as the REST endpoints. Send it in the `x-api-key` header (or as `Authorization: Bearer sk_...`):

```bash theme={null}
curl -X POST https://api.raze.bot/api/sol/graphql \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_your_key_here" \
  -d '{"query":"query { solPrice { solPrice } }"}'
```

## Interactive Playground (GraphiQL)

The History API serves a **GraphiQL playground** on `GET /api/sol/graphql` — open it directly in a browser:

<Card title="Open GraphiQL" icon="play" href="https://api.raze.bot/api/sol/graphql">
  [https://api.raze.bot/api/sol/graphql](https://api.raze.bot/api/sol/graphql)
</Card>

The UI is unauthenticated (static HTML only). To run queries, paste your API key into the **Headers** panel at the bottom:

```json theme={null}
{ "x-api-key": "sk_your_key_here" }
```

Schema introspection, autocomplete, inline docs, and query history are all built in.

## When to use GraphQL vs. REST

| You want…                                                             | Use                                                  |
| --------------------------------------------------------------------- | ---------------------------------------------------- |
| A single wallet's trades, token OHLCV, or simple lookups              | **REST** — lower overhead, cached per-URL            |
| Many inputs merged into one response (e.g. trades across 500 signers) | **GraphQL** — one round trip, one merged result      |
| Top-token leaderboards **plus** enrichment for hundreds of mints      | **GraphQL** — see [Trending board](./trending-board) |
| To fetch multiple resources in one request                            | **GraphQL** — multi-root queries                     |
| Only a subset of fields                                               | **GraphQL** — pick exactly what you need             |

## Batch token enrichment

`tokens(mints: [String!]!)` returns up to **500** deduplicated mints. Each item is a `Token` object — request only the nested fields you need:

* `deploy`, `priceChanges`, `tradingVolume(hours)`, `metadata`, `holders(limit, fresh)`, `supply`, `sniperBundleStats`, `topTraders(limit)`, `ohlcv(...)`

The server resolves each field with the same caches and backends as the matching REST routes. Your client sends **one HTTP request**; the server fans out work in parallel.

<Card title="Trending board example" icon="layer-group" href="/api-reference/history/graphql/trending-board">
  Leaderboards + per-mint enrichment in one query
</Card>

## Available Queries

The schema mirrors the REST surface. Top-level query fields include:

* `tradesByMint`, `tradesBySigner`, `tradesBySignerAndMint`, `tradingVolume` — trades & volume ([Trades](./trades))
* `topTokens(hours?, limit?, sort?, platform?)` — ranked tokens (`VOLUME` or `TXNS`) ([Tokens](./tokens))
* `tokens(mints)` — batch per-mint enrichment ([Tokens](./tokens), [Trending board](./trending-board))
* `tokenMetadata`, `tokenHolders`, `tokenSupply`, `topTraders`, `sniperBundleStats` — single-mint shortcuts
* `recentDeploys`, `deployByMint`, `recentMigrations`, `liveDeploys`, `liveMigrations`, `migratingDeploys` — deploys & live board
* `searchTokens`, `stats`, `ohlcv`, `priceChanges`, `signerCounts` — discovery & analytics
* `walletSummary`, `walletTokens`, `walletPerformance` — wallets ([Wallets](./wallets))
* `fundingLookup`, `fundedBy`, `fundingChain`, `fundingCluster`, `holderEdges` — funding graph ([Funding](./funding))
* `pnlLeaderboard`, `pnlSummary`, `platformVolume`, `bondingStats` — platform ([Platform](./platform))
* `recentAlerts`, `topAlerts`, `alertsByMint`, `sentiment`, `latestSentiment` — alerts & sentiment
* `perpMarkets`, `perpCandles`, … — Jupiter Perps ([Perpetuals](./perp))

Use **GraphiQL** (`GET /api/sol/graphql`) for the full introspected schema, autocomplete, and field docs.

See each query's dedicated page in this section for arguments and return shapes.

## Pagination

All `...Connection` return types use opaque cursor pagination identical to the REST endpoints. A response with `hasMore: true` includes a `nextCursor` string — pass it back as the `cursor` argument on the next call. Cursors encode `(timestamp, signature)` so pages are stable even when new rows arrive.

## Errors

GraphQL always returns HTTP 200 when the request parses. Application errors appear under an `errors` array:

```json theme={null}
{
  "data": null,
  "errors": [{ "message": "Invalid signer address" }]
}
```

Auth errors still return HTTP 401 with the standard JSON body before the GraphQL layer is reached.
