Historical Crypto Data #

Trades #

The Trades API provides historcial trade data for a given crypto symbol on a specified date.

Returns trades for the queried crypto symbol

GET /v1beta1/crypto/{symbol}/trades
This endpoint returns trade historical data for the requested crypto symbol.

Parameters

Path Parameters

Attribute Type Requirement Description
symbol string
Required
The symbol to query for

Query Parameters

Attribute Type Requirement Description
exchanges string
Optional
The comma-separated exchanges which can be FTXU, ERSX or CBSE. Defaults to All.
start string
Optional
Filter data equal to or after this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to beginning of the current day in Central Time.
end string
Optional
Filter data equal to or before this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to the current time.
limit int
Optional
Number of data points to return. Must be in range 1-10000, defaults to 1000.
page_token string
Optional
Pagination token to continue from.

Response

A trades response object.

Errors

400 Bad request
Invalid query parameters
403 Forbidden
Unauthorized
429 Too many requests
Too many requests

Response #

{
  "trades": [
      {
          "t": "2021-04-01T00:00:00.348Z",
          "x": "CBSE",
          "p": 58800.01,
          "s": 8.473e-05,
          "tks": "B",
          "i": 151521553
      },
      ...
  ],
  "symbol": "BTCUSD",
  "next_page_token": "QlRDVVNEfDIwMjEtMDQtMDFUMDA6MDI6MTcuMDc0MDAwMDAwWnxDQlNFfDA5MjIzMzcyMDM3MDA2Mjk4MzYw"
}

Properties #

Attribute Type Description
t string Timestamp in RFC-3339 format with nanosecond precision.
x string Exchange where the trade happened.
p number Trade price.
s double Trade size.
tks string TakerSide of the trade (buy, sell, or unspecified)
i int Trade ID.

Latest Trade #

The Latest trade API provides the latest trade data for a given crypto symbol.

Returns latest trade for the queried crypto symbol

GET /v1beta1/crypto/{symbol}/trades/latest
This endpoint returns latest trade for the requested crypto symbol.

Parameters

Path Parameters

Attribute Type Requirement Description
symbol string
Required
The symbol to query for

Query Parameters

Attribute Type Requirement Description
exchange string
Required
The exchange from which you’d like to query your data from. For example, CBSE, FTXU or ERSX.

Response

A Trade response object.

Errors

400 Bad request
Invalid query parameters
403 Forbidden
Unauthorized
404 Not found
Not found
429 Too many requests
Too many requests

Response #

{
  "symbol": "BTCUSD",
  "trade": {
      "t": "2021-09-18T11:14:46.80939002Z",
      "x": "ERSX",
      "p": 48577.3,
      "s": 1.3003,
      "tks": "B",
      "i": 0
  }
}

Properties #

Attribute Type Description
t string Timestamp in RFC-3339 format with nanosecond precision.
x string Exchange where the trade happened.
p number Trade price.
s double Trade size.
tks string TakerSide of the trade (buy, sell, or unspecified)
i int Trade ID.

Multi Trades #

The Multi Trades API provides the latest trade data for a comma-separated list of crypto symbols.

Returns trades for the queried crypto symbols

GET /v1beta1/crypto/trades
This endpoint returns trade historical data for the requested crypto symbols.

Parameters

Query Parameters

Attribute Type Requirement Description
symbols string
Required
The comma-separated symbols to query for.
exchanges string
Optional
The comma-separated exchanges which can be ERSX, FTXU, or CBSE. Defaults to All.
start string
Optional
Filter data equal to or after this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to beginning of the current day in Central Time.
end string
Optional
Filter data equal to or before this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to the current time.
limit int
Optional
Number of data points to return. Must be in range 1-10000, defaults to 1000.
page_token string
Optional
Pagination token to continue from.

Response

A trades response object.

Errors

400 Bad request
Invalid query parameters
403 Forbidden
Unauthorized
429 Too many requests
Too many requests

Response #

{
  "trades": {
      "BTCUSD": [
          {
              "t": "2022-02-25T06:00:00.019563Z",
              "x": "CBSE",
              "p": 38466.68,
              "s": 0.001,
              "tks": "S",
              "i": 286927433
          },
          {
              "t": "2022-02-25T06:00:00.019563Z",
              "x": "CBSE",
              "p": 38466.68,
              "s": 0.00058865,
              "tks": "S",
              "i": 286927434
          }
      ]
  },
  "next_page_token": "QlRDVVNEfDIwMjItMDItMjVUMDY6MDA6MDAuMDE5NTYzMDAwWnxDQlNFfDA5MjIzMzcyMDM3MTQxNzAzMjQy"
}

