Reference

API

Blobscan provides api.blobscan.com, a REST API that you can use to retrieve blobs, blocks and transactions metrics and use them in your own dashboards.

This API provides also some endpoints that are used internally by the Indexer. For security, these endpoints are protected with a shared secret that is used for digitally signing JSON Web Tokens (JWT). This is what the SECRET_KEY environment variable is for.

Pagination

The /blocks, /transactions, and /blobs endpoints keep page-number pagination. Use p for the page number (default 1) and ps for the page size (default 50). Their request parameters and response fields are unchanged.

Cursor pagination (v1)

The /v1/blocks, /v1/transactions, and /v1/blobs endpoints use cursor pagination. To get the first page, omit cursor:

GET /v1/transactions?ps=50

The response includes the resource list and a pagination object:

{
  "transactions": [],
  "pagination": {
    "nextCursor": null,
    "previousCursor": null
  }
}

A cursor is a string that the client can use to request another page. Pass that string unchanged as the cursor parameter to get that page. Both directions use the same parameter. A null cursor means that no page exists in that direction. To return to the first page, omit cursor again.

Keep the resource, filters, and sort order the same when you use a cursor. If you change them, start with the first page. The server checks the cursor structure and position values. It does not check whether the query settings have changed. The cursor format is internal to the server; clients must not decode or construct tokens.

The ps parameter sets the page size. Its default is 50. It must be an integer from 1 to 100. The v1 routes do not accept p; requests that include it return an error. Use the existing unversioned routes if your client needs page-number pagination.

Total counts are optional. Use count=true to include the resource total. Pagination does not require a total count.

Each request uses the current database state. A cursor records a position, so it can still work if the record at that position was removed. Results can change after a chain reorganization. Pagination does not preserve a fixed snapshot between requests.

The server infers the opposite page from the cursor direction instead of querying for it. A request with a next cursor returns a previous cursor; a request with a previous cursor returns a next cursor. If matching records change, that inferred page can be empty. Empty pages return an inclusive recovery cursor in the opposite direction. Clients can also omit the cursor to restart from the first page.

Previous
FAQ / Troubleshooting
Next
CLI