Introduction
Welcome to the TokenDatabase API documentation.
Authentication
TokenDatabase uses API keys to allow access to the API. You can view your API key under your account page
All requests require the API key to be included as a parameter 'key'. As with all parameters on the TokenDatabase API, this may be included as a header, path, query string or request body parameter. Your API key is a secret! Any requests made against the API with your unique key will be charged against your total request limit.
Example of a key parameter:
key=my-api-key
Result Object
An example of the result object
{
"hits": 1,
"num_objects": 2,
"hits_remaining": 50123,
"results": [
{
"id": "poloniex_spot_btc_usdt",
"exchange": "poloniex",
"base": "btc",
"quote": "usdt",
"type": "spot",
"trades": [
{
"id": 9798053351,
"id_on_exchange": "29692207",
"time": "2020-01-08T19:36:15",
"price": 8023.27,
"quantity": 0.0296245,
"side": "buy"
},
{
"id": 9798051953,
"id_on_exchange": "29692206",
"time": "2020-01-08T19:36:13",
"price": 8026.31578947,
"quantity": 0.045995,
"side": "sell"
}
]
}
],
"errors": []
}
Each HTTP request to the API will return a JSON object. This object will include the following sections:
hits/num_objects/hits_remaining
The number reported under the hits key represents the cost against your API plan for this request. For example, if a result returns "hits": 10, then 10 of your daily limit's worth of hits have been consumed by this request.
This number of hits relates to the num_objects key, as the number of hits depends on the number of objects returned, scaled by the cost of the particular endpoint that your are querying. For example, the /markets/trades endpoint charges 1 hit per 100 trades returned, while the /markets/orderbook endpoint charges 1 hit per 50 levels returned. The exact meaning of the num_object value depends on the endpoint, however, it can be generally stated that it represents the number of data points returned.
The hits_remaining key represents the number of hits you have remaining on the current day.
Results
The results key contains a list of results. This is the location of the actual data points requested.
Error list
Each result object will have an errors key, containing a list of any errors encountered while processing your request. Some errors will prevent any results from being returned. The error list should be verified empty before attempting to process results.
For more details on error codes, see the Errors section.
Data Types
Time Value
Responses
Example JSON response with two time values
{
"time" : "2018-11-15T19:41:46",
"last_updated" : "2018-11-15T18:32:25.1253"
}
All Time values returned in API responses are represented as ISO 8601 strings. Each SDK will provide language appropriate types for time values returned from requests.
Input Parameters
Example request with time values
curl -X GET -G 'https://api.tokendatabase.com/v1/markets/trades' \
-d ids="poloniex_spot_btc_usdt" \
-d before="2018-11-15T18:32:25" \
-d after="2018-11-15T18:11:32.1253" \
-d key="my-api-key"
For the direct HTTP requests to the API, all Time values required as input parameters may be specified as either an unquoted ISO 8601 string eg. 2018-11-15T18:32:25.124 or as Unix time value eg. 1574557216 with optional sub-second precision specified as the floating part of the value. Each SDK will take language appropriate types for arguments involving time values.
ID List
An ID List is a comma separated list of IDs of a given type (ie. asset, exchange, market, etc.)
Examples
An Asset ID List: btc,eth,ltc,xrp
A Market ID List: kraken_spot_btc_cad,poloniex_spot_btc_usdt,poloniex_spot_eth_btc
An Auction ID List: 2451,2455,2470,2471,2472
Example requests using an id list:
https://api.tokendatabase.com/v1/assets?ids=btc,eth,usdt&key=my-api-key
https://api.tokendatabase.com/v1/markets/trades?ids=poloniex_spot_eth_btc,bittrex_spot_eth_btc&key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/markets/trades' \
-d limit=1 \
-d ids="poloniex_spot_eth_btc,bittrex_spot_eth_btc" \
-d key="my-api-key"
Array
Lists of data are returned from the direct HTTP requests as JSON arrays. Each SDK will encapsulate these lists in a language appropriate type.
Object
Key-Value pairs of data are returned from the direct HTTP requests as JSON objects. Each SDK will encapsulate these objects in a language appropriate type.
Period
Certain requests require a period of time as a parameter. These periods may be one of the following values:
| Value | Meaning |
|---|---|
| 1min | 1 minute on the minute boundaries |
| 3min | 3 minutes on the 3 minute boundaries, beginning at 00:00 of each day. Examples [00:00-00:03), [10:09-10:12) |
| 5min | 5 minutes on the 5 minute boundaries, beginning at 00:00 of each day. Examples [00:00-00:05), [10:05-10:10) |
| 30min | 30 minutes on the 30 minute boundaries, beginning at 00:00 of each day. Examples [00:00-00:30), [10:30-11:00) |
| 1hour | 1 hour on the hour boundaries |
| 12hour | 12 hours beginning from 00:00 of each day |
| 1day | 1 day on the day boundaries |
| 1week | 1 week from the beginning of each Monday until the end of each Sunday |
| 1month | 1 month on the calendar month boundaries. The amount of time represented by each of these periods is variable based on the length of the month. |
| 1year | 1 year on the calendar year boundaries. The amount of time represented by each of these periods is variable based on the inclusion of leap years/leap seconds. |
Regular Expression
Description of regular expression syntax coming soon
Examples:
"canada" --> matches the "canada" anywhere in the searched text
"canad%" --> matches "canada", "canadian", or any other text beginning with "canad" and followed by zero or more characters
"_ana%" -> matches "canada", "canadian", "bananna", or any other text beginning with any character followed by "ana" followed by zero or more characters
Errors
Example response when an error has been encountered:
{
"hits": 0,
"num_objects": 0,
"results": [],
"errors": [
{
"id": "invalid_api_key",
"message": "The provided api key was invalid"
}
]
}
Each response will contain an "errors" key, with a JSON array as a value. This array will contain any error objects that have been encountered.
The structure of each error object is a json dictionary with the following keys:
- id : The unique id of this error message
- message : a description of the error encountered
The possible error codes are listed below, with each error's associated HTTP status code indicated.
| id | Error Code | Meaning |
|---|---|---|
| invalid_api_key | 401 | The provided API key was invalid |
| insufficient_api_key | 401 | The provided API key does not have permission to access this resource |
| api_limit_exceeded | 429 | The provided API key has exceeded its maximum request |
| unknown_asset | 400 | The asset requested is not a known id |
| unknown_exchange | 400 | The exchange requested is not a known id |
| unknown_market | 400 | The market requested is not a known id |
| missing_parameter | 400 | Missing parameters |
| no_data | 400 | There is no data to return for the requested combination of endpoint and parameters |
| unknown_index | 400 | The index requested is not a known id |
| service_unavailable | 503 | Service is temporarily unavailable. Please try again later |
| internal_error | 503 | Internal server error |
Assets
Get Assets
Example 1: Get all assets
GET https://api.tokendatabase.com/v1/assets?key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/assets' \
-d key="my-api-key"
Response JSON
{
"hits": 17,
"num_objects": 1700,
"results": [
{
"id": "btc",
"name": "Bitcoin",
"type": "coin",
"icon_url": "/img/tokens/svg/icon/btc.svg",
"id_conversion": [
{
"exchange": "binance",
"id": "BTC"
},
{
"exchange": "bitfinex",
"id": "btc"
},
{
"exchange": "luno",
"id": "XBT"
},
{
"...": "..."
}
]
},
{
"...": "..."
}
],
"errors": []
}
Example 2: Lookup btc and usd
GET https://api.tokendatabase.com/v1/assets?ids=btc,usd&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/assets' \
-d ids=btc,usd \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"num_objects": 2,
"results": [
{
"id": "btc",
"name": "Bitcoin",
"type": "coin",
"icon_url": "/img/tokens/svg/icon/btc.svg",
"id_conversion": [
{
"exchange": "binance",
"id": "BTC"
},
{
"...": "..."
}
]
},
{
"id": "usd",
"name": "US Dollar",
"type": "fiat",
"icon_url": "/img/tokens/svg/icon/usd.svg",
"id_conversion": [
{
"exchange": "kraken",
"id": "USD"
},
{
"...": "..."
}
]
}
],
"errors": []
}
Endpoint Description
Return a list of all available assets and asset information.
https://api.tokendatabase.com/v1/assets
Method: GET
Objects per hit: 100
Query Parameters
-
ids Optional
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
An Asset IDThe unique id used to reference the asset on the TokenDatabase API -
name
stringThe asset name -
is_fiat
booleanTrue if the asset is a fiat currency (e.g. USD) -
icon_url
stringThe url for the asset's icon.
This url is relative to https://tokendatabase.com. As an example, if icon_url=/img/tokens/svg/icon/btc.svg, then the full path to the icon will be https://tokendatabase.com/img/tokens/svg/icon/btc.svg -
id_conversion
arrayList of conversions from asset id to asset id on a given exchange- Child attributes
-
The exchange id
-
id_conversion.id
stringThe string id used by this exchange to reference this asset
Auctions
Get Auction Markets
Example 1: Get a listing of all markets with auctions
GET https://api.tokendatabase.com/v1/auctions?key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/auctions' \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 5,
"results": [
{
"id": "gemini_spot_btc_usd",
"exchange": "gemini",
"base": "btc",
"quote": "usd",
"type": "spot",
"active": true
},
{
"id": "gemini_spot_eth_usd",
"exchange": "gemini",
"base": "eth",
"quote": "usd",
"type": "spot",
"active": true
},
{
"id": "gemini_spot_ltc_usd",
"exchange": "gemini",
"base": "ltc",
"quote": "usd",
"type": "spot",
"active": true
},
{
"id": "gemini_spot_zec_usd",
"exchange": "gemini",
"base": "zec",
"quote": "usd",
"type": "spot",
"active": true
},
{
"id": "gemini_spot_bch_usd",
"exchange": "gemini",
"base": "bch",
"quote": "usd",
"type": "spot",
"active": true
}
],
"errors": []
}
Endpoint Description
Get a list of all available markets that provide auctions.
https://api.tokendatabase.com/v1/auctions
Method: GET
Objects per hit: 100
Restrictions: This endpoint is restricted to users with a Developer Tier or higher subscription
Query Parameters
-
exchange Optional
Results will be limited to markets on the specified exchange
Valid Values: An Exchange ID
Default Value:All exchanges -
base Optional
Results will be limited to markets with the specified base currency
Valid Values: An Asset ID
Default Value:All assets -
quote Optional
Results will be limited to markets with the specified quote currency
Valid Values: An Asset ID
Default Value:All assets -
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market of this auction on the TokenDatabase API -
exchange
An Exchange IDThe exchange containing the market -
base
An Asset IDThe base currency of the market -
quote
An Asset IDThe quote currency of the market -
type
stringThe market type -
active
booleanTrue if the market is currently active
Get Indications
Example 1: Get all indications for auction the auction with id 265463
GET https://api.tokendatabase.com/v1/auctions/indications?ids=265463&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/auctions/indications' \
-d ids=265463 \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 13,
"results": [
{
"id": 265463,
"indications": [
{
"event_id_on_exchange": 8314574357,
"time": "2019-10-03T19:59:45",
"best_bid": 172.47,
"best_ask": 172.48,
"collar_price": 172.43,
"success": true,
"price": 172.48,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314569009,
"time": "2019-10-03T19:59:30",
"best_bid": 172.47,
"best_ask": 172.48,
"collar_price": 172.43,
"success": true,
"price": 172.48,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314568221,
"time": "2019-10-03T19:59:15",
"best_bid": 172.47,
"best_ask": 172.48,
"collar_price": 172.43,
"success": true,
"price": 172.48,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314567556,
"time": "2019-10-03T19:59:00",
"best_bid": 172.48,
"best_ask": 172.54,
"collar_price": 172.43,
"success": true,
"price": 172.54,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314565332,
"time": "2019-10-03T19:58:00",
"best_bid": 172.47,
"best_ask": 172.56,
"collar_price": 172.44,
"success": true,
"price": 172.56,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314563009,
"time": "2019-10-03T19:57:00",
"best_bid": 172.43,
"best_ask": 172.57,
"collar_price": 172.51,
"success": true,
"price": 172.57,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314557714,
"time": "2019-10-03T19:56:00",
"best_bid": 172.59,
"best_ask": 172.6,
"collar_price": 172.51,
"success": true,
"price": 172.6,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314553972,
"time": "2019-10-03T19:55:00",
"best_bid": 172.21,
"best_ask": 172.24,
"collar_price": 172.47,
"success": true,
"price": 172.24,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314550066,
"time": "2019-10-03T19:54:00",
"best_bid": 172.51,
"best_ask": 172.52,
"collar_price": 172.46,
"success": true,
"price": 172.53,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314546827,
"time": "2019-10-03T19:53:00",
"best_bid": 172.49,
"best_ask": 172.63,
"collar_price": 172.46,
"success": true,
"price": 172.63,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314544143,
"time": "2019-10-03T19:52:00",
"best_bid": 172.48,
"best_ask": 172.66,
"collar_price": 172.45,
"success": true,
"price": 172.66,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314541676,
"time": "2019-10-03T19:51:00",
"best_bid": 172.38,
"best_ask": 172.56,
"collar_price": 172.39,
"success": true,
"price": 172.56,
"volume": 0.57477
},
{
"event_id_on_exchange": 8314538847,
"time": "2019-10-03T19:50:00",
"best_bid": 172.26,
"best_ask": 172.49,
"collar_price": 172.39,
"success": true,
"price": 172.49,
"volume": 0.57477
}
]
}
],
"errors": []
}
Endpoint Description
Use this endpoint to retrieve inidcations from the specified auctions.
https://api.tokendatabase.com/v1/auctions/indications
Method: GET
Objects per hit: 100
Restrictions: This endpoint is restricted to users with a Developer Tier or higher subscription
Query Parameters
-
ids Required
Specifies a list of auction ids from which to retrieve auction data. These ids are found from the /auction/actual endpoint (ex. ids=142,143,155)
Valid Values: An ID List composed of Auction IDs
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
stringThe unique id used to reference the auction on the TokenDatabase API -
indications
arrayA list of auction indications- Child attributes
-
indications.event_id_on_exchange
stringThe event id of the indication on its source exchange -
The time of the indication
-
indications.best_bid
floatbest_bid represents the best bid on the continuous order book of the market at the time of the indication -
indications.best_ask
floatbest_ask represents the best ask on the continuous order book of the market at the time of the indication -
indications.collar_price
floatThe collar price of the indication. This is the price at which any price movement guarantees are based. Depending on the exchange, this may be the price of the last trade before the auction completion, or may be based on some other method. See the specific exchange of this auction for more details} -
indications.success
booleanTrue if this indication shows that the auction would have been able to complete successfully, resulting in trades being assigned -
indications.price
floatOnly present if the indication was successful. This is the executional price at which the auction trades would have completed -
indications.volume
floatOnly present if the indication was successful. This is the total volume of the base asset that would have been traded in this auction
Get Auctions
Example 1: Get the 3 most recent auctions from the gemini_spot_eth_usd market
GET https://api.tokendatabase.com/v1/auctions/actuals?ids=gemini_spot_eth_usd&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/auctions/actuals' \
-d ids=gemini_spot_eth_usd \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 3,
"results": [
{
"id": "gemini_spot_eth_usd",
"exchange": "gemini",
"base": "eth",
"quote": "usd",
"type": "spot",
"auctions": [
{
"id": 265463,
"id_on_exchange": 4028,
"event_id_on_exchange": 8314586037,
"time": "2019-10-03T20:00:00",
"complete": true,
"best_bid": 172.47,
"best_ask": 172.48,
"collar_price": 172.43,
"success": true,
"price": 172.59,
"volume": 0.57477
},
{
"id": 264466,
"id_on_exchange": 4023,
"event_id_on_exchange": 8304918836,
"time": "2019-10-02T20:00:00",
"complete": true,
"best_bid": 177.94,
"best_ask": 177.96,
"collar_price": 177.99,
"success": false
},
{
"id": 263466,
"id_on_exchange": 4016,
"event_id_on_exchange": 8294254744,
"time": "2019-10-01T20:00:00",
"complete": true,
"best_bid": 176.48,
"best_ask": 176.66,
"collar_price": 176.1,
"success": true,
"price": 176.66,
"volume": 49.792994
}
]
}
],
"errors": []
}
Endpoint Description
Use this endpoint to retrieve both current and historical auction information from the specified market(s)
https://api.tokendatabase.com/v1/auctions/actuals
Method: GET
Objects per hit: 100
Restrictions: This endpoint is restricted to users with a Developer Tier or higher subscription.
This endpoint will return a maximum of 1000 data points in a single call.
Query Parameters
-
ids Required
Specifies a list of market ids from which to retrieve auction data
Valid Values: An ID List composed of Market IDs
-
end Optional
If provided, limits returned auction data to data from before the specified time (UTC)
Valid Values: Time Value
Default Value:The current time -
start Optional
If provided, limits returned auction data to data after the specified time (UTC)
Valid Values: Time Value
-
since Optional
If provided, limits auction data to auctions with an id greater than (>) the given 'since' id
Valid Values: An Auction ID
-
limit Optional
Specifies the maximum number of auctions for which to return data
Valid Values: integer (<=10000)
Default Value:100 -
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market on the TokenDatabase API -
exchange
An Exchange IDThe exchange containing the market -
base
An Asset IDThe base currency of the market -
quote
An Asset IDThe quote currency of the market -
type
stringThe market type -
auctions
arrayA list of auctions- Child attributes
-
The unique id used to reference the auction
-
auctions.id_on_exchange
stringThe auction id of the auction on its source exchange -
auctions.event_id_on_exchange
stringThe event id of the auction on its source exchange -
The time of the auction
-
auctions.complete
booleanTrue if the auction has completed - this is true if the time of the auction's close has passed regardless of whether or not the auction was able to complete successfully, or resulted in any trades -
auctions.best_bid
floatIf the auction has completed, best_bid represents the best bid on the continuous order book of the market at the time of the auction completion. If the auction is incomplete, this field will be omitted -
auctions.best_ask
floatIf the auction has completed, best_ask represents the best ask on the continuous order book of the market at the time of the auction completion. If the auction is incomplete, this field will be omitted -
auctions.collar_price
floatThe collar price of the auction. Only present if this auction has completed. This is the price at which any price movement guarantees are based. Depending on the exchange, this may be the price of the last trade before the auction completion, or may be based on some other method. See the specific exchange of this auction for more details} -
auctions.success
booleanIf the auction has completed, this indicates whether the auction was able to complete successfully, resulting in trades being assigned -
auctions.price
floatOnly present if the auction has completed successfully. This is the executional price at which the auction trades have completed -
auctions.volume
floatOnly present if the auction has completed successfully. This is the total volume of the base asset that has been traded in this auction
Brokerages
Get Brokerages
Example 1: Get a listing of all brokerages and the markets for each
GET https://api.tokendatabase.com/v1/brokerages?key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/brokerages' \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"num_objects": 2,
"results": [
{
"id": "bitbuy",
"name": "",
"markets": []
},
{
"id": "coinberry",
"name": "",
"markets": [
{
"id": "coinberry_xrp_cad",
"base": "xrp",
"quote": "cad"
},
{
"id": "coinberry_bch_cad",
"base": "bch",
"quote": "cad"
},
{
"id": "coinberry_btc_cad",
"base": "btc",
"quote": "cad"
},
{
"id": "coinberry_eth_cad",
"base": "eth",
"quote": "cad"
},
{
"id": "coinberry_ltc_cad",
"base": "ltc",
"quote": "cad"
}
]
},
],
"errors": []
}
Endpoint Description
Return a list of all available brokerages and their current rate offerings.
https://api.tokendatabase.com/v1/brokerages
Method: GET
Objects per hit: 100
Query Parameters
-
ids Optional
If specified, return information only for the listed brokerages.
Valid Values: An ID List composed of Brokerage IDs
Default Value:All brokerages -
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Brokerage IDThe unique id used to reference the brokerage on the TokenDatabase API -
name
stringThe brokerage name -
markets
arrayA list of all markets on the brokerage- Child attributes
-
The unique id of this brokerage market on the TokenDatabase API
-
The base currency of the market
-
The quote currency of the market
Get Brokerage Rates
Example 1: Get all Canadian based brokerage rates from coinberry and shakepay
GET https://api.tokendatabase.com/v1/brokerages/rates?ids=coinberry,shakepay"es=cad&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/brokerages/rates' \
-d ids=coinberry,shakepay \
-d quotes=cad \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"num_objects": 4,
"results": [
{
"id": "coinberry",
"rates": [
{
"id": "coinberry_btc_cad",
"base": "btc",
"quote": "cad",
"bid": 14010.27,
"ask": 14110.37
},
{
"id": "coinberry_eth_cad",
"base": "eth",
"quote": "cad",
"bid": 280.77,
"ask": 292.13
}
]
},
{
"id": "shakepay",
"rates": [
{
"id": "shakepay_btc_cad",
"base": "btc",
"quote": "cad",
"bid": 14010.27,
"ask": 14110.37
},
{
"id": "shakepay_bch_cad",
"base": "bch",
"quote": "cad",
"bid": 430.48,
"ask": 450.84
}
]
}
],
"errors": []
}
Endpoint Description
Return the latest rate information from all requested brokerage markets
https://api.tokendatabase.com/v1/brokerages/rates
Method: GET
Objects per hit: 100
Query Parameters
-
ids Optional
If provided, returned markets will be limited to those on the specified brokerages
Valid Values: An ID List composed of Brokerage IDs
Default Value:All brokerages -
bases Optional
-
quotes Optional
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Brokerage IDThe unique id used to reference the brokerage on the TokenDatabase API -
rates
arrayAn array of rate objects- Child attributes
-
The id of this brokerage market
-
The base currency of the rate information
-
The quote currency of the rate information
-
rates.bid
floatThe current price offered by the brokerage when selling -
rates.ask
floatThe current price offered by the brokerage when buying
Exchanges
Get Exchanges
Example 1: Get all exchanges
GET https://api.tokendatabase.com/v1/exchanges?key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/exchanges' \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"num_objects": 31,
"results": [
{
"id": "bitfinex",
"name": "Bitfinex",
"website": "https://www.bitfinex.com/",
"active": true,
"known_assets": [
"agi",
"bbn",
"rrt",
"dai",
"..."
]
},
{
"id": "bitflyer",
"name": "bitFlyer",
"website": "https://bitflyer.com/",
"active": true,
"known_assets": [
"usd",
"btc",
"eth",
"dash",
"..."
]
},
{
"...": "..."
}
],
"errors": []
}
Endpoint Description
Return a list of all available exchanges.
https://api.tokendatabase.com/v1/exchanges
Method: GET
Objects per hit: 100
Query Parameters
-
ids Optional
If specified, return information only for the listed asset ids.
Valid Values: An ID List composed of Exchange IDs
Default Value:All exchanges -
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
An Exchange IDThe unique id used to reference the exchange on the TokenDatabase API -
name
stringThe full name of this exchange -
website
stringThe url of the exchange's website -
active
booleanThis field will be true when the exchange is still in operation. If an exchange is no longer operating, or monitoring of that exchange has ceased, active will be set to false. -
known_assets
arrayA list all known assets on the exchange.
Indices
Get Indices Prices
Example 1: Get the most recent vwap5 index prices of a number of assets.
GET https://api.tokendatabase.com/v1/indices/vwap5/prices?ids=btc,eth,ltc,bch,xrp&key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/indices/vwap5/prices' \
-d ids=btc,eth,ltc,bch,xrp \
-d key="my-api-key"
Response
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 5,
"results": [
{
"time": "2020-01-15T21:41:44.606432",
"prices": [
{
"id": "btc",
"price": 8758.58497721268,
"since": "2020-01-15T16:35:00"
},
{
"id": "eth",
"price": 163.774232710794,
"since": "2020-01-15T16:35:00"
},
{
"id": "ltc",
"price": 57.6524732366105,
"since": "2020-01-15T16:35:00"
},
{
"id": "xrp",
"price": 0.234944261038472,
"since": "2020-01-15T16:35:00"
},
{
"id": "bch",
"price": 333.823423292221,
"since": "2020-01-15T16:35:00"
}
]
}
],
"errors": []
}
Endpoint Description
Returns the index price for the specified asset(s) at a particular time.
https://api.tokendatabase.com/v1/indices/<index-id>/prices
Method: GET
Objects per hit: 100
Query Parameters
-
key Required
Your API key.
Valid Values: my-api-key
-
index-id Required
The id of the index for which summary information is being requested. This parameter is included as part of the url path. See the provided examples for more details about passing this parameter
Valid Values: An Index ID
-
ids Required
-
time Optional
If specified, the index price for the asset(s) at this specified time will be returned
Valid Values: Time Value
Default Value:The current time
Results Object Attributes
-
time
Time ValueThe requested target time at which price data was evaluated.- Child attributes
-
The unique id used to reference the base asset on the TokenDatabase API
-
time.price
floatThe index price of the asset -
The returned price is the valid index price of this asset as of the 'since' timestamp until at least the 'time' parameter.
Get Indices Ticks
Example 1: Get the most recent vwap5 index tick data for a number of assets.
GET https://api.tokendatabase.com/v1/indices/vwap5/ticks?ids=btc,eth,ltc,bch,xrp&key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/indices/vwap5/ticks' \
-d ids=btc,eth,ltc,bch,xrp \
-d key="my-api-key"
Response
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 5,
"results": [
{
"id": "btc",
"last_price": 8738.82040977128,
"pct_change_24h": 1.07213596243175
},
{
"id": "eth",
"last_price": 163.217572708813,
"pct_change_24h": 2.90806514690743
},
{
"id": "ltc",
"last_price": 57.2301775186642,
"pct_change_24h": 0.793682465829207
},
{
"id": "xrp",
"last_price": 0.233622671853283,
"pct_change_24h": -0.237670557928592
},
{
"id": "bch",
"last_price": 330.844217846007,
"pct_change_24h": 0.0180951662259738
}
],
"errors": []
}
Endpoint Description
Returns current tick data for the specified asset(s).
https://api.tokendatabase.com/v1/indices/<index-id>/ticks
Method: GET
Objects per hit: 100
Query Parameters
-
key Required
Your API key.
Valid Values: my-api-key
-
index-id Required
The id of the index for which summary information is being requested. This parameter is included as part of the url path. See the provided examples for more details about passing this parameter
Valid Values: An Index ID
-
ids Required
Results Object Attributes
-
id
An Asset IDThe unique id used to reference the base asset on the TokenDatabase API -
last_price
floatThe index price of the asset -
pct_change_24h
floatThe percentage change in this asset's index price over the last 24 hours.
Get Indices
Example 1: Get all indices
GET https://api.tokendatabase.com/v1/indices?key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/indices' -d key="my-api-key"
Response
{
"hits": 1,
"num_objects": 1,
"results": [
{
"id": "vwap5",
"name": "VWAP-5",
"description" : "This index represents the 5-minute, volume weighted price in USD for all assets across all trades observed over all exchanges.",
"methodology" : "https://docs.tokendatabase.com/indices/methodology/vwap5"
}
],
"errors": []
}
Endpoint Description
Get all available indices provided by TokenDatabase.
https://api.tokendatabase.com/v1/indices
Method: GET
Objects per hit: 100
Query Parameters
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
An Index IDThe unique id used to reference the index on the TokenDatabase API -
name
stringThe full name of the index -
description
stringA short description of the index -
methodology
stringA URL for the index methodology
Get Indices Details
Example 1: Get details for the vwap5 index.
GET https://api.tokendatabase.com/v1/indices/vwap5?key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/indices/vwap5' \
-d key="my-api-key"
Response JSON
{
"hits": 12,
"hits_remaining": 988,
"num_objects": 1192,
"results": [
{
"id": "btc",
"first_day": "2011-08-14 00:00:00",
"last_day": "2019-08-08 00:00:00",
"active": false
},
{
"id": "bfx",
"first_day": "2017-02-15 00:00:00",
"last_day": "2017-04-03 00:00:00",
"active": false
},
{
"id": "bts",
"first_day": "2017-02-15 00:00:00",
"last_day": "2019-08-08 00:00:00",
"active": false
},
{
"id": "cad",
"first_day": "2015-08-31 00:00:00",
"last_day": "2019-08-08 00:00:00",
"active": false
},
{
"id": "cny",
"first_day": "2011-08-14 00:00:00",
"last_day": "2018-09-07 00:00:00",
"active": false
},
{
"id": "dash",
"first_day": "2017-02-16 00:00:00",
"last_day": "2019-08-08 00:00:00",
"active": false
},
{
"...": "..."
}
]
}
Endpoint Description
For an index id returned from the /indices endpoint, get the details of the date range on which the index has data for each asset calculated by the index.
https://api.tokendatabase.com/v1/indices/<index-id>
Method: GET
Objects per hit: 100
Query Parameters
-
key Required
Your API key.
Valid Values: my-api-key
-
index-id Required
The id of the index for which details are being requested. This parameter is included as part of the url path. See the provided examples for more details about passing this parameter
Valid Values: An Index ID
Results Object Attributes
-
id
An Index IDThe unique id used to reference the index on the TokenDatabase API -
first_day
Time ValueThe earliest date on which there is data in this index -
last_day
Time ValueThe most recent date on which there is data in this index -
active
booleanTrue if this index is still actively generated
Get Indices Summaries
Example 1: Get 24 hour, vwap5 index summaries for btc and eth.
GET https://api.tokendatabase.com/v1/indices/vwap5/summaries?ids=btc,eth&end=2020-01-15T16:04:10.9040&start=2020-01-14T16:04:10.9040&key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/indices/vwap5/summaries' \
-d ids=btc,eth \
-d end=2020-01-15T16:04:10.9040 \
-d start=2020-01-14T16:04:10.9040 \
-d key="my-api-key"
Response
{
"hits": 1,
"num_objects": 2,
"results": [
{
"id": "btc",
"last_price": 8793.67576598414,
"pct_change": 2.24539514227814,
"volume": 629483.095749142,
"volume_quote": 5475208705.47776,
"market_cap": 155432835843.547,
"circulating": 17675525.0
},
{
"id": "eth",
"last_price": 163.059776636649,
"pct_change": 5.9185258785428,
"volume": 9671711.64461452,
"volume_quote": 1579475522.84523,
"market_cap": 17265238925.5049,
"circulating": 105882881.0
}
],
"errors": []
}
Endpoint Description
Returns the latest summary for a specified assets. This summary data contains the closing price during the requested period, percentage change over the period, total volumes, etc.
https://api.tokendatabase.com/v1/indices/<index-id>/summaries
Method: GET
Objects per hit: 1
Query Parameters
-
index-id Required
The id of the index for which summary information is being requested. This parameter is included as part of the url path. See the provided examples for more details about passing this parameter
Valid Values: An Index ID
-
ids Required
Specifies a list of assets from which to retrieve summary information
Valid Values: An ID List composed of Market IDs
-
start Optional
This timestamp represents the beginning of the requested summary period
Valid Values: Time Value
-
after Required
This timestamp represents the end of the requested summary period
Valid Values: Time Value
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
An Asset IDThe unique id used to reference the base asset on the TokenDatabase API -
last_price
floatThe index price at the close of the requested period. -
pct_changeh
floatThe change in price over the requested period. -
volume
floatThe total, observed volume of the asset traded over the requested period. -
volume_quote
floatThe value of all trades involving the requested base asset over the requested period, expressed in the index's quote currency. This value is calculated on a per-trade basis. -
market_cap
floatThe market cap of the base asset at the close of the requested period. This market cap value is calculated using this index's price, and expressed in units of the index's quote currency. -
circulating
floatThe circulating supply of the base asset at the close of the requested period.
Get Indices Candles
Example 1: Get 12 hour candles for the vwap5 index values of btc.
GET https://api.tokendatabase.com/v1/indices/vwap5/ohlcv?ids=btc&end=2020-01-14T12:00:00.000&start=2020-01-10T12:00:00.000&period=12hour&key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/indices/vwap5/ohlcv' \
-d ids=btc \
-d end=2020-01-14T12:00:00.000 \
-d start=2020-01-10T12:00:00.000 \
-d period=12hour \
-d key="my-api-key"
Response
{
"hits": 1,
"num_objects": 9,
"results": [
{
"id": "btc",
"period": "12hour",
"start_time": "2020-01-10 12:00:00",
"end_time": "2020-01-14 12:00:00",
"candles": [
{
"time": "2020-01-10T12:00:00",
"open": 7796.02548782972,
"high": 8122.57234618466,
"low": 7783.23599353826,
"close": 8122.57234618466,
"volume": 269762.441833174,
"volume_quote": 2150707563.81546
},
{
"time": "2020-01-11T00:00:00",
"open": 8121.70979186415,
"high": 8189.01610935148,
"low": 8052.27474337083,
"close": 8059.60922444498,
"volume": 175612.28786503,
"volume_quote": 1424968656.94341
},
{
"time": "2020-01-11T12:00:00",
"open": 8046.13940199198,
"high": 8238.08658461734,
"low": 8021.38130425776,
"close": 8060.73754296933,
"volume": 165515.312523046,
"volume_quote": 1340084033.99216
},
{
"time": "2020-01-12T00:00:00",
"open": 8025.41571670597,
"high": 8136.86039382349,
"low": 8025.41571670597,
"close": 8128.66368706794,
"volume": 141224.283963612,
"volume_quote": 1141880896.93646
},
{
"time": "2020-01-12T12:00:00",
"open": 8129.86822114356,
"high": 8150.93910534163,
"low": 8086.46280681695,
"close": 8150.93910534163,
"volume": 141851.193023027,
"volume_quote": 1152289315.46107
},
{
"time": "2020-01-13T00:00:00",
"open": 8146.98001922135,
"high": 8178.4117132804,
"low": 8075.07398105715,
"close": 8089.39307634542,
"volume": 138377.315724377,
"volume_quote": 1123375754.15571
},
{
"time": "2020-01-13T12:00:00",
"open": 8084.38261182566,
"high": 8134.75060870318,
"low": 8079.21393653524,
"close": 8113.21314006059,
"volume": 131155.731093466,
"volume_quote": 1062933747.04494
},
{
"time": "2020-01-14T00:00:00",
"open": 8122.49436016051,
"high": 8525.62221016561,
"low": 8113.56158586556,
"close": 8475.79345094406,
"volume": 270739.501763515,
"volume_quote": 2275546904.02651
},
{
"time": "2020-01-14T12:00:00",
"open": 8468.55282375582,
"high": 8789.81685684049,
"low": 8465.90625492494,
"close": 8772.41700680898,
"volume": 392439.000594497,
"volume_quote": 3392805649.07686
}
]
}
],
"errors": []
}
Endpoint Description
Gets the OHLCV candles for the specified assets(s) using the specified index. Candles span the requested interval, and have the specified candle size.
https://api.tokendatabase.com/v1/indices/<index-id>/ohlcv
Method: GET
Objects per hit: 100
Restrictions: This endpoint will return a maximum of 200 candles for free users and 2000 candles for paid users in a single call. Requests for a larger number of candles must be broken up by the user. Free users are restricted to periods >= 30min.
Pagination: If the requested parameters represents more than the maximum candles that may be returned according the restrictions listed above, the end user must paginate their request to retrieve all the data. In the case that the maximum candles are exceeded by the request, the maximum number of candles will be returned from the end date, backwards. The start_time of the results will contain the start time of the limited request - ie. the earliest candle that was returned. The next set of candles may be discovered by making the same request, but with the end_time set to the returned start_time of the previous request. This process may be repeated until all desired data has been delivered.
Query Parameters
-
index-id Required
The id of the index for which summary information is being requested. This parameter is included as part of the url path. See the provided examples for more details about passing this parameter
Valid Values: An Index ID
-
ids Required
-
end Required
The end of the requested time interval. Returns candles that open at or before the specified time (UTC)
Valid Values: Time Value
-
start Required
The start of the requested time interval. Returns candles that open at or after the specified time (UTC)
Valid Values: Time Value
-
period Required
Specifies the period or size of each candle
Valid Values:- 5min
- 30min
- 1hour
- 12hour
- 1day
- 1week
- 1month
- 1year
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
An Asset IDThe unique id used to reference the base asset on the TokenDatabase API -
period
stringThe period of the returned candles. -
start_time
Time ValueThe time-stamp representing the beginning of the time interval spanned by the returned candles -
end_time
Time ValueThe time-stamp representing the beginning of the time interval of the final candle in the returned set -
candles
arrayThe set of candles for the requested parameters. Each entry in this array represents a candle of the requested period, spanning the requested time interval between the before and after parameters.- Child attributes
-
The time-stamp representing the beginning of the time interval of this candle
-
candles.open
floatThe open price of the candle. This is the price of the first trade observed during the candle's time interval. -
candles.high
floatThe highest price observed during the candle's time interval -
candles.low
floatThe lowest price observed during the candle's time interval -
candles.close
floatThe close price of the candle. This is the last observed index price during the candle's time interval. -
candles.volume
floatThe total volume of base currency traded over the candle's time interval. -
candles.volume_quote
floatThe value of all trades involving the requested base asset expressed in the index's quote currency. This value is calculated on a per-trade basis.
Markets
Get Markets
Example 1: Get all markets from the kraken exchange where eth is traded as the base currency
GET https://api.tokendatabase.com/v1/markets?exchange=kraken&base=eth&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/markets' \
-d exchange=kraken \
-d base=eth \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 7,
"results": [
{
"id": "kraken_spot_eth_dai",
"exchange": "kraken",
"base": "eth",
"quote": "dai",
"type": "spot",
"active": true
},
{
"id": "kraken_spot_eth_jpy",
"exchange": "kraken",
"base": "eth",
"quote": "jpy",
"type": "spot",
"active": true
},
{
"id": "kraken_spot_eth_usd",
"exchange": "kraken",
"base": "eth",
"quote": "usd",
"type": "spot",
"active": true
},
{
"id": "kraken_spot_eth_eur",
"exchange": "kraken",
"base": "eth",
"quote": "eur",
"type": "spot",
"active": true
},
{
"id": "kraken_spot_eth_gbp",
"exchange": "kraken",
"base": "eth",
"quote": "gbp",
"type": "spot",
"active": true
},
{
"id": "kraken_spot_eth_btc",
"exchange": "kraken",
"base": "eth",
"quote": "btc",
"type": "spot",
"active": true
},
{
"id": "kraken_spot_eth_cad",
"exchange": "kraken",
"base": "eth",
"quote": "cad",
"type": "spot",
"active": true
}
],
"errors": []
}
Endpoint Description
Return a list of all available markets.
https://api.tokendatabase.com/v1/markets
Method: GET
Objects per hit: 100
Query Parameters
-
exchange Optional
If provided, returned markets will be limited to those on the specified exchange
Valid Values: An Exchange ID
Default Value:All exchanges -
base Optional
If provided, returned markets will be limited to those with the specified base
Valid Values: An Asset ID
Default Value:All assets -
quote Optional
If provided, returned markets will be limited to those with the specified quote
Valid Values: An Asset ID
Default Value:All assets -
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market on the TokenDatabase API -
exchange
An Exchange IDThe exchange on which this market is located. -
base
An Asset IDThe base currency of this market. -
quote
An Asset IDThe quote currency of this market. -
type
stringThe type of market. Currently always 'spot'. -
active
booleanThis field will be true when the market is active on the exchange. If an exchange removes a market, or freezes trading on a market, this value will be set to false.
Get Orderbook Snapshots
Example 1: Get the first 5 levels from the orderbook of the poloniex_spot_eth_btc market at the specified time, when the levels have been bucketed into prices with 6 significant figures.
GET https://api.tokendatabase.com/v1/markets/orderbooks?ids=poloniex_spot_eth_btc&before=2020-01-10T12:00:00&levels=5&level_precision=-6&key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/markets/orderbooks' \
-d ids=poloniex_spot_eth_btc \
-d before=2020-01-10T12:00:00 \
-d levels=5 \
-d level_precision=-6 \
-d key="my-api-key"
Response
{
"hits": 2,
"hits_remaining": 998,
"num_objects": 100,
"results": [
{
"id": "poloniex_spot_eth_btc",
"exchange": "poloniex",
"base": "eth",
"quote": "btc",
"type": "spot",
"orderbook": {
"time": "2020-01-10T11:59:20",
"bids": [
{
"price": 0.017659,
"orders": [
144.4166
]
},
{
"price": 0.017645,
"orders": [
30,
1.25698929,
47.742961,
55.6951267
]
},
{
"price": 0.017643,
"orders": [
0.0062
]
},
{
"price": 0.017635,
"orders": [
23.7,
9.83299067
]
},
{
"price": 0.017632,
"orders": [
0.00572858,
20.75,
3.77230182
]
}
],
"asks": [
{
"price": 0.017673,
"orders": [
32.857221,
18.68186798
]
},
{
"price": 0.017682,
"orders": [
0.73563531,
26.2
]
},
{
"price": 0.017691,
"orders": [
16
]
},
{
"price": 0.017693,
"orders": [
0.006
]
},
{
"price": 0.017699,
"orders": [
23.2
]
}
]
}
}
],
"errors": []
}
Endpoint Description
Returns the most recent orderbook snapshot for a specified market before a specified time. Order levels are guaranteed to be returned in sorted order.
https://api.tokendatabase.com/v1/markets/orderbooks
Method: GET
Objects per hit: 50
Restrictions: Free users are restricted to only the most recent order book snapshot for each market.
Query Parameters
-
ids Required
Specifies a list of market ids from which to retrieve an orderbook snapshot
Valid Values: An ID List composed of Market IDs
-
before Optional
Before time. Returns the latest order book snapshot before the specified time (UTC)
Valid Values: Time Value
Default Value:Current Time -
level Optional
The maximum number of price levels to return, from best to worst
Valid Values: integer
Default Value:All Levels -
level_precision Optional
If present, this parameter will cause the order levels to be bucketed.
Valid Values: integer
Default Value:Full Precision -
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market on the TokenDatabase API. -
exchange
An Exchange IDThe exchange on which this market is located. -
base
An Asset IDThe base currency of this market. -
quote
An Asset IDThe quote currency of this market. -
type
stringThe type of market. Currently always 'spot'. -
orderbook
objectThis object represents the orderbook of the market at the requested parameters.- Child attributes
-
The time-stamp of this orderbook.
-
orderbook.bids
objectThe bids from the orderbook. These are orders looking to buy the base currency in exchange for the quote currency. Bids are guaranteed to be sorted from from highest price to lowest.- Child attributes
-
orderbook.bids.price
floatThe price level of a set of orders. -
orderbook.bids.orders
arrayAn array of floats representing the volume of each order, on the bid side, at this level.
-
orderbook.asks
objectThe bids from the orderbook. These are orders looking to sell the base currency in exchange for the quote currency. Asks are guaranteed to be sorted from from lowest price to highest- Child attributes
-
orderbook.asks.price
floatThe price level of a set of orders. -
orderbook.asks.orders
arrayAn array of floats representing the volume of each order, on the ask side, at this level.
Get Statistical Candles
Example 1: Get the 12 hour statistical candles for a single day on a eth-btc market from two different exchanges.
GET https://api.tokendatabase.com/v1/markets/statcandles?ids=poloniex_spot_eth_btc,kraken_spot_eth_btc&start=2020-01-15&end=2020-01-15T23:59&period=12hour&key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/markets/statcandles' \
-d ids=poloniex_spot_eth_btc,kraken_spot_eth_btc \
-d start=2020-01-15 \
-d end=2020-01-15T23:59 \
-d period=12hour \
-d key="my-api-key"
Response
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 4,
"results": [
{
"id": "kraken_spot_eth_btc",
"exchange": "kraken",
"base": "eth",
"quote": "btc",
"type": "spot",
"period": "12hour",
"start_time": "2020-01-15 00:00:00",
"end_time": "2020-01-15 12:00:00",
"candles": [
{
"time": "2020-01-15T00:00:00",
"open": 0.01879,
"high": 0.01943,
"low": 0.01855,
"close": 0.01884,
"total_volume": 5803.89508192999,
"bought_volume": 3061.65103615999,
"sold_volume": 2742.24404577,
"total_trades": 1859,
"num_bought": 973,
"num_sold": 886,
"price_variance": 4.390928844180895E-8,
"vwap": 0.018954510054060278,
"volume_variance": 155.91827597997113,
"u_volume": 3.1220522226627163,
"vp": 110.009987683153,
"vpp": 2.08544026249061,
"vv": 307972.138587407
},
{
"time": "2020-01-15T12:00:00",
"open": 0.01885,
"high": 0.01898,
"low": 0.01843,
"close": 0.01887,
"total_volume": 5825.04834611,
"bought_volume": 1766.34481752,
"sold_volume": 4058.70352859,
"total_trades": 1431,
"num_bought": 597,
"num_sold": 834,
"price_variance": 1.2807121592096831E-8,
"vwap": 0.018804503615451797,
"volume_variance": 710.7103030146587,
"u_volume": 4.070613798819008,
"vp": 109.537142684607,
"vpp": 2.0598661977414,
"vv": 1040737.96579044
}
]
},
{
"id": "poloniex_spot_eth_btc",
"exchange": "poloniex",
"base": "eth",
"quote": "btc",
"type": "spot",
"period": "12hour",
"start_time": "2020-01-15 00:00:00",
"end_time": "2020-01-15 12:00:00",
"candles": [
{
"time": "2020-01-15T00:00:00",
"open": 0.01879382,
"high": 0.01943944,
"low": 0.01852301,
"close": 0.01881467,
"total_volume": 13755.85723007,
"bought_volume": 6965.83292466001,
"sold_volume": 6790.02430540999,
"total_trades": 6374,
"num_bought": 3400,
"num_sold": 2974,
"price_variance": 3.8918268365383707E-8,
"vwap": 0.01886428258396496,
"volume_variance": 60.70485324843007,
"u_volume": 2.1581200549215565,
"vp": 259.494377972718,
"vpp": 4.89571062917084,
"vv": 416619.525966345
},
{
"time": "2020-01-15T12:00:00",
"open": 0.01883398,
"high": 0.01899816,
"low": 0.01842711,
"close": 0.01886201,
"total_volume": 11492.52410353025,
"bought_volume": 5851.68900283013,
"sold_volume": 5640.83510070012,
"total_trades": 9781,
"num_bought": 5013,
"num_sold": 4768,
"price_variance": 1.0809191086758882E-8,
"vwap": 0.018752778985705675,
"volume_variance": 27.29219474176413,
"u_volume": 1.1749845724905683,
"vp": 215.516764501398,
"vpp": 4.0416624772982,
"vv": 280448.495289819
}
]
}
],
"errors": []
}
Endpoint Description
Gets a set of candles for the specified market(s) spanning the requested interval, with the specified candle size. These candles contain more detailed statistical analysis than that provided by the ohlcv endpoint
https://api.tokendatabase.com/v1/markets/statcandles
Method: GET
Objects per hit: 100
Restrictions: This endpoint is restricted to the Developer tier
This endpoint will return a maximum of 2000 candles in a single call. Requests for a larger number of candles must be broken up by the user.
Pagination: If the requested parameters represents more than the maximum candles that may be returned according the restrictions listed above, the end user must paginate their request to retrieve all the data. In the case that the maximum candles are exceeded by the request, the maximum number of candles will be returned from the end date, backwards. The start_time of the results will contain the start time of the limited request - ie. the earliest candle that was returned. The next set of candles may be discovered by making the same request, but with the end_time set to the returned start_time of the previous request. This process may be repeated until all desired data has been delivered.
Query Parameters
-
ids Required
Specifies a list of market ids from which to retrieve trades
Valid Values: An ID List composed of Market IDs
-
end Required
The end of the requested time interval. Returns candles that open at or before the specified time (UTC)
Valid Values: Time Value
-
start Required
The start of the requested time interval. Returns candles that open at or after the specified time (UTC)
Valid Values: Time Value
-
period Required
Specifies the period or size of each candle
Valid Values:- 1min
- 3min
- 5min
- 30min
- 1hour
- 12hour
- 1day
- 1week
- 1month
- 1year
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market on the TokenDatabase API -
exchange
An Exchange IDThe exchange on which this market is located. -
base
An Asset IDThe base currency of this market. -
quote
An Asset IDThe quote currency of this market. -
type
stringThe type of market. Currently always 'spot'. -
period
stringThe period of the returned candles. -
start_time
Time ValueThe time-stamp representing the beginning of the time interval spanned by the returned candles -
end_time
Time ValueThe time-stamp representing the beginning of the time interval of the final candle in the returned set -
candles
arrayThe set of candles for the requested parameters. Each entry in this array represents a candle of the requested period, spanning the requested time interval between the before and after parameters.- Child attributes
-
The time-stamp representing the beginning of the time interval of this candle
-
candles.open
floatThe open price of the candle. This is the price of the first trade observed during the candle's time interval. -
candles.high
floatThe highest price observed during the candle's time interval -
candles.low
floatThe lowest price observed during the candle's time interval -
candles.close
floatThe close price of the candle. This is the last observed trade during the candle's time interval. -
candles.total_volume
floatThe total volume of base currency during all trades over the candle's time interval. -
candles.bought_volume
floatThe volume of base currency during all trades over the candle's time interval where the trade represented a buy event. -
candles.sold_volume
floatThe total volume of base currency during all trades over the candle's time interval where the trade represented a sell event. -
candles.total_trades
integerThe total number of trades over the candle's time interval. -
candles.num_bought
integerThe total number of trades representing buy events over the candle's time interval. -
candles.num_sold
integerThe total number of trades representing sell events over the candle's time interval. -
candles.price_variance
floatThe variance of prices across all trades during the candle's time interval. -
candles.vwap
floatThe volume weighted average price of each trade during the candle's time interval. -
candles.volume_variance
floatThe variance of trade volume across all trades during the candle's time interval. -
candles.u_volume
floatThe average quantity of each trade during the candle's time interval. -
candles.vp
floatThis value represents the sum of the volume*price of each trade during the candle's time interval. This value is equivalent to the total quote currency traded during the interval. -
candles.vpp
floatThis value represents the sum of the volume*price2 of each trade during the candle's time interval. -
candles.vv
floatThis value represents the sum of the volume2 of each trade during the candle's time interval.
Get Market Data Extents
Example 1: Gets the time extents of candle data for three markets.
GET https://api.tokendatabase.com/v1/markets/extents?ids=kraken_spot_btc_usd,poloniex_spot_btc_usdt,bitfinex_spot_btc_usd&type=candles&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/markets/extents' \
-d ids=kraken_spot_btc_usd,poloniex_spot_btc_usdt,bitfinex_spot_btc_usd \
-d type=candles \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 99939,
"num_objects": 3,
"results": [
{
"id": "kraken_spot_btc_usd",
"type": "candles",
"start_time": "2014-01-07T18:18:17",
"end_time": "2020-02-10T19:15:46.873000"
},
{
"id": "bitfinex_spot_btc_usd",
"type": "candles",
"start_time": "2013-03-31T22:07:48",
"end_time": "2020-02-10T19:15:46"
},
{
"id": "poloniex_spot_btc_usdt",
"type": "candles",
"start_time": "2018-10-17T22:36:41",
"end_time": "2020-02-10T18:04:03"
}
],
"errors": []
}
Endpoint Description
For the requested markets and data types, this endpoint returns the date rage over which TokenDatabase has data.
https://api.tokendatabase.com/v1/extents
Method: GET
Objects per hit: 100
Query Parameters
-
ids Required
Specifies a list of market ids from which to retrieve trades
Valid Values: An ID List composed of Market IDs
-
type Required
The type of endpoint for which date ranges should be returned.
Valid Values:- 'candles'
- 'trades'
- 'orderbooks'
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market on the TokenDatabase API. -
type
stringThe type of data endpoint. -
start_time
Time ValueThe earliest time at which the TokenDatabase API has data of the given type for this market. -
start_time
Time ValueThe latest time at which the TokenDatabase API currently has data of the given type for this market.
Get Trades
Example 1: Get the 10 most recent trades from the poloniex_spot_eth_btc market.
GET https://api.tokendatabase.com/v1/markets/trades?ids=poloniex_spot_eth_btc&limit=10&key=my-api-key
curl -X GET -G 'https://api.tokendatabase.com/v1/markets/trades' \
-d ids=poloniex_spot_eth_btc \
-d limit=10 \
-d key="my-api-key"
Response
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 10,
"results": [
{
"id": "poloniex_spot_eth_btc",
"exchange": "poloniex",
"base": "eth",
"quote": "btc",
"type": "spot",
"trades": [
{
"id": 9951651082,
"id_on_exchange": "48329977",
"time": "2020-01-15T21:00:53",
"price": 0.018887,
"quantity": 0.33977825,
"side": "sell"
},
{
"id": 9951651081,
"id_on_exchange": "48329976",
"time": "2020-01-15T21:00:50",
"price": 0.01887983,
"quantity": 0.6,
"side": "sell"
},
{
"id": 9951651080,
"id_on_exchange": "48329975",
"time": "2020-01-15T21:00:47",
"price": 0.01888365,
"quantity": 0.42707822,
"side": "buy"
},
{
"id": 9951651075,
"id_on_exchange": "48329974",
"time": "2020-01-15T21:00:43",
"price": 0.018876,
"quantity": 0.59808207,
"side": "buy"
},
{
"id": 9951651079,
"id_on_exchange": "48329973",
"time": "2020-01-15T21:00:43",
"price": 0.01887597,
"quantity": 2.87104052,
"side": "buy"
},
{
"id": 9951651070,
"id_on_exchange": "48329972",
"time": "2020-01-15T21:00:38",
"price": 0.018873,
"quantity": 0.6,
"side": "buy"
},
{
"id": 9951651064,
"id_on_exchange": "48329971",
"time": "2020-01-15T21:00:32",
"price": 0.018876,
"quantity": 0.53718106,
"side": "buy"
},
{
"id": 9951651065,
"id_on_exchange": "48329970",
"time": "2020-01-15T21:00:32",
"price": 0.01887599,
"quantity": 0.06090101,
"side": "buy"
},
{
"id": 9951651059,
"id_on_exchange": "48329969",
"time": "2020-01-15T21:00:23",
"price": 0.01888495,
"quantity": 0.6,
"side": "sell"
},
{
"id": 9951651056,
"id_on_exchange": "48329968",
"time": "2020-01-15T21:00:12",
"price": 0.01887443,
"quantity": 0.45920098,
"side": "buy"
}
]
}
],
"errors": []
}
Endpoint Description
Returns a list of trades for the specified market(s)
https://api.tokendatabase.com/v1/markets/trades
Method: GET
Objects per hit: 100
Restrictions: This endpoint will return a maximum of 1000 trades in a single call. Requests for a larger number of trades may be broken up by the user by setting the since parameter on the next subsequent call to the last returned id from the previous call.
Free users are restricted to the most recent 100 trades.
Pagination: If the requested parameters represents more than the maximum number of trades that may be returned according the restrictions listed above, the end user must paginate their request to retrieve all the data. In the case that the maximum trades are exceeded by the request, the maximum number of trades will be returned from the start time, if supplied, forward. By then taking the latest id returned, and providing that id as the since parameter in the next subsequent query, the next set of trades may be returned. This process may be repeated until all desired data has been delivered.
Query Parameters
-
ids Required
Specifies a list of market ids from which to retrieve trades
Valid Values: An ID List composed of Market IDs
-
end Optional
Returns trades before the specified time (UTC)
Valid Values: Time Value
Default Value:Current Time -
start Optional
Returns trades after the specified time (UTC)
Valid Values: Time Value
-
since Optional
Since trade id. Returns trades that occur after the trade specified by trade id
Valid Values: A Trade ID
-
limit Optional
Specifies the maximum number of trades to return
Valid Values: integer (<=10000)
Default Value:100 -
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market on the TokenDatabase API. -
exchange
An Exchange IDThe exchange on which this market is located. -
base
An Asset IDThe base currency of this market. -
quote
An Asset IDThe quote currency of this market. -
type
stringThe type of market. Currently always 'spot'. -
trades
arrayAn list of all requested trades for this market.- Child attributes
-
trades.id
stringThe trade id of this trade on the TokenDatabase API. -
trades.id_on_exchange
stringThe trade id of this trade as referenced on the source exchange. This value may be blank for exchanges that don't provide an id. -
The time at which this trade was executed.
-
trades.price
floatThe price at which this trade was executed. -
trades.quantity
floatThe quantity of base currency that was traded. -
trades.side
stringThe side of this trade, either 'buy' or 'sell'.
A side of 'buy' represents that the trade was filled when a new, 'ask' order was placed, crossing the book and trading against a previously existing 'bid' order. Likewise, a side of 'sell' represents that the trade was filled when a new, 'bid' order was placed, crossing the book and trading against a previously existing 'ask' order.
Get Candles
Example 1: Get the 12 hour ohlcv candles for kraken_spot_eth_dai between January 1st and January 5th
GET https://api.tokendatabase.com/v1/markets/ohlcv?ids=kraken_spot_eth_dai&start=2020-01-01&end=2020-01-04T12:00:00&period=12hour&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/markets/ohlcv' \
-d ids=kraken_spot_eth_dai \
-d start=2020-01-01 \
-d end=2020-01-04T12:00:00 \
-d period=12hour \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 8,
"results": [
{
"id": "kraken_spot_eth_dai",
"exchange": "kraken",
"base": "eth",
"quote": "dai",
"type": "spot",
"period": "12hour",
"start_time": "2020-01-01 00:00:00",
"end_time": "2020-01-04 12:00:00",
"candles": [
{
"time": "2020-01-04T12:00:00",
"open": 133.641,
"high": 135.75,
"low": 133.641,
"close": 134.635,
"volume": 21.75996466
},
{
"time": "2020-01-04T00:00:00",
"open": 133.33,
"high": 133.33,
"low": 133.33,
"close": 133.33,
"volume": 1
},
{
"time": "2020-01-03T12:00:00",
"open": 132.65,
"high": 135,
"low": 131.89,
"close": 135,
"volume": 14.99128364
},
{
"time": "2020-01-03T00:00:00",
"open": 127.32,
"high": 132.9,
"low": 126.558,
"close": 132.306,
"volume": 36.735939679999994
},
{
"time": "2020-01-02T12:00:00",
"open": 129.3,
"high": 129.608,
"low": 126.85,
"close": 126.993,
"volume": 496.67804494999996
},
{
"time": "2020-01-02T00:00:00",
"open": 130,
"high": 130,
"low": 130,
"close": 130,
"volume": 0.2
},
{
"time": "2020-01-01T12:00:00",
"open": 131.949,
"high": 133.135,
"low": 131.949,
"close": 132.21,
"volume": 3.80438165
},
{
"time": "2020-01-01T00:00:00",
"open": 129.75,
"high": 131.21,
"low": 129.674,
"close": 130.933,
"volume": 59.915
}
]
}
],
"errors": []
}
Endpoint Description
Gets the OHLCV candles for the specified market(s). Candles span the requested interval, and have the specified candle size.
https://api.tokendatabase.com/v1/markets/ohlcv
Method: GET
Objects per hit: 100
Restrictions: This endpoint will return a maximum of 200 candles for free users, and a maximum of 2000 candles for paid users in a single call. Requests for a larger number of candles must be broken up by the user. Free users are restricted to periods >= 30min
Pagination: If the requested parameters represents more than the maximum candles that may be returned according the restrictions listed above, the end user must paginate their request to retrieve all the data. In the case that the maximum candles are exceeded by the request, the maximum number of candles will be returned from the end date, backwards. The start_time of the results will contain the start time of the limited request - ie. the earliest candle that was returned. The next set of candles may be discovered by making the same request, but with the end_time set to the returned start_time of the previous request. This process may be repeated until all desired data has been delivered.
Query Parameters
-
ids Required
Specifies a list of market ids from which to retrieve trades
Valid Values: An ID List composed of Market IDs
-
end Required
The end of the requested time interval. Returns candles that open at or before the specified time (UTC)
Valid Values: Time Value
-
start Required
The start of the requested time interval. Returns candles that open at or after the specified time (UTC)
Valid Values: Time Value
-
period Required
Specifies the period or size of each candle
Valid Values:- 1min
- 3min
- 5min
- 30min
- 1hour
- 12hour
- 1day
- 1week
- 1month
- 1year
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market on the TokenDatabase API -
exchange
An Exchange IDThe exchange on which this market is located. -
base
An Asset IDThe base currency of this market. -
quote
An Asset IDThe quote currency of this market. -
type
stringThe type of market. Currently always 'spot'. -
period
stringThe period of the returned candles. -
start_time
Time ValueThe time-stamp representing the beginning of the time interval spanned by the returned candles -
end_time
Time ValueThe time-stamp representing the beginning of the time interval of the final candle in the returned set -
candles
arrayThe set of candles for the requested parameters. Each entry in this array represents a candle of the requested period, spanning the requested time interval between the before and after parameters.- Child attributes
-
The time-stamp representing the beginning of the time interval of this candle
-
candles.open
floatThe open price of the candle. This is the price of the first trade observed during the candle's time interval. -
candles.high
floatThe highest price observed during the candle's time interval -
candles.low
floatThe lowest price observed during the candle's time interval -
candles.close
floatThe close price of the candle. This is the last observed trade during the candle's time interval. -
candles.volume
floatThe total volume of base currency during all trades over the candle's time interval.
Get Market Summary
Example 1: Get a summary of the current state of the markets kraken_spot_eth_dai and kraken_spot_eth_jpy
GET https://api.tokendatabase.com/v1/markets/summaries?ids=kraken_spot_eth_dai,kraken_spot_eth_jpy&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/markets/summaries' \
-d ids=kraken_spot_eth_dai,kraken_spot_eth_jpy \
-d key="my-api-key"
Response JSON
{
"hits": 2,
"hits_remaining": 998,
"num_objects": 2,
"results": [
{
"id": "kraken_spot_eth_dai",
"exchange": "kraken",
"base": "eth",
"quote": "dai",
"type": "spot",
"summary": {
"last_price": 141.613,
"volume_24h": 23.77760177,
"pct_change_24h": 4.964607345365606,
"time": "2020-01-10T16:39:56.852800"
}
},
{
"id": "kraken_spot_eth_jpy",
"exchange": "kraken",
"base": "eth",
"quote": "jpy",
"type": "spot",
"summary": {
"last_price": 15766,
"volume_24h": 0.0202,
"pct_change_24h": 5.578249514498092,
"time": "2020-01-10T18:13:59.059000"
}
}
],
"errors": []
}
Endpoint Description
Returns the latest summary for a specified market.
https://api.tokendatabase.com/v1/markets/summaries
Method: GET
Objects per hit: 1
Restrictions: Free users are restricted to a time interval of <= 1 day
Query Parameters
-
ids Required
Specifies a list of market ids from which to retrieve a summary
Valid Values: An ID List composed of Market IDs
-
key Required
Your API key.
Valid Values: my-api-key
Results Object Attributes
-
id
A Market IDThe unique id used to reference the market on the TokenDatabase API -
exchange
An Exchange IDThe exchange on which this market is located. -
base
An Asset IDThe base currency of this market. -
quote
An Asset IDThe quote currency of this market. -
type
stringThe type of market. Currently always 'spot'. -
summary
objectAn object representing the market summary for this market- Child attributes
-
summary.last_price
floatThe price of the most recently observed trade. -
summary.volume_24h
floatThe current, 24 hour, rolling volume of this market. -
summary.pct_change_24h
floatThe change in price over the last 24 hours on this market. -
summary.time
stringThe time of the last observed trade on this market.
News
Get Sources
Example 1: Retrieve all news sources with the text 'crypto' in their name
GET https://api.tokendatabase.com/v1/news/sources?query=crypto&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/news/sources' \
-d query=crypto \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 11,
"results": [
{
"id": 359,
"url": "www.cryptovibes.com",
"name": "Cryptovibes.com"
},
{
"id": 98,
"url": "www.cryptonewsz.com",
"name": "CryptoNewsZ"
},
{
"id": 709,
"url": "cryptoslate.com",
"name": "CryptoSlate"
},
{
"id": 880,
"url": "cryptopotato.com",
"name": "CryptoPotato"
},
{
"id": 665,
"url": "www.cryptoninjas.net",
"name": "CryptoNinjas"
},
{
"id": 6238,
"url": "cryptobriefing.com",
"name": "Crypto Briefing"
},
{
"id": 36,
"url": "cryptonews.com",
"name": "cryptonews"
},
{
"id": 642,
"url": "beincrypto.com",
"name": "BeInCrypto"
},
{
"id": 118,
"url": "cryptoglobe.com",
"name": "CryptoGlobe"
},
{
"id": 168,
"url": "ambcrypto.com",
"name": "AMBCrypto"
},
{
"id": 953,
"url": "cryptocanucks.com",
"name": "CryptoCanucks"
}
],
"errors": []
}
Endpoint Description
Get all valid news sources
https://api.tokendatabase.com/v1/news/sources
Method: GET
Objects per hit: 100
Query Parameters
-
key Required
Your API key.
Valid Values: my-api-key
-
query Optional
If provided, only sources whose names match the provided query parameter will be returned
Valid Values: Regular Expression String
Default Value:All sources
Results Object Attributes
-
id
A News Source IDThe source id used to reference this source on the TokenDatabase API -
url
stringThe url of the source -
name
stringThe full name of the source
Get News Metrics
Example 1: Get news metrics for articles containing the text 'defi' summarized by year between 2015 and 2020.
GET https://api.tokendatabase.com/v1/news/metrics?start=2015-01-01&end=2020-01-01&period=1year&query=defi&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/news/metrics' \
-d start=2015-01-01 \
-d end=2020-01-01 \
-d period=1year \
-d query=defi \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 99988,
"num_objects": 6,
"results": [
{
"period": "1year",
"start_time": "2015-01-01T00:00:00",
"end_time": "2020-01-01T00:00:00",
"metrics": [
{
"time": "2020-01-01T00:00:00",
"matching": 278,
"pct": 4.18863944553262,
"total": 6637
},
{
"time": "2019-01-01T00:00:00",
"matching": 846,
"pct": 1.151756905776483,
"total": 73453
},
{
"time": "2018-01-01T00:00:00",
"matching": 281,
"pct": 0.4108907995554776,
"total": 68388
},
{
"time": "2017-01-01T00:00:00",
"matching": 119,
"pct": 0.4864091559370529,
"total": 24465
},
{
"time": "2016-01-01T00:00:00",
"matching": 156,
"pct": 1.3484311522171322,
"total": 11569
},
{
"time": "2015-01-01T00:00:00",
"matching": 26,
"pct": 0.3351379221448827,
"total": 7758
}
]
}
],
"errors": []
}
Endpoint Description
Get summary information about the ratio of news articles matching the provided parameters vs all news articles. This summary information is bucketed into periods of time as requested in the parameters, such that the ratio of matching articles to all articles is provided for each period of time comprising the requested time interval.
https://api.tokendatabase.com/v1/news/metrics
Method: GET
Objects per hit: 100
Restrictions: This endpoint will return a maximum of 200 buckets for free users, and up to 2000 buckets for paid users.
Query Parameters
-
key Required
Your API key.
Valid Values: my-api-key
-
start Required
The beginning of the requested time interval for which to return summary information
Valid Values: Time Value
-
end Required
The end of the requested time interval for which to return summary information
Valid Values: Time Value
-
period Required
The period at which to bucket the summary information
Valid Values:- 1hour
- 12hour
- 1day
- 1week
- 1month
- 1year
-
sources Optional
If provided, matching news posts will be limited to ones published from the sources list
Valid Values: An ID List composed of News Source IDs
Default Value:All sources -
authors Optional
If provided, matching news posts will be limited to ones published by any of the provided authors
Valid Values: An ID List composed of Author IDs
Default Value:All authors -
query Optional
If provided, matching news posts will be limited to those containing text matching the provided query parameter
Valid Values: Regular Expression String
Default Value:All posts
Results Object Attributes
-
period
stringThe period at which the buckets are divided. -
start_time
Time ValueThe beginning of the returned time interval of the summary information. If this result has been limited according to the above restrictions, this time will not match the requested start time. See the pagination section above for more details. -
end_time
Time ValueThe end of the returned time interval of the summary information -
metrics
objectThe requested summary information- Child attributes
-
The start time of this bucket of summary information. This bucket spans the time interval [time, time + period).
-
metrics.matching
integerThe number of matching articles in this bucket -
metrics.pct
floatThe percentage of articles in this bucket that matched the requested parameters -
metrics.total
integerThe total number of articles, matching and not matching, in this bucket
Get News Posts
Example 1: Retrieve the last 5 news posts containing the text 'canada' posted between January 14th, 2020 and January 17th, 2020
GET https://api.tokendatabase.com/v1/news/posts?query=canada&start=2020-01-14&end=2020-01-17&limit=5&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/news/posts' \
-d query=canada \
-d start=2020-01-14 \
-d end=2020-01-17 \
-d limit=5 \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 99850,
"num_objects": 5,
"results": [
{
"id": 594316,
"time": "2020-01-16T19:00:14",
"url": "cryptopotato.com/grayscale-the-largest-digital-asset-manager-raises-more-than-600-million-in-2019",
"title": "Grayscale: The Largest Digital Asset Manager Raises More Than $600 Million In 2019",
"preview": "According to a 2019 investment report released by Grayscale, one of the world’s leading authorities on digital asset investment, the digital giant has",
"source": {
"id": 880,
"url": "cryptopotato.com"
},
"author": {
"id": 513076,
"name": "joel laforest"
},
"thumbnail": "https://cryptopotato.com/wp-content/uploads/2020/01/Depositphotos_5645748_s-2019-1-min.jpg"
},
{
"id": 592192,
"time": "2020-01-16T18:04:48",
"url": "www.cryptoninjas.net/2020/01/16/former-cftc-chair-launching-the-digital-dollar-project-with-accenture",
"title": "Former CFTC Chair launching the Digital Dollar Project with Accenture",
"preview": "J. Christopher (Chris) Giancarlo, former Chair of the Commodity Futures Trading Commission (CFTC), along with Charles Giancarlo and Daniel Gorfine, have",
"source": {
"id": 665,
"url": "www.cryptoninjas.net"
},
"author": {
"id": 418460,
"name": "cryptoninjas.net"
},
"thumbnail": "https://www.cryptoninjas.net/wp-content/uploads/digitaldollaraccenture.jpg"
},
{
"id": 590129,
"time": "2020-01-16T16:35:26",
"url": "beincrypto.com/cryptocurrency-industry-debates-digital-dollar-former-regulators-form-think-tank",
"title": "Cryptocurrency Industry Debates Digital Dollar as Former Regulators Form Think Tank",
"preview": "Yesterday rumors circulated the internet that the US Federal Reserve will announce the creation of a cryptocurrency-like digital dollar.",
"source": {
"id": 642,
"url": "beincrypto.com"
},
"author": {
"id": 131,
"name": "rick d."
},
"thumbnail": "https://s32659.pcdn.co/wp-content/uploads/2019/10/bic_fed_reserve_usd_btc_bitcoin.jpg"
},
{
"id": 586017,
"time": "2020-01-16T13:29:49",
"url": "www.cryptonewsz.com/utrust-the-perfect-solution-for-cryptocurrency-payments/55931",
"title": "Utrust provides a complete solution for Cryptocurrency Payments",
"preview": "Utrust provides faster, cheaper, easier payments and allows users to make payments with any major digital currencies and tokens.",
"source": {
"id": 98,
"url": "www.cryptonewsz.com"
},
"author": {
"id": 98,
"name": "roxanne williams"
},
"thumbnail": "https://www.cryptonewsz.com/wp-content/uploads/2020/01/Utrust-is-bringing-the-power-of-crypto-payments-to-everyone.jpg"
},
{
"id": 563749,
"time": "2020-01-15T21:54:32",
"url": "cryptopotato.com/bitcoin-permabull-michael-novogratz-questions-latest-altcoin-rally",
"title": "Bitcoin Permabull Michael Novogratz Questions Latest Altcoin Rally",
"preview": "—Meta description not set.",
"source": {
"id": 880,
"url": "cryptopotato.com"
},
"author": {
"id": 513076,
"name": "joel laforest"
},
"thumbnail": "https://cryptopotato.com/wp-content/uploads/2019/12/Michael-Novogratz.jpg"
}
],
"errors": []
}
Endpoint Description
Get all news articles and posts matching the provided parameters.
https://api.tokendatabase.com/v1/news/posts
Method: GET
Objects per hit: 100
Restrictions: This endpoint will return a maximum of 1000 posts in a single call. Free users are restricted to the most recent 10 posts.
Query Parameters
-
key Required
Your API key.
Valid Values: my-api-key
-
end Optional
If provided, returns news posts published no later than the specified time (UTC)
Valid Values: Time Value
Default Value:The current time -
start Optional
If provided, returns news posts published no earlier than the specified time (UTC)
Valid Values: Time Value
-
sources Optional
If provided, news posts will be limited to ones published from the sources list
Valid Values: An ID List composed of News Source IDs
Default Value:All sources -
authors Optional
If provided, news posts will be limited to ones published by any of the provided authors
Valid Values: An ID List composed of Author IDs
Default Value:All authors -
query Optional
If provided, only news posts with text matching the provided query parameter will be returned
Valid Values: Regular Expression String
Default Value:All posts -
limit Optional
If provided, limit the number of results to this provided limit, ordered by time from newest to oldest.
Valid Values: integer
Default Value:100
Results Object Attributes
-
id
A News Post IDThe id of the news article -
time
Time ValueThe time at which the post was published -
title
stringThe title of the post -
url
stringThe url of the news post -
preview
stringA short preview of the article content -
source
objectThe source of the post- Child attributes
-
The id of the source
-
source.url
stringThe url of the source
-
author
objectThe author of the post- Child attributes
-
The name of the author
-
author.id
stringThe author id used to reference this author on the TokenDatabase API
-
thumbnail
stringThe url of the post thumbnail if such a thumbnail exists
Get Authors
Example 1: Retrieve all authors with first name Matthew
GET https://api.tokendatabase.com/v1/news/authors?query=matthew%20&key=my-api-key
curl -X GET -G \
'https://api.tokendatabase.com/v1/news/authors' \
-d query=matthew%20 \
-d key="my-api-key"
Response JSON
{
"hits": 1,
"hits_remaining": 999,
"num_objects": 10,
"results": [
{
"id": 162995,
"name": "matthew hickey"
},
{
"id": 61371,
"name": "matthew b."
},
{
"id": 343147,
"name": "s. matthew english"
},
{
"id": 1315,
"name": "matthew hrones"
},
{
"id": 6332,
"name": "matthew godshall"
},
{
"id": 66803,
"name": "matthew daniel"
},
{
"id": 137365,
"name": "matthew neuteboom"
},
{
"id": 648,
"name": "matthew willemsen"
},
{
"id": 138540,
"name": "matthew tompkins"
},
{
"id": 6193,
"name": "matthew north"
}
],
"errors": []
}
Endpoint Description
Get all available authors for news data provided by TokenDatabase.
https://api.tokendatabase.com/v1/news/authors
Method: GET
Objects per hit: 100
Query Parameters
-
key Required
Your API key.
Valid Values: my-api-key
-
query Optional
If provided, only authors whose names match the provided query parameter will be returned
Valid Values: Regular Expression String
Default Value:All authors
Results Object Attributes
-
id
An Author IDThe id of the author used to uniquely reference the author on the TokenDatabase API -
name
stringThe full name author