Properties #

Attribute Type Description
trades object Trades object.
next_page_token string (nullable) Token that can be used to query the next page.
t string Timestamp in RFC-3339 format with nanosecond precision.
x string Exchange where the trade happened.
p number Trade price.
s double Trade size.
tks string TakerSide of the trade (buy, sell, or unspecified).
i int Trade ID.

Quotes #

The Quotes API provides quotes for a given crypto symbol at a specified date.

Returns quotes for the queried crypto symbol

GET /v1beta1/crypto/{symbol}/quotes
This endpoint returns quote historical data for the requested crypto.

Parameters

Path Parameters

Attribute Type Requirement Description
symbol string
Required
The symbol to query for

Query Parameters

Attribute Type Requirement Description
start string
Required
Filter data equal to or after this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to beginning of the current day in Central Time.
end string
Optional
Filter data equal to or before this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to the current time.
exchanges string
Optional
The comma-separated exchanges which can be ERSX, FTXU, or CBSE. Defaults to All.
limit int
Optional
Number of data points to return. Must be in range 1-10000, defaults to 1000.
page_token string
Optional
Pagination token to continue from.

Response

A quotes response object.

Errors

400 Bad request
Invalid query parameters
403 Forbidden
Unauthorized
429 Too many requests
Too many requests

Response #

{
  "quotes": [
      {
          "t": "2021-04-01T00:00:10.495Z",
          "x": "CBSE",
          "bp": 58798.69,
          "bs": 0.12,
          "ap": 58805.39,
          "as": 0.0131436
      },
      ...
  ],
  "symbol": "BTCUSD",
  "next_page_token": "QlRDVVNEfDIwMjEtMDQtMDFUMDg6NDg6NTYuODUyMDAwMDAwWnxDQlNFfDY2OTBCRkQ1"
}

Properties #

Attribute Type Description
t string Timestamp in RFC-3339 format with nanosecond precision.
x string Exchange.
ap number Ask price.
as int Ask size.
bp number Bid price.
bs int Bid size.

Latest Quote #

The Latest Quote API provides the latest quote data for a given ticker symbol.

Returns latest quote for the queried crypto symbol

GET /v1beta1/crypto/{symbol}/quotes/latest
This endpoint returns latest quote for the requested crypto symbol.

Parameters

Path Parameters

Attribute Type Requirement Description
symbol string
Required
The symbol to query for

Query Parameters

Attribute Type Requirement Description
exchange string
Required
The exchange from which you’d like to query your data from. For example, CBSE, FTXU or ERSX.

Response

A quotes response object.

Errors

400 Bad request
Invalid query parameters
403 Forbidden
Unauthorized
404 Not found
Not found
429 Too many requests
Too many requests

Response #

{
  "symbol": "BTCUSD",
  "quote": {
      "t": "2021-09-18T11:32:24.108Z",
      "x": "ERSX",
      "bp": 48132.12,
      "bs": 0.5456,
      "ap": 49126.6,
      "as": 0.7596
  }
}

Properties #

Attribute Type Description
t string Timestamp in RFC-3339 format with nanosecond precision.
x string Exchange.
ap number Ask price.
as int Ask size.
bp number Bid price.
bs int Bid size.

Multi Quotes #

The Multi Quotes API provides the latest quote data for each of the queried crypto symbols.

Returns the latest quotes for each of the queried crypto symbols.

GET /v1beta1/crypto/quotes
This endpoint returns latest quote data for each of the requested crypto symbols.

Parameters

Query Parameters

Attribute Type Requirement Description
symbols string
Required
The comma-separated symbols to query for.
exchanges string
Optional
The comma-separated exchanges which can be ERSX, FTXU, or CBSE. Defaults to All.
start string
Optional
Filter data equal to or after this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to beginning of the current day in Central Time.
end string
Optional
Filter data equal to or before this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to the current time.
limit int
Optional
Number of data points to return. Must be in range 1-10000, defaults to 1000.
page_token string
Optional
Pagination token to continue from.

Response

A quotes response object.

Errors

400 Bad request
Invalid query parameters
403 Forbidden
Unauthorized
404 Not found
Not found
429 Too many requests
Too many requests

Response #

