Skip to content

API Reference

REST API for programmatic access to ChainGraph data and features.

Base URL

https://app.chain-graph.com/api/v1

Authentication

All API requests require a valid session token passed as a cookie or Bearer token. Obtain a token by authenticating via the /api/v1/auth/login endpoint.

# Cookie-based (browser)
Cookie: session_token=eyJhbG...

# Bearer token (API clients)
Authorization: Bearer eyJhbG...

Anonymous endpoints (Explorer lookups, shared investigations) work without authentication but are subject to IP-based rate limits.

Endpoints

Health

MethodPathDescription
GET/healthService health check
GET/health/readyReadiness check (all dependencies)

Auth

MethodPathDescription
POST/auth/loginExchange Firebase token for session
POST/auth/logoutInvalidate current session
GET/auth/meGet current user info

Explorer

MethodPathDescription
GET/chain/address/{address}Address summary
GET/chain/tx/{hash}Transaction details
GET/chain/block/{number}Block details
GET/chain/search?q=...Universal search

Investigations

MethodPathDescription
GET/investigationsList investigations
POST/investigationsCreate investigation
GET/investigations/{id}Get investigation
PATCH/investigations/{id}Update investigation
DELETE/investigations/{id}Delete investigation
POST/investigations/{id}/nodesAdd node
POST/investigations/{id}/edgesAdd edge
POST/investigations/{id}/shareGenerate share link
POST/investigations/{id}/exportExport investigation

Graph Queries

MethodPathDescription
POST/graph/cypherExecute Cypher query
POST/graph/expand/{address}Expand address connections

SQL Queries

MethodPathDescription
POST/sqlExecute SQL query
GET/sql/tablesList available tables

Labels

MethodPathDescription
GET/labels?address=...Get labels for address
POST/labelsCreate custom label
DELETE/labels/{id}Delete custom label

Monitors

MethodPathDescription
GET/monitorsList monitors
POST/monitorsCreate monitor
PATCH/monitors/{id}Update monitor
DELETE/monitors/{id}Delete monitor

Error format

{
  "detail": "Human-readable error message"
}

HTTP status codes follow standard REST conventions: 200 OK, 201 Created, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 429 Too Many Requests, 500 Internal Server Error.

Rate limits

API rate limits are per-user (authenticated) or per-IP (anonymous). Exceeding limits returns a 429 response with a Retry-After header.

Interactive docs

Full Swagger/OpenAPI documentation with “Try it” functionality is available at app.chain-graph.com/api/v1/docs.

API Reference — ChainGraph Docs