Order Books - Level 2 Market Data
Learn how to fetch order books (level 2 market data) on CoinAPI.
What are order books?
To understand what order books are, we need to know the definition of market data, which is that market data is essentially the data that is provided by a cryptocurrency exchange to inform the stakeholders of the latest prices and other financial information for a particular cryptocurrency.
We can refer to order books are an advanced level of market data about cryptocurrencies that offer detailed information on ask and bid orders for a particular cryptocurrency. We can define order books into two levels—level 2 market data and level 3 market data. We’re going to focus on level 2 market data in this lesson.
The orderbooks endpoint
We can fetch level 2 market data using the orderbooks endpoint. As of this writing, CoinAPI provides current, latest, and historical data for level 2 order books.
Response JSON structures
The output JSON response for the orderbooks endpoint consists of the following variables:
Output Variables
Variable | Description |
| This variable represents the unique symbol identifier. |
| This variable represents the time of the trade transaction recorded by the exchange. |
| This variable represents the time when CoinAPI first received the trade transaction from the exchange. |
| This variable represents the 20 lowest levels which are ranked in ascending order. |
| This variable represents the 20 highest levels which are ranked in descending order. |
| This variable represents the current price of the trade transaction. This variable will be nested inside the |
| This variable represents the amount of the base asset involved in the transaction trade. This variable will be nested inside the |
Current order book data
We can get a complete list of all current level 2 order book data on CoinAPI. To fetch the ...