{
  "quotes": {
      "BTCUSD": [
          {
              "t": "2022-02-25T06:00:00.011898368Z",
              "x": "FTXU",
              "bp": 38400.56,
              "bs": 0.405,
              "ap": 38487.45,
              "as": 0.405
          },
          {
              "t": "2022-02-25T06:00:00.10911744Z",
              "x": "FTXU",
              "bp": 38400.56,
              "bs": 0.405,
              "ap": 38491.45,
              "as": 0.1512
          }
      ]
  },
  "next_page_token": "QlRDVVNEfDIwMjItMDItMjVUMDY6MDA6MDAuMTA5MTE3NDQwWnxGVFhVfEMwMkVEQjZD"
}

Properties #

Attribute Type Description
quotes object Quotes object.
next_page_token string (nullable) Token that can be used to query the next page.
t string Timestamp in RFC-3339 format with nanosecond precision.
x string Exchange.
ap number Ask price.
as int Ask size.
bp number Bid price.
bs int Bid size.

Bars #

The Bars API returns aggregate historical data for the requested crypto symbol.

Returns bars for the queried crypto symbol

GET /v1beta1/crypto/{symbol}/bars
This endpoint returns aggregate historical data for the requested crypto.

Parameters

Path Parameters

Attribute Type Requirement Description
symbol string
Required
The symbol to query for

Query Parameters

Attribute Type Requirement Description
timeframe string
Required
Timeframe for the aggregation. Values are customizeable, frequently used examples: 1Min, 15Min, 1Hour, 1Day, 1Week, and 1Month. Limits: 1Min-59Min, 1Hour-23Hour.
start string
Required
Filter data equal to or after this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to beginning of the current day in Central Time.
end string
Optional
Filter data equal to or before this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to the current time.
exchanges string
Optional
The comma-separated exchanges which can be ERSX, FTXU, or CBSE. Defaults to All.
limit int
Optional
Number of data points to return. Must be in range 1-10000, defaults to 1000.
page_token string
Optional
Pagination token to continue from.

Response

A bars response object.

Errors

400 Bad request
Invalid value for query parameter
403 Forbidden
Unauthorized
429 Too many requests
Rate limit exceeded

Response #

{
  "bars": [
      {
          "t": "2021-04-01T00:00:00Z",
          "x": "CBSE",
          "o": 58800.01,
          "h": 58838,
          "l": 58756.07,
          "c": 58837.71,
          "v": 9.43435863,
          "n": 375,
          "vw": 58792.3224699778
      },
      ...
  ],
  "symbol": "BTCUSD",
  "next_page_token": "QlRDVVNEfE18MjAyMS0wNC0wMVQxNjozOTowMC4wMDAwMDAwMDBafENCU0U="
}

Properties #

Attribute Type Description
bars object Bars object.
t string Timestamp in RFC-3339 format with nanosecond precision.
x number Exchnage code for the bar.
o number Open price.
h number High price.
l number Low price.
c number Close price.
v int Volume.
false int Number of trades.
vw number Volume weighted average price.

Multi Bars #

The Multi Bars API returns aggregate historical data for each of the requested crypto symbols.

Returns bars for each of the queried crypto symbols.

GET /v1beta1/crypto/bars
This endpoint returns aggregate historical data for each of the requested crypto symbols.

Parameters

Query Parameters

Attribute Type Requirement Description
symbols string
Required
The comma-separated symbols to query for.
timeframe string
Required
Timeframe for the aggregation. Values are customizeable, frequently used examples: 1Min, 15Min, 1Hour, 1Day, 1Week, and 1Month. Limits: 1Min-59Min, 1Hour-23Hour.
exchanges string
Optional
The comma-separated exchanges which can be ERSX, FTXU, or CBSE. Defaults to All.
start string
Optional
Filter data equal to or after this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to beginning of current day in Central Time.
end string
Optional
Filter data equal to or before this time in RFC-3339 format. Fractions of a second are not accepted. Defaults to current time.
limit int
Optional
Number of data points to return. Must be in range 1-10000, defaults to 1000.
page_token string
Optional
Pagination token to continue from.

Response

A bars response object.

Errors

400 Bad request
Invalid value for query parameter
403 Forbidden
Unauthorized
429 Too many requests
Rate limit exceeded

Response #

