Market Data API

Market Data - Starter Guide

Welcome to the CoinAPI developer documentation. This document should contain all the information required to properly implement applications using our API.

There are 3 main interfaces that can be used to access CoinAPI:

APICommunicationDescription
RESTfulRequest-responseStateless API providing the widest range of data, not capable of streaming, only pooling.
WebSocketPublish-subscribeStateful API providing streaming of realtime market data.
FIXPublish-subscribeStateful API providing streaming of realtime market data, widely adopted by the finance industry.

SDK

Our Software Development Kit (SDK) is available on GitHub at https://github.com/coinapi/coinapi-sdk (opens in a new tab). If possible then we are strongly recommending using our tested libraries available on GitHub, rather than creating new ones. However, if you decide to create your own implementation or to change existing one, then we encourage you to create Pull Request to our main repository with proposed changes, then we will able to include your code in our official repository for use by other users, effectively creating collaboration.

In repository you can find libraries or examples for languages or enviroments like:

  • Python
  • R
  • Matlab
  • C#
  • C++
  • .NET
  • Java
  • Ruby
  • Go
  • JavaScript
  • TypeScript
  • Node.js
  • PHP
  • Haskell
  • Objective-C
  • Swift

Security

The use of the encryption is optional, and the decision to use it is on you. On the encrypted endpoints, we are using protocols that are considered the best security practices.

Standards and conventions

This section represents used standards and conventions across all documents and API's.

Variables naming

All variables are named using the Snake case (or snake_case) naming convention. This means that words are separated by a single underscore _ character, no spaces are used, and letters are lowercase.

Asset codes

ISO 4217 currency code standard is used for fiat money identifications. Cryptocurrency assets are identified using codes used by the general public or adopted by the majority of exchanges.

Exchange codes

Exchange on our platform is identified by the specific exchange API and the matching engine behind it. When the example exchange has multiple separate APIs, e.g., for different products SPOT, OPTIONS, or to cover other regions, we will expose these symbols from these respective APIs on different exchange identifiers. Below are examples of BINANCE (multiple APIs, multiple regions) and DERIBIT (single API, single region). Full listing of exchanges can be queried using the Market Data REST API.

BINANCE Exchange IdsWebsiteDescription
BINANCEhttps://www.binance.com/ (opens in a new tab)Binance
BINANCEDEXhttps://www.binance.org/ (opens in a new tab)Binance DEX
BINANCEFTShttps://www.binance.com/ (opens in a new tab)Binance Futures (USDT/dapi)
BINANCEFTSChttps://www.binance.com/ (opens in a new tab)Binance Futures (Coin/fapi)
BINANCEFTSCUAThttps://www.binance.com/ (opens in a new tab)Binance Futures Testnet (Coin/fapi)
BINANCEFTSUAThttps://www.binance.com/ (opens in a new tab)Binance Futures Testnet (USDT/dapi)
BINANCEJEhttps://www.binance.je/ (opens in a new tab)Binance Jersey
BINANCEJEXhttps://www.jex.com/en (opens in a new tab)Binance JEX
BINANCEKRhttps://www.binance.kr/ (opens in a new tab)Binance Korea
BINANCEOPTVhttps://www.binance.com/ (opens in a new tab)Binance Options Vanilla (vapi)
BINANCEOPTVUAThttps://www.binance.com/ (opens in a new tab)Binance Options Vanilla Testnet (vapi)
BINANCEUAThttps://www.binance.com/ (opens in a new tab)Binance Testnet
BINANCEUGhttps://www.binance.co.ug/ (opens in a new tab)Binance Uganda
BINANCEUShttps://www.binance.us/ (opens in a new tab)Binance US
DERIBIT Exchange IdsWebsiteDescription
DERIBIThttps://www.deribit.com/ (opens in a new tab)Deribit

Numbers precision

Numbers in our platform can have maximum 19 digits overall, but no more than 9 decimal places. In cases when number representing aggregate value then we allowing 38 digits overall, but still no more than 9 decimal places.

Time

For all input and output time values ISO 8601 standard is used.

Format specifierDescription
yyyyThe year as a four-digit number.
MMThe month, from 01 through 12.
ddThe day of the month, from 01 through 31.
HHThe hour, using a 24-hour clock from 00 to 23.
mmThe minute, from 00 through 59.
ssThe second, from 00 through 59.
fffThe milliseconds in a date and time value.
fffffffThe ten millionths of a second in a date and time value.

Input time values are parsed using the following formats as far as possible:

  • yyyy-MM-ddTHH:mm:ss.fffffff
  • yyyy-MM-ddTHH:mm:ss.fff
  • yyyy-MM-ddTHH:mm:ss
  • yyyy-MM-ddTHH:mm
  • yyyy-MM-ddTHH
  • yyyy-MM-dd
  • yyyyMMddTHHmmssfffffff
  • yyyyMMddTHHmmssfff
  • yyyyMMddTHHmmss
  • yyyyMMddTHHmm
  • yyyyMMddTHH
  • yyyyMMdd

Output time values are formatted using the following patterns:

  1. yyyy-MM-ddTHH:mm:ss.fffffffZ
  2. yyyy-MM-dd

Copyright 2022 COINAPI LTD or its affiliates. All rights reserved.
StatusPage: