API

All API examples use curl. A WebSocket client will be released soon, please get in touch for early access.

For real-time use WebSockets API and for historical use HTTP or WebSockets API.

Make a request

curl -s --location --request GET \
    "https://app.pangea.foundation/v1/api/status" \
    --header "Accept: application/jsonstream" \
    --header "Authorization: Basic $PANGEA_AUTH" | jq -s

Status is the health endpoint for chains and toolboxes that contain availability, syncing and block height.

Result

[
    {
        "type": "Chain",
        "chain": 1,
        "chain_code": "ETH",
        "chain_name": "Ethereum",
        "service": "chain",
        "entity": "block",
        "latest_block_height": 17572170,
        "timestamp": 1687886916,
        "status": "Ok"
    },
    ...
]

Query Parameters

All available chains and endpoints can be found by making a request to our /status endpoint, which should be called without any query parameters.

A chain parameter (?chain=ETH for example) is required for all other endpoints.
chain can also accept the EIP-155 chain ID 1 or our name Ethereum.

Support for multiple chains per request will be announced soon.

All requests default block filters on the latest block ?from_block=latest&to_block=latest. Set from_block to 1 to filter the whole chain ?from_block=1.

Filtering on other fields can be done directly on the field or by using a few conventions, using token0 as the example:

  • Filter directly by token0=0x....
  • Filter on a list by affixing __in comma separated by token0__in=0x1..,0x2...
  • Filter on a value greater than or equal to by affixing __gte
  • Filter on a value less than or equal to by affixing __lte

Response Format

Supported formats are JSON, JSON-LINES, CSV, Arrow-IPC

JSON is limited by block range, use JSON-LINES, CSV or Arrow-IPC for larger block ranges

Format can be specifed in two ways, by query parameter or Accept header. The query parameter takes precedence over Accept header.

?format=json_stream

--header "Accept: application/jsonstream"

Query parameter values

json, json_stream, csv, arrow

Accept headers

--header "Accept: text/csv"
--header "Accept: application/json"
--header "Accept: application/jsonstream"
--header "Accept: application/vnd.apache.arrow.stream"