{
  "bars": {
      "BTCUSD": [
          {
              "t": "2022-02-25T06:00:00Z",
              "x": "CBSE",
              "o": 38466.68,
              "h": 38499.62,
              "l": 38460.53,
              "c": 38474.33,
              "v": 12.36582291,
              "n": 255,
              "vw": 38477.0372796401
          },
          {
              "t": "2022-02-25T06:00:00Z",
              "x": "FTXU",
              "o": 38453,
              "h": 38466,
              "l": 38451,
              "c": 38451,
              "v": 0.872,
              "n": 8,
              "vw": 38456.4123853211
          }
      ]
  },
  "next_page_token": "QlRDVVNEfE18MjAyMi0wMi0yNVQwNjowMDowMC4wMDAwMDAwMDBafEZUWFU="
}

Properties #

Attribute Type Description
bars object Bars object.
next_page_token string (nullable) Token that can be used to query the next page.
t string Timestamp in RFC-3339 format with nanosecond precision.
x number Exchnage code for the bar.
o number Open price.
h number High price.
l number Low price.
c number Close price.
v int Volume.
n int Number of trades.
vw number Volume weighted average price.

Snapshot #

The Snapshot API returns the latest trade, latest quote, latest minute bar, latest daily bar, and previous daily bar data for a given crypto symbol.

Returns the snapshot for the queried crypto symbol.

GET /v1beta1/crypto/{symbol}/snapshot
This endpoint returns the snapshot for the requested crypto symbol.

Parameters

Path Parameters

Attribute Type Requirement Description
symbol string
Required
The symbol to query for

Query Parameters

Attribute Type Requirement Description
exchange string
Required
The comma-separated exchange which can be ERSX, FTXU, or CBSE.

Response

A snapshot response object.

Errors

400 Bad request
Invalid value for query parameter
403 Forbidden
Unauthorized
429 Too many requests
Rate limit exceeded

Response #

{
  "symbol": "BTCUSD",
  "latestTrade": {
      "t": "2022-02-25T23:01:16.25512Z",
      "x": "CBSE",
      "p": 39382.33,
      "s": 0.001,
      "tks": "S",
      "i": 287389201
  },
  "latestQuote": {
      "t": "2022-02-25T23:00:49.34Z",
      "x": "CBSE",
      "bp": 39393.04,
      "bs": 0.01207643,
      "ap": 39393.05,
      "as": 0.00314348
  },
  "minuteBar": {
      "t": "2022-02-25T23:00:00Z",
      "x": "CBSE",
      "o": 39450.22,
      "h": 39453.93,
      "l": 39385.75,
      "c": 39399.25,
      "v": 14.67421563,
      "n": 692,
      "vw": 39422.2579229322
  },
  "dailyBar": {
      "t": "2022-02-25T06:00:00Z",
      "x": "CBSE",
      "o": 38466.68,
      "h": 39716,
      "l": 38016.44,
      "c": 39399.25,
      "v": 15758.68182757,
      "n": 461304,
      "vw": 39006.4210401328
  },
  "prevDailyBar": {
      "t": "2022-02-24T06:00:00Z",
      "x": "CBSE",
      "o": 34662.32,
      "h": 39720,
      "l": 34357.1,
      "c": 38467.77,
      "v": 31567.22025039,
      "n": 869316,
      "vw": 36626.0837898575
  }
}

Properties #

Attribute Type Description
symbol string Symbol that was queried for.
latestTrade object Latest trade object.
latestQuote object Latest quote object.
minuteBar object Minute bar object.
dailyBar object Daily bar object.
prevDailyBar object Previous daily close bar object.

Multi Snapshots #

The Multi Snapshots API returns the latest trade, latest quote, minute bar daily bar, and previous daily bar data for each of the given crypto symbols.

Returns snapshot objects for each of the queried crypto symbols.

GET /v1beta1/crypto/snapshots
This endpoint returns snapshot objects for each of the requested crypto symbols.

Parameters

Query Parameters

Attribute Type Requirement Description
symbols string
Required
The comma-separated symbols to query for.
exchange string
Required
The exchange from which you’d like to query your data from. For example, CBSE, FTXU or ERSX.

Response

A snapshots response object.

Errors

400 Bad request
Invalid value for query parameter
403 Forbidden
Unauthorized
429 Too many requests
Rate limit exceeded

Response #

