Specify Symbols
Supported API Endpoints: Live, Historical, Time-Frame, Change.
The API's symbols parameter can be used in conjunction with most API endpoints to limit the number of output cryptocurrencies. This parameter can take either one single cryptocurrency value or multiple, comma-separated values.
https://api.apilayer.net/coinlayer/live?access_key=YOUR_ACCESS_KEY&symbols=BTC,ETH,XRPThe use of this parameter is especially useful to reduce bandwidth and increase the Coinlayer API's response time.
Specify Target Currency
Supported API Endpoints: Live, Historical, Time-Frame.
By default, cryptocurrency rates returned by the Coinlayer API always translate to US Dollars. Customers subscribed to the Basic Plan or higher can use the API's target parameter to change the Target Currency to any other supported fiat currency code.
https://api.apilayer.net/coinlayer/live?access_key=YOUR_ACCESS_KEY&target=EURThe API supports 166 world currencies as target currencies. You can find a list of all supported target currency codes here.
Extended Results
Supported API Endpoints: Live, Historical, Time-Frame.
Basic Plan customers may also append the expand and set it to 1 in order to cause the Coinlayer API to return a number of additional fields with an API response.
Example API Request: In this example the Live Rates Endpoint is used.
https://api.apilayer.net/coinlayer/live?access_key=YOUR_ACCESS_KEY&expand=1Example API Response:
{
"success": true,
"terms": "https://coinlayer.com/terms",
"privacy": "https://coinlayer.com/privacy",
"timestamp": 1529836865,
"target": "USD",
"rates": {
"BTC": {
"rate": 5948.023376,
"high": 6499.89998,
"low": 5657,
"vol": 3665680000,
"cap": 101785026595.74292,
"sup": 17112412
},
"ETH": {
"rate": 449.864211,
"high": 500,
"low": 432.547195,
"vol": 1918470000,
"cap": 45109034289.89332,
"sup": 100272556
},
[...]
}
}Response Objects:
| Object | Description |
|---|---|
| success | Returns true or false depending on whether or not the given API request was successful. |
terms | Returns a URL leading to the Coinlayer Terms of Service. |
privacy | Returns a URL leading to the Coinlayer Privacy Policy. |
timestamp | Returns the exact time (UTC timestamp) the given crypto data was collected. |
target | Returns the default or specified target currency. |
rates > rate | Returns the exchange rate for the requested cryptocurrency. |
rates > high | Returns the highest midpoint exchange rate recorded on the requested date. |
rates > low | Returns the lowest midpoint exchange rate recorded on the requested date. |
rates > vol | Returns the volume of cryptocurrency exchanged on the requested date. |
rates > cap | Returns the current market cap of the given cryptocurrency. |
rates > sup | Returns the current supply amount of the given cryptocurrency. |
rates > change | Returns the change in rate compared with the previous day, or with the compare date when it is given. |
rates > change_pct | Returns the same change as a percentage (for example 2.5 means +2.5 %). |
Pretty-Printed JSON
Supported API Endpoints: all.
Append format and set it to 1 to get indented, easy-to-read JSON. Without it, the response is returned on one line.
Example API Request:
https://api.apilayer.net/coinlayer/live?access_key=YOUR_ACCESS_KEY&symbols=BTC,ETH&format=1