API Documentation

Blockchain

The current prices of each active pair are updated every minute via an OP_RETURN output. The transaction is signed by the corresponding Pair ID.

OP_RETURN OP_FALSE 19dbzMDDg4jZ4pvYzLb291nT8uCqDa61zH <feature flag> <json string> <pair id> <timestamp>
OP_RETURN OP_FALSE 19dbzMDDg4jZ4pvYzLb291nT8uCqDa61zH 01 { "bitfinex": { "l": 97.39, "v": 732834 }, "bittrex": { "l": 97.86, "v": 27061 } ... } 12eLTxv1vyUeJtp5zqWbqpdWvfLdZ7dGf8 1575554700

JSON String


{
  "bitfinex": {    - source
    "l": 101.51,   - last price
    "v": 1710108   - 24hr volume
  },
  ...
}

Planaria Examples:

Latest Price via Chronos

Latest Ticker via Chronos

36 Hour Historical Data via NeonGenesis


Preev API

Pairs


https://api.preev.pro/v1/pairs

Returns a list of all available pairs.

{
  "BSV:USD": {
    "id": "12eLTxv1vyUeJtp5zqWbqpdWvfLdZ7dGf8",
    "name": "Bitcoin SV",
    "base": "BSV",
    "quote": "USD",
    "sources": {
      "Bitfinex": "bsvusd",
      "Bittrex": "USD-BSV",
      "OkCoin": "bsv_usd",
      "Poloniex": "USDC_BCHSV"
    },
    "status": {
      "active": true,
      "balance": 2.826241,
      "tx_size": 438,
      "total_broadcasts": 82931,
      "last_funded": 1575988381,
      "days_remaining": 448.1
    }
  },
  ...
}

https://api.preev.pro/v1/pairs/<pair id>

Returns the meta data of the specified pair.

{
    "id": "12eLTxv1vyUeJtp5zqWbqpdWvfLdZ7dGf8",
    "name": "Bitcoin SV",
    "base": "BSV",
    "quote": "USD",
    "sources": {
    "Bitfinex": "bsvusd",
    "Bittrex": "USD-BSV",
    "OkCoin": "bsv_usd",
    "Poloniex": "USDC_BCHSV"
  },
  "status": {
    "active": true,
    "balance": 2.826241,
    "tx_size": 438,
    "total_broadcasts": 82931,
    "last_funded": 1575988381,
    "days_remaining": 448.1
  }
}

Tickers


Ticker Object


{
  "id": "12eLTxv1vyUeJtp5zqWbqpdWvfLdZ7dGf8"   - the pair ID
  "t": 1575988620,                             - UNIX timestamp
  "p": {                                       - price
    "ppi": {                                   - ppi stands "Preev Price Index" and represents the pair's volume-weighted price and total volume.
      "l": 96.44,                              - last price
      "v": 520344                              - 24hr volume
    },
    "bitfinex": {                              - source
      "l": 96.46,
      "v": 437180
    },
    ...
  },
  "tx": {                                      - last broadcasted transaction
    "h": "25feae2776fc671e62028018bb0...",     - transaction hash
    "t": 1575988635                            - UNIX timestamp of transaction
  }
}

https://api.preev.pro/v1/tickers

Returns last broadcasted data for all available pairs.

{
  "BSV:USD": {
    "id": "12eLTxv1vyUeJtp5zqWbqpdWvfLdZ7dGf8",
    "t": 1575988620,
    "p": {
      "ppi": {
        "l": 96.44,
        "v": 520344
      },
      "bitfinex": {
        "l": 96.46,
        "v": 437180
      },
      "bittrex": {
        "l": 95.46,
        "v": 36662
      },
      "okcoin": {
        "l": 97.23,
        "v": 21000
      },
      "poloniex": {
        "l": 96.93,
        "v": 25502
      }
    },
    "tx": {
      "h": "25feae2776fc671e62028018bb030275ed8d360683eef9358ab952cc390182fc",
      "t": 1575988635
    }
  },
  ...
}

Optional query parameters:

KeyTypeDefaultDescription
sourceString---If provided, only data from the specified source will be returned.try
includeArray---If provided, only properties specified in the list will returned. Possible values: id, t, p, tx, p.l, p.v, tx.t, tx.htry
flatBooleanfalseIf provided, a "flat" response will be returned instead of a nested objects.try

https://api.preev.pro/v1/tickers/<pair id>

Returns last broadcasted data for the specified pair.

{
  "id": "12eLTxv1vyUeJtp5zqWbqpdWvfLdZ7dGf8",
  "t": 1575988620,
  "p": {
    "ppi": {
      "l": 96.44,
      "v": 520344
    },
    "bitfinex": {
      "l": 96.46,
      "v": 437180
    },
    "bittrex": {
      "l": 95.46,
      "v": 36662
    },
    "okcoin": {
      "l": 97.23,
      "v": 21000
    },
    "poloniex": {
      "l": 96.93,
      "v": 25502
    }
  },
  "tx": {
    "h": "25feae2776fc671e62028018bb030275ed8d360683eef9358ab952cc390182fc",
    "t": 1575988635
  }
}

Optional query parameters:

KeyTypeDefaultDescription
sourceString---If provided, only data from the specified source will be returned.try
includeArray---If provided, only properties specified in the list will returned. Possible values: id, t, p, tx, p.l, p.v, tx.t, tx.htry
flatBooleanfalseIf provided, a "flat" response will be returned instead of a nested objects.try

https://api.preev.pro/v1/tickers/<pair id>/historical

Returns the historical data of the specified pair. Default time period is last 24 hours if no start or end is specified.

[{
  "t": 1575988620,
  "p": {
    "ppi": {
      "l": 96.44,
      "v": 520344
    },
    "bitfinex": {
      "l": 96.46,
      "v": 437180
    },
    "bittrex": {
      "l": 95.46,
      "v": 36662
    },
    "okcoin": {
      "l": 97.23,
      "v": 21000
    },
    "poloniex": {
      "l": 96.93,
      "v": 25502
    }
  },
  "tx": {
    "h": "25feae2776fc671e62028018bb030275ed8d360683eef9358ab952cc390182fc",
    "t": 1575988635
  }
}, ... ]

Optional query parameters:

KeyTypeDefaultDescription
startUnix timestamp---Time of the first ticker to be returned.try
endUnix timestamp---Time of the last ticker to be returned.try
intervalInteger1Interval in minutes over which to aggregate the data.try
sourceString---If provided, only data from the specified source will be returned.try
includeArray---If provided, only properties specified in the list will returned. Possible values: t, p, tx, p.l, p.v, tx.t, tx.htry
flatBooleanfalseIf provided, a "flat" response will be returned instead of a nested objects.try

*Note: Currently only the last 24 hours of historical data is available through the API, older data may be retrieved from blockchain directly.

Top