Details about Public API

Last updated last month

On this page you will find a comprehensive guide to start working with our public API

Quick start

We have 3 major open entry points that you can use in your work

Get and search information about certain coins
Get and search information on fields in our dataset

Every request has default values you can see in JSON’s response

You can change every default value in your request’s GET parameters the way you consider necessary

Request

As we’ve mentioned before, every request has default parameters and you can just call entry point for getting imagine about our datasets

Requests use GET method for building queries, it's simple.

Additionally some request can required authentication keys in HTTP header

You can get more information about special requests on designated requests’ pages

Example of a request

https://api.datalight.me/v1/request/?coin=eth,btc,eos&fields=coinmarketcap.coin.price_btc,twitter.hype.twitter_hype&limit=1000&offset=0&order=date&time_interval=5m&to_date=2015-10-20

Response

Every response object has Content-Type:application/json in header

Response example:

{
fields: [
"coinmarketcap.coin.price_btc",
"twitter.hype.twitter_hype",
"Coin",
"Date"
],
limit: 1000,
offset: 0,
time_interval: "5m",
coin: [
"ETH",
"BTC",
"EOS"
],
from_date: "2015-10-19T00:00:00",
to_date: "2015-10-20T00:00:00",
order: "date",
response_time: "3.415063 seconds",
result: [
{
Coin: "ETH",
coinmarketcap.coin.price_btc: null,
processed_date: 1445212800,
twitter.hype.twitter_hype: null
},
{
Coin: "BTC",
coinmarketcap.coin.price_btc: 1,
processed_date: 1445212800,
twitter.hype.twitter_hype: null
},
{
Coin: "ETH",
coinmarketcap.coin.price_btc: null,
processed_date: 1445299200,
twitter.hype.twitter_hype: null
},
{
Coin: "BTC",
coinmarketcap.coin.price_btc: 1,
processed_date: 1445299200,
twitter.hype.twitter_hype: null
}
]
}

Successful response consists of 3 parts Successful response consists of 3 parts

request parameters

This section shows used query parameters

fields: [
"coinmarketcap.coin.price_btc",
"twitter.hype.twitter_hype",
"Coin",
"Date"
],
limit: 1000,
offset: 0,
time_interval: "5m",
coin: [
"ETH",
"BTC",
"EOS"
],
from_date: "2015-10-19T00:00:00",
to_date: "2015-10-20T00:00:00",
order: "date"

In each entry point there can be different acceptable and default query parameters

response details

response_time: "3.415063 seconds"

Additionally count can exists in response

result

result: [
{
Coin: "ETH",
coinmarketcap.coin.price_btc: null,
processed_date: 1445212800,
twitter.hype.twitter_hype: null
},
{
Coin: "BTC",
coinmarketcap.coin.price_btc: 1,
processed_date: 1445212800,
twitter.hype.twitter_hype: null
},
{
Coin: "ETH",
coinmarketcap.coin.price_btc: null,
processed_date: 1445299200,
twitter.hype.twitter_hype: null
},
{
Coin: "BTC",
coinmarketcap.coin.price_btc: 1,
processed_date: 1445299200,
twitter.hype.twitter_hype: null
}
]

In exception response you will see a message with error description. Bellow you can see typical answer for errors

What you should know about response

count - It's a count of all elements that you can get, but limit and offset can crop a part of data

order - Accepts with integer and string data; minus character will revers order like -date in request

Error messages

Something wrong with you request. Please check request parameters or try later

Frequently this message will be shown if you have typos in field_id or coin symbol. First of all, make sure there are no typos

You should get app keys prior to using this method

Some fields need authentication before they can be used. If you see this message it means that you don't have app-keys in the request header or they are wrong

Somethins is wrong. Please try letter
This page was not found

Check server

curl https://api.datalight.me/ping

If everything okay, server will respond with its current unix time

1547653702.4515002

Authentication

Links

Examples

Search coins which have "btc" in content
Search fields which have "hype" in content