🏎️Price API

Provides real-time and historical price data for tokens listed on PiperX. > Supports querying tokens without transactions (price = 0) and up to 7 days of hourly snapshots.

1. Get All Tokens

Fetch all tokens and their latest price on PiperX (V2 & V3), including tokens without transactions.

Endpoint

[GET] https://piperxdb.piperxprotocol.workers.dev/api/piperxapi/getAllTokens

Example Request

curl https://piperxdb.piperxprotocol.workers.dev/api/piperxapi/getAllTokens

Example Response

{
  "tokens": [
    {
      "id": "0x1514000000000000000000000000000000000000",
      "name": "Wrapped IP",
      "symbol": "WIP",
      "decimals": 18,
      "latestPriceUSD": "6757786",
      "latestPriceNative": "1000000000000000000"
    }
  ]
}

2. Get Historical Token Prices

Fetch 24-hour and 7-day price history of one or more tokens.

Endpoint

[POST] https://piperxdb.piperxprotocol.workers.dev/api/piperxapi/getAllTokenPrices

Request Body

Note: If the addresses field is omitted or left empty, the API will return historical price data for all tokens.

Example Request

Example Response

Last updated