{
  "snapshots": {
      "ETHUSD": {
          "latestTrade": {
              "t": "2022-02-25T23:21:43.517445Z",
              "x": "CBSE",
              "p": 2807.42,
              "s": 0.001,
              "tks": "S",
              "i": 229937443
          },
          "latestQuote": {
              "t": "2022-02-25T23:20:40.645Z",
              "x": "CBSE",
              "bp": 2796.7,
              "bs": 0.02695063,
              "ap": 2796.71,
              "as": 0.74494687
          },
          "minuteBar": {
              "t": "2022-02-25T23:20:00Z",
              "x": "CBSE",
              "o": 2785.04,
              "h": 2800,
              "l": 2782.46,
              "c": 2794.99,
              "v": 607.64082888,
              "n": 943,
              "vw": 2794.6234562907
          },
          "dailyBar": {
              "t": "2022-02-25T06:00:00Z",
              "x": "CBSE",
              "o": 2607.67,
              "h": 2808,
              "l": 2572.23,
              "c": 2794.51,
              "v": 176321.35545216,
              "n": 527790,
              "vw": 2690.1384376614
          },
          "prevDailyBar": {
              "t": "2022-02-24T06:00:00Z",
              "x": "CBSE",
              "o": 2334.59,
              "h": 2750,
              "l": 2301,
              "c": 2607.58,
              "v": 360016.93549312,
              "n": 926521,
              "vw": 2478.6412575492
          }
      },
      "BTCUSD": {
          "latestTrade": {
              "t": "2022-02-25T23:21:43.437021Z",
              "x": "CBSE",
              "p": 39483.42,
              "s": 0.00728294,
              "tks": "B",
              "i": 287399843
          },
          "latestQuote": {
              "t": "2022-02-25T23:20:49.38Z",
              "x": "CBSE",
              "bp": 39445.84,
              "bs": 0.001,
              "ap": 39445.85,
              "as": 0.05
          },
          "minuteBar": {
              "t": "2022-02-25T23:20:00Z",
              "x": "CBSE",
              "o": 39378.3,
              "h": 39454.27,
              "l": 39367.83,
              "c": 39426.12,
              "v": 9.32708981,
              "n": 479,
              "vw": 39421.9808168412
          },
          "dailyBar": {
              "t": "2022-02-25T06:00:00Z",
              "x": "CBSE",
              "o": 38466.68,
              "h": 39716,
              "l": 38016.44,
              "c": 39426.12,
              "v": 15991.42722223,
              "n": 471631,
              "vw": 39011.5486203465
          },
          "prevDailyBar": {
              "t": "2022-02-24T06:00:00Z",
              "x": "CBSE",
              "o": 34662.32,
              "h": 39720,
              "l": 34357.1,
              "c": 38467.77,
              "v": 31567.22025039,
              "n": 869316,
              "vw": 36626.0837898575
          }
      }
  }
}

Properties #

Attribute Type Description
snapshots object Snapshots object.
latestTrade object Latest trade object.
latestQuote object Latest quote object.
minuteBar object Minute bar object.
dailyBar object Daily bar object.
prevDailyBar object Previous daily close bar object.

Latest XBBO #

The Latest XBBO API returns the latest cross best bid and offer across exchanges.

Returns latest Cross Best Bid and Offer for the queried crypto symbol.

GET /v1beta1/crypto/{symbol}/xbbo/latest
Returns the XBBO for a crypto symbol that calculates the Best Bid and Offer across multiple exchanges. If exchanges is not specified then only the exchanges that can be traded on Alpaca are included in the calculation.

Parameters

Path Parameters

Attribute Type Requirement Description
symbol string
Required
The symbol to query for

Query Parameters

Attribute Type Requirement Description
exchanges string
Optional
The comma-separated exchanges which can be ERSX, FTXU or CBSE. Defaults to ERSX,FTXU.

Response

An XBBO response object.

Errors

400 Bad request
Invalid query parameters
403 Forbidden
Unauthorized
404 Not found
Not found
429 Too many requests
Too many requests

Response #

{
  "symbol": "BTCUSD",
  "xbbo": {
      "t": "2022-02-25T23:46:08.274331591Z",
      "ax": "ERSX",
      "ap": 39236.2,
      "as": 1.529203,
      "bx": "FTXU",
      "bp": 39221,
      "bs": 0.156
  }
}

Properties #

Attribute Type Description
symbol string The symbol queried for.
t string Timestamp in RFC-3339 format with nanosecond precision.
ax string Ask exchange.
ap number Ask price.
as int Ask size.
bx string Bid exchange.
bp number Bid price.
bs int Bid size.