Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: SQD Portal Datasets API
version: 1.0.0
summary: Streaming HTTP access to decoded blockchain data across 110+ networks.
description: 'The SQD Portal serves raw and decoded onchain data (blocks, transactions, logs, traces,
state diffs, Solana instructions, Bitcoin transactions, Hyperliquid fills) over plain
HTTP, one dataset per network. Responses to the stream endpoints are JSON Lines, so a
client reads them incrementally instead of buffering a whole range.
The public Portal at https://portal.sqd.dev shares capacity across users and is intended
for development and bounded evaluation. Authenticated and dedicated portals take an API
key in the `x-api-key` header; the paths and payloads are identical either way.
Every error, on every status code, is JSON: `{"error":{"type","code","message"}}`. Match on
`error.code`, not on the message text.
## Versioning
This API is deliberately unversioned. There is no `/v1/` path segment and no version request
header: every client talks to the same surface at https://portal.sqd.dev. That works because
the surface only grows by addition. New dataset types, new block and transaction fields, and
new datasets appear without changing what an existing request means, so there is never a
second version to migrate to. `info.version` above tracks this description, not the API.
What is stable, and safe to code against: endpoint paths and HTTP methods, the error envelope,
`error.type` as a closed set of four values, an `error.code` value once published, and a field
name in a selector once accepted. What is NOT stable: the prose in `error.message`, the order
of datasets in `GET /datasets`, the set of datasets, and worker assignments in
`GET /datasets/{dataset}/state`.
## Deprecation
Endpoints are not deprecated or sunset; the dataset catalogue is what changes. A dataset
retirement is announced ahead of the date at https://docs.sqd.dev/announcements, naming the
affected datasets and the date, and in the developer chat. Watch that page rather than polling:
after the date, a retired name answers 404 with `error.code` of `unknown_dataset`, which is the
removal signal, not a warning. Diff this document to detect any other change; every operation
carries a stable `operationId` for exactly that.
The SDKs version separately, as npm packages on semantic versioning. A breaking change lands in
a major release with a migration guide, and the Portal keeps serving older SDK versions.
## Rate limits
A capacity refusal answers `error.code` of `overloaded` with a mandatory `Retry-After` header,
in seconds, never below 1. There is no quota or remaining-request header to poll: honour
`Retry-After` and retry the identical request. Both `Retry-After` and `x-request-id` are
exposed through CORS, so browser clients can read them.
What the Portal does NOT serve: reconstructed contract state. There is no balance-at-block
or `balanceOf` call. Balances are derived by the caller from transfer and state-diff data.'
contact:
name: SQD
url: https://sqd.dev/contact/
termsOfService: https://sqd.dev/imprint/
x-api-versioning:
strategy: none
summary: 'Unversioned by design: no URL path segment, no version header. The surface changes only by addition.'
policyUrl: https://docs.sqd.dev/en/portal/introduction/versioning
humanUrl: https://sqd.dev/developers/#versioning
x-api-deprecation:
channel: https://docs.sqd.dev/announcements
summary: Dataset retirements are announced ahead of the date on the announcements page. Endpoints are not sunset. A retired dataset answers 404 with error.code unknown_dataset.
signal: error.code=unknown_dataset
humanUrl: https://sqd.dev/developers/#versioning
x-rate-limits:
strategy: retry-after
summary: No quota headers. A capacity refusal carries a mandatory Retry-After in seconds, never below 1, on 429 and 529.
retryAfterHeader: Retry-After
policyUrl: https://docs.sqd.dev/en/portal/introduction/error-handling
humanUrl: https://sqd.dev/developers/#rate-limits
servers:
- url: https://portal.sqd.dev
description: Public SQD Portal. Shared capacity, for development and bounded evaluation.
- url: https://{portal}
description: Authenticated or dedicated portal. Same paths and payloads as the public one.
variables:
portal:
default: portal.sqd.dev
description: Hostname of the dedicated portal issued to your organisation.
security:
- {}
- portalApiKey: []
tags:
- name: Datasets
description: Discover networks and inspect what a dataset currently holds.
paths:
/datasets:
get:
operationId: listDatasets
summary: List every available dataset
description: 'Returns one entry per supported network, with its canonical name, any aliases, and whether it carries real-time data. Start here: the `dataset` path parameter of every other operation comes from this list.'
tags:
- Datasets
responses:
'200':
description: The datasets this portal serves.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Dataset'
examples:
default:
summary: Truncated live response
value:
- dataset: arbitrum-one
aliases: []
real_time: true
- dataset: base-mainnet
aliases: []
real_time: true
'405':
description: Wrong HTTP method for this path. `error.code` is `method_not_allowed`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: 'Rate limited: a capacity refusal proxied from a data source. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.'
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal error.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'529':
description: The Portal is at capacity. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/datasets/{dataset}/metadata:
get:
operationId: getDatasetMetadata
summary: Describe one dataset
description: Returns the dataset name, aliases, whether it is real-time, and its `start_block`. A query with `fromBlock` below `start_block` is rejected with 400, so read this first when querying deep history.
tags:
- Datasets
parameters:
- name: dataset
in: path
required: true
description: Dataset name or alias, one per network (e.g. `ethereum-mainnet`, `solana-mainnet`, `base-mainnet`). Enumerate the current set with `listDatasets`.
schema:
type: string
pattern: ^[a-z0-9][a-z0-9-]*$
examples:
- ethereum-mainnet
responses:
'200':
description: Dataset metadata.
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetMetadata'
examples:
default:
summary: Live response for ethereum-mainnet
value:
dataset: ethereum-mainnet
aliases: []
real_time: true
start_block: 0
'404':
description: Unknown dataset. `error.code` is `unknown_dataset`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'405':
description: Wrong HTTP method for this path. `error.code` is `method_not_allowed`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: 'Rate limited: a capacity refusal proxied from a data source. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.'
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'529':
description: The Portal is at capacity. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/datasets/{dataset}/head:
get:
operationId: getDatasetHead
summary: Get the highest available block
description: Returns the number and hash of the highest block the dataset holds, real-time data included, or `null` when the dataset is empty. Use it to bound a query or to check how far ingestion has progressed.
tags:
- Datasets
parameters:
- name: dataset
in: path
required: true
description: Dataset name or alias, one per network (e.g. `ethereum-mainnet`, `solana-mainnet`, `base-mainnet`). Enumerate the current set with `listDatasets`.
schema:
type: string
pattern: ^[a-z0-9][a-z0-9-]*$
examples:
- ethereum-mainnet
responses:
'200':
description: Highest available block, or null.
content:
application/json:
schema:
$ref: '#/components/schemas/BlockHead'
examples:
default:
summary: Live response for ethereum-mainnet
value:
number: 25826425
hash: '0x252be3366c3493c60d065a0145f69936e3485a78e1ab02865ede976342dcdac0'
'404':
description: Unknown dataset. `error.code` is `unknown_dataset`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'405':
description: Wrong HTTP method for this path. `error.code` is `method_not_allowed`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: 'Rate limited: a capacity refusal proxied from a data source. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.'
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'529':
description: The Portal is at capacity. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/datasets/{dataset}/finalized-head:
get:
operationId: getDatasetFinalizedHead
summary: Get the highest finalized block
description: Same as `getDatasetHead`, restricted to finalized blocks. Anything at or below this height will not be reorganised, so it is the safe watermark for irreversible bookkeeping.
tags:
- Datasets
parameters:
- name: dataset
in: path
required: true
description: Dataset name or alias, one per network (e.g. `ethereum-mainnet`, `solana-mainnet`, `base-mainnet`). Enumerate the current set with `listDatasets`.
schema:
type: string
pattern: ^[a-z0-9][a-z0-9-]*$
examples:
- ethereum-mainnet
responses:
'200':
description: Highest finalized block, or null.
content:
application/json:
schema:
$ref: '#/components/schemas/BlockHead'
'404':
description: Unknown dataset. `error.code` is `unknown_dataset`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'405':
description: Wrong HTTP method for this path. `error.code` is `method_not_allowed`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: 'Rate limited: a capacity refusal proxied from a data source. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.'
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'529':
description: The Portal is at capacity. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/datasets/{dataset}/timestamps/{timestamp}/block:
get:
operationId: resolveTimestampToBlock
summary: Resolve a Unix timestamp to a block number
description: 'Returns the first block at or after the given instant. Block numbers are not comparable
across networks, so this is how a caller lines up the same wall-clock window on several
chains before querying each one. On Solana the same field carries a slot.
The timestamp is in **seconds**. Passing milliseconds does not error in an obvious way:
the value lands far beyond the chain head and comes back as a 404, so a client that
forgets to divide sees "not found" rather than "wrong unit".'
tags:
- Datasets
parameters:
- name: dataset
in: path
required: true
description: Dataset name or alias, one per network (e.g. `ethereum-mainnet`, `solana-mainnet`, `base-mainnet`). Enumerate the current set with `listDatasets`.
schema:
type: string
pattern: ^[a-z0-9][a-z0-9-]*$
examples:
- ethereum-mainnet
- name: timestamp
in: path
required: true
description: Unix timestamp in seconds, not milliseconds.
schema:
type: integer
format: int64
minimum: 0
examples:
- 1748736000
responses:
'200':
description: The first block at or after the timestamp.
content:
application/json:
schema:
$ref: '#/components/schemas/TimestampBlock'
examples:
default:
summary: 2025-06-01 00:00:00 UTC on Base, from a live response
value:
block_number: 30973327
'400':
description: The timestamp is not an integer. `error.code` is `malformed_request`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Unknown dataset (`unknown_dataset`), or the timestamp is beyond the highest block the dataset holds (`not_found`). A millisecond timestamp lands here.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'405':
description: Wrong HTTP method for this path. `error.code` is `method_not_allowed`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: 'Rate limited: a capacity refusal proxied from a data source. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.'
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'529':
description: The Portal is at capacity. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/datasets/{dataset}/state:
get:
operationId: getDatasetState
summary: Get stored block ranges per worker
description: Returns which block ranges each SQD Network worker currently holds, plus the highest seen block and the first gap. Intended for diagnostics and network status views. The response is large (tens of MB for a mature dataset); prefer `getDatasetMetadata` or `getDatasetHead` for routine checks.
tags:
- Datasets
parameters:
- name: dataset
in: path
required: true
description: Dataset name or alias, one per network (e.g. `ethereum-mainnet`, `solana-mainnet`, `base-mainnet`). Enumerate the current set with `listDatasets`.
schema:
type: string
pattern: ^[a-z0-9][a-z0-9-]*$
examples:
- ethereum-mainnet
responses:
'200':
description: Stored ranges for the dataset.
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetState'
'404':
description: Unknown dataset. `error.code` is `unknown_dataset`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'405':
description: Wrong HTTP method for this path. `error.code` is `method_not_allowed`.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: 'Rate limited: a capacity refusal proxied from a data source. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.'
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'529':
description: The Portal is at capacity. `error.type` is `rate_limit_error` and `error.code` is `overloaded`. Wait the number of seconds in `Retry-After`, then retry the identical request.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
DatasetMetadata:
type: object
title: DatasetMetadata
required:
- dataset
- aliases
- real_time
- start_block
properties:
dataset:
type: string
description: Canonical dataset name.
aliases:
type: array
description: Alternative names.
items:
type: string
real_time:
type: boolean
description: Whether real-time blocks are served.
start_block:
type: integer
format: int64
description: Lowest block available. A `fromBlock` below this is a 400.
BlockHead:
type:
- object
- 'null'
title: BlockHead
description: A block reference, or null when the dataset is empty.
required:
- number
- hash
properties:
number:
type: integer
format: int64
description: Block number.
hash:
type: string
description: Block hash.
DatasetState:
type: object
title: DatasetState
description: Which ranges each worker holds. Large; diagnostics only.
required:
- worker_ranges
- highest_seen_block
properties:
worker_ranges:
type: object
description: Keyed by worker peer ID.
additionalProperties:
type: object
required:
- ranges
properties:
ranges:
type: array
items:
type: object
required:
- begin
- end
properties:
begin:
type: integer
format: int64
description: First block, inclusive.
end:
type: integer
format: int64
description: Last block, inclusive.
highest_seen_block:
type: integer
format: int64
description: Highest block number seen for this dataset.
first_gap:
type: integer
format: int64
description: First block number with missing coverage, when one exists.
TimestampBlock:
type: object
title: TimestampBlock
description: The block a timestamp resolves to. On Solana `block_number` carries a slot.
required:
- block_number
properties:
block_number:
type: integer
format: int64
description: Number of the first block at or after the requested instant.
ErrorResponse:
type: object
title: ErrorResponse
description: The single error envelope, returned as JSON on every failing status code. Match on `error.code`; `error.message` is written for humans and may be reworded.
required:
- error
properties:
error:
type: object
description: The error itself. Present on every failing response.
required:
- type
- code
- message
properties:
type:
type: string
description: Error class.
examples:
- invalid_request_error
code:
type: string
description: Stable, machine-matchable identifier.
examples:
- unknown_dataset
- malformed_request
- method_not_allowed
- not_found
message:
type: string
description: Human-readable explanation.
examples:
- error:
type: invalid_request_error
code: unknown_dataset
message: 'Unknown dataset: not-a-real-dataset'
Dataset:
type: object
title: Dataset
description: One network served by this portal.
required:
- dataset
- aliases
- real_time
properties:
dataset:
type: string
description: Canonical dataset name, used in every path.
examples:
- ethereum-mainnet
aliases:
type: array
description: Alternative names accepted in the same position.
items:
type: string
real_time:
type: boolean
description: Whether the dataset carries unfinalized, real-time blocks.
headers:
RetryAfter:
description: 'Seconds to wait before retrying the identical request. Never an HTTP date, and never below 1. Mandatory on every `overloaded` response (429 and 529) and present on some `availability_error` responses. This is the whole throttle signal: the Portal publishes no quota or remaining-request header, so a client self-throttles by honouring this value rather than by tracking a budget. Exposed through CORS, so browser clients can read it.'
required: false
schema:
type: integer
minimum: 1
examples:
- 10
RequestId:
description: Identifier for this request, on every response. Quote it when reporting a problem; it is also repeated in `error.request_id` on 5xx bodies. Exposed through CORS.
required: false
schema:
type: string
examples:
- 0198c3f1-0000-7000-8000-000000000000
securitySchemes:
portalApiKey:
type: apiKey
in: header
name: x-api-key
description: API key for an authenticated or dedicated portal. The public Portal accepts requests without one. See https://docs.sqd.dev/en/portal/pricing for access options.
externalDocs:
description: SQD developer documentation
url: https://docs.sqd.dev/en/api/evm/introduction