- Top 10 Best Blockchain APIs: Coinbase, Bitcoin, and more
- 1. Coinbase API
- 2. Bitcoin API
- 3. Blockchain API
- 4. Cryptocurrency API
- 5. Ethereum API
- 6. Blockchain Info API
- 7. Dogecoin API
- 8. Daneel API
- 9. Chain API
- 10. Biteasy API
- Introduction
- To Get Started
- Websocket API
- Authentication
- Connection
- Requests
- Channel
- Action
- Response
- Sequence Numbers
- Event
- Data Types
- Fair usage and rate limits
- Response data throttling and delays
- Anonymous Channels
- Heartbeat
- L2 Order Book
- L3 Order Book
- Prices
- Symbols
- Field Description
- Trades
- Authenticated Channels
- Authenticated
- Trading
- state
- timeInForce
- Cancel on disconnect
- Create a new order (NewOrderSingle)
- Examples
- Cancel an order (CancelOrderRequest)
- Mass order cancel request (OrderMassCancelRequest)
- Mass order status request (OrderMassStatusRequest)
- Balances
- REST Endpoints
- Query single order status
- View whitelisted addresses
- Create A Withdrawal
Top 10 Best Blockchain APIs: Coinbase, Bitcoin, and more
The blockchain technology, which is the underlying technology that powers the rapid growth of cryptocurrencies like bitcoin and ethereum, has taken the world by storm. Apart from its traditional usage in underpinning digital currencies, the technology is increasingly being adopted in many fields, leading to its increased growth.
What’s more, some companies that provide the innovative blockchain technology have exposed their Application Programming Interfaces (APIs) to allow developers to access their features and integrate them into applications.
To help you in finding the best blockchain API you can use, we reviewed several of them based on the following four main criteria:
- API features: We assessed the special features of each of the blockchain APIs.
- Cryptocurrencies supported: We looked at the number of cryptocurrencies each of the APIs supports.
- Pricing: We examined the cost of integrating each of the APIs in projects.
- Ease of use: We scrutinized the ease of using each of the APIs in adding blockchain capabilities to applications.
Ultimately, we developed the following list of top 10 best blockchain APIs:
1. Coinbase API
Coinbase is a popular digital currency exchange platform that offers a simple and secure way for buying, managing, and selling a wide range of cryptocurrencies such as bitcoin, bitcoin cash, ethereum, and many others.
API features: The Coinbase API allows you to integrate blockchain capabilities into both existing and new applications. With the API, you can complete several tasks, including collecting read-only data, generating digital wallets and addresses, buying/selling and selling/receiving cryptocurrencies, storing cryptocurrencies securely, getting real-time or historical prices, and getting payment notifications.
Cryptocurrencies supported: The API supports bitcoin, bitcoin cash, litecoin, and ethereum.
Pricing: The API is provided for free.
Ease of use: Coinbase provides a wide range of client libraries and mobile SDKS in different programming languages that can help you in easily integrating the API.
2. Bitcoin API
The Bitcoin API by BitcoinAverage offers access to weighted average of the calculation of bitcoin prices. BitcoinAverage sources and aggregates real-time currency prices from several major exchanges around the world, letting you easily retrieve the data you need.
API features: The Bitcoin API allows you to access the world’s longest running cryptocurrency price data, since 2013. With the API, you can retrieve real-time prices, OHLC data, volume data, and historical prices for a wide range of cryptocurrencies.
Cryptocurrencies supported: The API supports several cryptocurrencies and more than 165 currencies.
Pricing: You can use the API for free, as long as you make less than 5,000 requests per month. To access higher limits and more features, you can go for any of its paid plans, which starts from $12 per month to $75 per month.
Ease of use: BitcoinAverage provides comprehensive documentation and code samples in various programming languages on how to get started using the API with ease.
3. Blockchain API
The Blockchain API provides you with excellent capabilities to integrate cryptocurrency payment functionality into your projects.
API features: The Blockchain API comes with powerful features to help you begin creating bitcoin applications. With the API, you can start receiving crypto payments, sending and receiving digital payments from blockchain wallets, retrieving live exchange rates from the major bitcoin exchanges, accessing bitcoin charts for historical data, searching for bitcoin transactions, and many more.
Cryptocurrencies supported: The API supports bitcoin, ethereum, and bitcoin cash.
Pricing: The API is offered for free.
Ease of use: There is detailed documentation, tutorials in different languages, and other helpful resources to assist you in integrating the API easily.
4. Cryptocurrency API
The cryptocurrency API by Zloadr enables you to create interesting applications that make use of the powerful blockchain technology.
API features: The cryptocurrency API comes with several endpoints that are built to meet the mission-critical demands of the crypto-enthusiastic developers. With the RESTful API, you can accomplish a wide range of tasks, including getting the latest market information, getting trading history, monitoring the cryptos traded on exchanges, getting exchange rates from fiat to cryptocurrencies and vice versa, creating visualization of cryptocurrency data sets, finding cryptocurrency regulatory information, and many more.
Cryptocurrencies supported: The API supports a wide range of cryptocurrencies.
Pricing: The cryptocurrency API is priced at $9.99 per month, but limited to 10,000 requests per month. You can go for other paid plans to access higher rates limits.
Ease of use: Zloadr offers extensive documentation and helper tutorials to assist you in getting up and running with the cryptocurrency API with ease.
5. Ethereum API
The Ethereum API, also called the Global Ethereum Price Index — GEX API, is a powerful API that is offered by BitcoinAverage.
API features: The API uses the GEX data accessed through the BitcoinAverage API capabilities. It returns up to one second refresh rates for a wide range of currencies at preferred lock in time or live rates. The API has endpoints for generating custom currency indexes, returning last and daily average price for currency symbols, getting ticker values and price changes for currencies, returning ticker data, and many more.
Cryptocurrencies supported: The API supports several cryptocurrencies and more than 165 currencies.
Pricing: You can use the Ethereum API for free, as long as you make less than 5,000 requests per month. To access higher limits, you can go for any of its paid plans, which starts from $12 per month to more than $75 per month.
Ease of use: There is simple documentation to assist you in integrating the API easily and without many programming hassles.
6. Blockchain Info API
The Blockchain Info API is a simple plaintext-based query API that allows you to fetch data from Blockchain.info, which is a website that provides a wide range of blockchain capabilities.
API features: With the Blockchain Info API, you can retrieve the total input value of a transaction, the total output value of a transaction, the transaction fee of a transaction, the balance of an address, and many other crypto details. The values are given in Satoshi; that is, dividing by 100000000 to obtain the quantity in BTC.
Cryptocurrencies supported: The API supports the bitcoin cryptocurrency.
Pricing: The API is offered for free.
Ease of use: You can get simple documentation to help you in starting integrating the API within minutes.
7. Dogecoin API
The Dogecoin API, also called the Dogechain API, lets you incorporate the blockchain features of the dogecoin digital currency into your application.
API features: The Dogecoin API allows you to accomplish several tasks, including retrieving information about an address such as the amount received and the amount sent, retrieving the current network statistics, retrieving the validity of an address, retrieving the difficulty of solving the last block, retrieving the amount of transactions of the last blocks, and many others.
Cryptocurrencies supported: The API supports the dogecoin cryptocurrency.
Pricing: The API is provided for free.
Ease of use: There is exhaustive documentation that is full of code samples on how to implement the API with ease.
8. Daneel API
Daneel is a comprehensive blockchain news platform that uses advanced machine learning models to collect and filter information from more than 500 authentic sources. Daneel’s algorithms can detect fake news, which minimizes the risks of getting unreliable information from the blockchain and cryptocurrency market.
API features: The Daneel API allows you to integrate the features of the Daneel platform into your application so that users can get relevant and accurate data about the happenings in the blockchain market. With the API, you can get the sentiment of a cryptocurrency, market news and information about a cryptocurrency, market gainers and losers, market score for a cryptocurrency, market trends, and other data.
Cryptocurrencies supported: The Daneel API supports an extensive number of cryptocurrencies.
Pricing: The API is priced at $199 per month, which provides you with the ability to make unlimited calls.
Ease of use: Daneel offers easy to follow documentation and helpful examples on how to make the most of the API.
9. Chain API
The Chain API provides you with state-of-the-art blockchain capabilities for creating fast and secure Bitcoin applications.
API features: You can use the Chain API to get wallet balances, send transactions, get address information such as the balance for an address and unspent outputs for an address, get block information such as block hash and latest block, list Webhook events, and many other tasks.
Cryptocurrencies supported: The API supports the bitcoin cryptocurrency.
Pricing: The API is provided for free.
Ease of use: There is simple documentation to ensure you integrate the API without many programming hassles.
10. Biteasy API
The Biteasy API blockchain RESTful API allows developers to simply and conveniently fetch data from the bitcoin network for integration into applications.
API features: With the Biteasy API, you can get the details of a particular bitcoin address, get blocks details, get transaction details, search for a particular blockchain data such as block information and address information, and get other data.
Cryptocurrencies supported: The API supports the bitcoin cryptocurrency.
Pricing: The API is offered for free.
Ease of use: There is easy to use documentation that enables you to get up and running with the API within a few minutes.
That’s Rakuten RapidAPI’s list of top 10 Best Blockchain APIs. You can click here to get other amazing APIs to embed into your application and experience the power of the innovative blockchain technology!
About Rakuten RapidAPI
Rakuten RapidAPI is the world’s largest API marketplace with 8,000+ third-party APIs and used by over 500,000 active developers. We enable developers to build transformative apps through the power of APIs. Find, test and connect to all the APIs you need in one place!
Check out some of the world’s best APIs including Microsoft, Sendgrid, Crunchbase, and Skyscanner.
Источник
Introduction
Welcome to Blockchain.com’s Exchange API and developer documentation. These documents detail and give examples of various functionality offered by the API such as receiving real time market data, requesting balance information and performing trades.
View the full REST API documentation here.
To Get Started
- Create or log into your existing Blockchain.com Exchange account
- Select API from the drop down menu
- Fill out form and click “Create New API Key Now”
- Once generated you can view your keys under API Settings
Websocket API
The Websocket API can be used to receive market data and to interact with the trading system in real time. Every message is in a JSON format and trading messages use the FIX standard for naming of fields, and message types.
Each type of data is provided over a dedicated channel. Clients need to subscribe to all relevant channels they wish to receive real time updates from.
Authentication
Interaction with the API will require an API key. To generate one, go to the API section of your Blockchain.com Exchange user settings. Each API key generated will be linked to your account. The only required information is a key name. Optionally you can set trading access, and IP address whitelisting.
Once your key is created you’ll be shown an API Key and API Secret. Store the secret in a safe place because it will only be shown once.
Connection
The websocket endpoint is,
Environment | URI |
---|---|
prod | wss://ws.prod.blockchain.info/mercury-gateway/v1/ws |
In order to connect you have to add the following headers to the connection request
Environment | Headers |
---|---|
prod | Origin: https://exchange.blockchain.com |
Requests
Each Message sent to the server will have at least 2 fields: action and channel.
Channel
A channel provides context about the type of data being communicated between the client and server. There are multiple channels available:
Channel | Visibility | Description |
---|---|---|
heartbeat | anonymous | Receive heartbeat messages |
l2 | anonymous | Receive level 2 order book data (aggregated) |
l3 | anonymous | Receive level 3 order book data (aggregated) |
prices | anonymous | Receive candlestick market data |
symbols | anonymous | Receive symbol messages |
ticker | anonymous | Receive ticker messages |
trades | anonymous | Receive trade execution messages |
auth | authenticated | To authenticate a web socket connection |
balances | authenticated | To receive balance updates |
trading | authenticated | Submit & cancel orders, receive order snapshots and updates |
Action
action describes what action to take for the provided channel. The following standard action’s are supported by all channels (with the exception of the auth channel):
Action | Description |
---|---|
subscribe | Subscribe to the provided channel and attributes |
unsubscribe | Unsubscribe from the provided channel and attributes |
A channel may expose other bespoke actions.
Response
Sequence Numbers
Each message sent from the server will contain a sequence number seqnum which will be incremented by 1 with each message. If the client receives a seqnum which has skipped one or more sequences, it indicates that a message was missed and the client is recommended to restart the websocket connection.
Event
In addition, each response field will contain an event field with the corresponding channel to indicate the purpose of the message. The following events are supported:
Event | Type | Description |
---|---|---|
subscribed | admin | The channel was successfully subscribed to |
unsubscribed | admin | The channel was successfully unsubscribed to |
rejected | admin | the last action for the channel was rejected. A text field will be provided about the reason for the reject |
snapshot | app | A channel snapshot has been provided |
updated | app | An update corresponding to the channel has occurred |
Each time an action is applied to a channel, an administrative event is sent from the server to notify whether the action was applied successfully.
Data Types
All Messages use the standard JSON format. The following data types are supported:
Type | Description | Example |
---|---|---|
number | Signed decimal number | 1234.45 |
string | UTF-8 encoded unicode string | «Authentication Failed» |
timestamp | UTC Timestamps following the convention YYYY-MM-DDTHH:MM:SS.ssssssZ or YYYY-MM-DDTHH:MM:SS.000ssssssZ or YYYY-MM-DDT00:00:00Z |
Fair usage and rate limits
Currently there is a limit of 1200 messages per minute. If the limit is exceeded, you will receive a rejected event. After waiting a minute, normal functionality will resume and you will be able to send messages again.
Response data throttling and delays
The response and update messages are never delayed, clients will get every update as soon as it happens.
Anonymous Channels
Heartbeat
A heartbeat can be sent by the server by subscribing to the heartbeat channel.
The server will send confirmation of the subscription.
Snapshot messages are sent every 5 seconds and have the following format:
L2 Order Book
Level 2 Order Book data is available through the l2 channel. This channel returns the volume available at each price. All the price levels are retrieved with this channel. Subscribing is done per symbol. Each entry in bids and asks arrays is a price level, along with its price ( px ), quantity ( qty ) and number of orders ( num ) attributes.
There is no ordering guarantee in bids and asks entries.
An update with qty equal to 0, means the price should be removed.
L3 Order Book
Level 3 Order Book data is available through the l3 channel. This channel returns all the order updates reaching the exchange; by applying the updates to the snapshot you can recreate the full state of the orderbook. Subscribing is done per symbol. Each entry in bids and asks arrays is an order, along with its id ( id ), price ( px ) and quantity ( qty ) attributes.
Updates will follow. An update with qty equal to 0, means the order should be removed.
Prices
To receive candlestick market data you can subscribe to the prices channel. Subscriptions are per symbol and granularity (in seconds) has to be specified. Supported granularity values are: 60, 300, 900, 3600, 21600, 86400
You can subscribe for multiple symbols but not for multiple granularities per symbol.
The server will send confirmation of the subscription.
Updated event on the prices channel:
The price data is an array consisting of [ timestamp , open , high , low , close , volume ]
Symbols
To receive symbol updates, subscribe to the symbols channel. The server will send confirmation of the subscription. The next message on this channel will be a snapshot of the current symbol status.
When the symbol is not halted the auction data in the message may be blank.
When a symbol is in a halt state the auction data will populate as the book builds. When an opening time has been chosen, the auction-time field will show the opening time. Subsequent updates will be sent only if the symbol status changes in any way.
Field Description
Field | Description |
---|---|
auction-price | If the symbol is halted and will open on an auction, this will be the opening price. |
auction-size | Opening size |
auction-time | Opening time in HHMM format. |
imbalance | Auction imbalance. If > 0 then there will be buy orders left over at the auction price. If ticker channel is available. Subscriptions are again per symbol. The server will send confirmation of the subscription. |
Trades
In order to receive trade updates on executions within each market across the Exchange, you can subscribe to the trades channel.
Subscriptions are again per symbol.
The server will send confirmation of the subscription.
Authenticated Channels
Authenticated
To authenticate a web socket connection, the client must subscribe to the auth channel passing a token field. Alternatively a client can provide the header cookie auth_token on a new connection and then authentication will take place immediately without the need to subscribing to auth channel.
If authentication is successful, the server will send an initial notification.
If authentication was unsuccessful, the server will send the following notification:
Trading
The client can submit and cancel orders, as well as receive order executions, through the trading channel. The messages are in JSON format and the attribute names are using standardised FIX 4.2 Field names.
Below is a table showing the permitted FIX fields used as a JSON key for cancelling / creating an order:
Tag | Field | Type | Mandatory | Description | Example |
---|---|---|---|---|---|
11 | clOrdID | string | YES | Reference field provided by client and cannot exceed 20 characters | «ABC» |
55 | symbol | string | YES | Blockchain symbol identifier | «BTC-USD» |
40 | ordType | string | YES | «market» for market «limit» for limit, «stop» for stop, «stopLimit» for stopLimit | «limit» |
59 | timeInForce | string | YES | «GTC» for Good Till Cancel, «IOC» for Immediate or Cancel, «FOK» for Fill or Kill, «GTD» Good Till Date | «GTC» |
54 | side | string | YES | «buy» for Buy, «sell» for Sell | «buy» |
38 | orderQty | number | YES | The order size in the terms of the base currency | 10.23 |
44 | price | number | required for limit and stopLimit order types | The limit price for the order | 0.12345 |
432 | expireDate | number | required for GTD orders | expiry date in the format YYYYMMDD | 20190318 |
99 | stopPx | number | required for limit and stopLimit order types | Price to trigger the stop order | 3500.12 |
110 | minQty | number | Optional for all market orders and for limit orders with IOC timeInForce | The minimum quantity required for an IOC fill | 10.0 |
18 | execInst | string | Optional for Limit Orders | The order is placed with Add Liquidity Only (aka Post Only): it will not match liquidity immediately. It will be rejected instead of matching liquidity in the market. | «ALO» |
Below is a table representing the different permutations permitted for the FIX fields, with X indicating what can be added and where O is not required:
Market | Limit | Stop | Stop Limit | |
---|---|---|---|---|
clOrdID | X | X | X | X |
symbol | X | X | X | X |
ordType | X | X | X | X |
timeInForce | O | X | X | X |
side | X | X | X | X |
orderQty | X | X | X | X |
price | X | X | ||
expireDate | O | |||
stopPx | X | X | ||
minQty | O | O |
The server can include the following additional FIX fields when notifying of an order update:
Tag | Field | Type | Description | Example |
---|---|---|---|---|
35 | msgType | string | «8» for ExecutionReport, «9» for OrderCancelRejected | «8» |
150 | execType | string | «0» for New, «4» for Canceled, «C» for Expired, «8» for Rejected, «F» for partial fill, «A» for Pending, «H» for Trade Break, «I» Order Status | «O» |
39 | ordStatus | string | ‘cancelled’, ‘expired’, . | |
37 | orderID | string | The unique order id assigned by the exchange | «11111111» |
37 | execID | string | Unique identifier for the execution | «123456» |
32 | lastShares | number | The executed quantity for the order’s last fill | 0.5678 |
31 | lastPx | number | The executed price for the last fill | 3500.12 |
151 | leavesQty | string | For Open and Partially Filled orders this is the remaining quantity open for execution. For Cancelled and Expired orders this is the quantity than was still open before cancellation/expiration. For Rejected order this is equal to orderQty. For other states this is always zero. | 10.0 |
14 | cumQty | number | The quantity of the order which has been filled | 0.123345 |
60 | transactTime | string | The time the transaction occurred | «2019-08-13T13:15:35.000955868Z» |
6 | avgPx | number | Calculated the Volume Weighted Average Price of all fills for this order | 345.33 |
1004 | tradeId | string | The unique ID assigned to the order fill, also known as trade | «77309432596» |
state
Enumerated fields are defined as follows:
Name | Description | Example |
---|---|---|
pending | Order is pending acceptance. Only applicable to stop and stop-limit orders | |
open | Order has been accepted | |
rejected | Order has been rejected | Limit and market orders can get rejected if you have no balance to fill the order even partially. |
cancelled | Order has been cancelled | A market order might get in state cancelled if you don’t have enough balance to fill it at market price. Both market orders and limit orders with IOC can have ordStatus ‘cancelled’ if there is no market for them, even without the user requesting the cancellation. |
filled | Order has been filled | A limit order get in state cancelled after the user requested a cancellation. |
partial | Order has been partially filled | |
expired | Order has been expired |
Name | Description |
---|---|
limit | order which has a price limit |
market | order that will match at any price available in the market, starting from the best prices and filling up to the available balance |
stop | order which has a stop/trigger price, and when that price is reached, it triggers a market order |
stopLimit | order which has a stop price and limit price, and when the stop price is reached, it triggers a limit order at the limit price |
timeInForce
To submit & cancel orders as well as receive live order updates, subscribe to the authenticated trading channel.
The next message will be a snapshot of live orders for the logged on user»
Name | Description |
---|---|
GTC | Good Till Cancel. The order will rest on the order book until it is cancelled or filled |
GTD | Good Till Date. The order will reset on the order book until it is cancelled, filled, or expired |
FOK | Fill or Kill. The order is either completely filled or cancelled. No Partial Fills are permitted. |
IOC | Immediate or Cancel. The order is either a) completely filled, b) partially filled and the remaining quantity canceled, or c) the order is canceled. |
Which TIF are supported. X for supported
Market | Limit | Stop | Stop Limit |
---|---|---|---|
GTC | X | X | X |
GTD | X | X | X |
IOC | X | ||
FOK | X |
The trading channel supports the following additional actions:
Action | Description |
---|---|
NewOrderSingle | Creates an order |
CancelOrderRequest | Cancels an order |
OrderMassCancelRequest | Cancel multiple orders |
OrderMassStatusRequest | Snapshot of live orders |
Cancel on disconnect
When subscribing to this channel, users can enable cancel on disconnect. This ensures that when the connection is disconnected, all live orders of the user will be cancelled.
Once enabled, cancel on disconnect cannot be turned off for this connection. Even unsubscribing from trading channel will trigger a cancellation of all live orders.
The next message will be a snapshot of live orders for the logged on user»
Create a new order (NewOrderSingle)
Example creating a GTC limit order:
This action creates an order using the provided fields as described above.
Each time an order changes state or has a match, an event will be sent from the server:
The next message will be a snapshot of live orders for the logged on user:
Examples
Example of a reply if your market order get filled:
Example of a response where your limit order is accepted and resting in the orderbook without fills:
If your limit order get rejected you will get:
If your market order get rejected you will get:
Cancel an order (CancelOrderRequest)
If the client gives an invalid orderId it will return a rejected cancellation:
Mass order cancel request (OrderMassCancelRequest)
Users have the ability to cancel all of their live orders at once by using this action. A symbol can be optionally specified to reduce the scope of this action. After requesting a mass cancel, execution reports for the affected orders will follow.
Mass order status request (OrderMassStatusRequest)
Live orders can be listed at any point in time with this request. The subsequent response will contain a snapshot similar to the one received when subscribing to this channel.
Balances
To receive balances for a user, subscribe to the authenticated balances channel:
Snapshot of user balances (Zero balances are not sent in the initial snapshot):
Each time the balance changes, a new snapshot event will be sent from the server; this channel has only ‘snapshot’ event, not ‘updates’
REST Endpoints
Query single order status
In order to look up the status of a single order, users can utilize the following endpoint.
Item | Description |
---|---|
URL | https://api.blockchain.com/exchange/order/ |
HTTP Method | GET |
Required headers | Cookie: auth_token= |
Users can authenticate using API keys, by providing a cookie named auth_token with the value set to their API key.
View whitelisted addresses
In order to see the list of whitelisted beneficiaries, users can utilize the following endpoint.
Item | Description |
---|---|
URL | https://api.blockchain.com/exchange/beneficiaries |
HTTP Method | GET |
Required headers | Cookie: auth_token= |
Users can authenticate using API keys, by providing a cookie named auth_token with the value set to their API key.
Create A Withdrawal
In order to create a withdrawal via api, users can utilize the following endpoint.
Item | Description |
---|---|
URL | https://api.blockchain.com/exchange/withdrawals |
HTTP Method | POST |
Required headers | Cookie: auth_token= |
Users can authenticate using API keys, by providing a cookie named auth_token with the value set to their API key.
Источник