curl --request GET \
--url https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity} \
--header 'X-Blockworks-API-Key: <api-key>'import requests
url = "https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}"
headers = {"X-Blockworks-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Blockworks-API-Key': '<api-key>'}};
fetch('https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Blockworks-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Blockworks-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}")
.header("X-Blockworks-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Blockworks-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"point_schema": [
{
"description": "End of the windows, exclusive. Every window ends here.",
"field": "time",
"name": "Time",
"time": true,
"type": "time"
},
{
"description": "Minutes since 1970-01-01 UTC at time. Increases by 5 from one point to the next.",
"field": "seq",
"name": "Sequence",
"time": false,
"type": "int64"
},
{
"description": "USD value of tokens bought back and burned in the 5 minutes before time. Null when status5m is stale.",
"field": "buyback5mUSD",
"name": "Buyback 5m (USD)",
"time": false,
"type": "float64",
"unit": "usd"
}
],
"series": [
{
"entity": {
"name": "<name>",
"slug": "<slug>",
"symbol": "<symbol>"
},
"key": "<Asset ID>",
"points": [
[
1704067200,
123,
123.45
]
]
}
]
},
"error": null
}{
"data": null,
"error": "too many series requested: 11 exceeds the maximum of 10"
}{
"data": null,
"error": "this model requires authentication"
}{
"data": null,
"error": "this model requires the \"token-buybacks-dataset\" permission; see https://app.blockworks.com/account/api for the public API permissions you hold"
}{
"data": null,
"error": "the all-series endpoint is not available for model \"asset-buybacks\"; request specific series via ?series or a series-key path"
}Batch Get Asset timeseries
Tokens a project buys back and burns, summed over rolling 5-minute, 1-hour and 24-hour windows, in USD and in the token. Each series is one asset, keyed by its asset id. A point is published every 5 minutes and is final once published: time is the end of each window, and a point appears about 20 minutes after it, once every minute in its windows has settled. Each window carries a status: ok, empty when nothing was burned, partial when some minutes have no USD price, or stale when source data is missing and the values are null.
curl --request GET \
--url https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity} \
--header 'X-Blockworks-API-Key: <api-key>'import requests
url = "https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}"
headers = {"X-Blockworks-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Blockworks-API-Key': '<api-key>'}};
fetch('https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Blockworks-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Blockworks-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}")
.header("X-Blockworks-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blockworks.com/query/timeseries/asset-buybacks/{granularity}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Blockworks-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"point_schema": [
{
"description": "End of the windows, exclusive. Every window ends here.",
"field": "time",
"name": "Time",
"time": true,
"type": "time"
},
{
"description": "Minutes since 1970-01-01 UTC at time. Increases by 5 from one point to the next.",
"field": "seq",
"name": "Sequence",
"time": false,
"type": "int64"
},
{
"description": "USD value of tokens bought back and burned in the 5 minutes before time. Null when status5m is stale.",
"field": "buyback5mUSD",
"name": "Buyback 5m (USD)",
"time": false,
"type": "float64",
"unit": "usd"
}
],
"series": [
{
"entity": {
"name": "<name>",
"slug": "<slug>",
"symbol": "<symbol>"
},
"key": "<Asset ID>",
"points": [
[
1704067200,
123,
123.45
]
]
}
]
},
"error": null
}{
"data": null,
"error": "too many series requested: 11 exceeds the maximum of 10"
}{
"data": null,
"error": "this model requires authentication"
}{
"data": null,
"error": "this model requires the \"token-buybacks-dataset\" permission; see https://app.blockworks.com/account/api for the public API permissions you hold"
}{
"data": null,
"error": "the all-series endpoint is not available for model \"asset-buybacks\"; request specific series via ?series or a series-key path"
}Authorizations
API key sent in the X-Blockworks-API-Key header; x-messari-api-key is accepted for existing integrations. The catalog endpoints and models open to everyone need no key.
Path Parameters
Data granularity.
5m Query Parameters
Comma-separated Asset ID values naming the series to return (up to 10). Required: this model has too many series to return at once.
Time window, one of: to-date (ytd, qtd, mtd, dtd, htd); relative, followed by m, h, d or w (30d, 12h, 4w; 1y and 1M are not accepted, use 365d, 52w, ytd or a calendar year); a calendar day (YYYY-MM-DD), month (YYYY-MM) or year (YYYY); or an RFC3339 instant, which runs from then to now. Mutually exclusive with start/end. Optional: with no window at all the query runs from the beginning of the data to now, which is only served where it fits the cap of 9000 points of the requested granularity, so a window is in practice required at fine granularities.
Window start, inclusive (RFC3339, unix seconds, or YYYY-MM-DD). Optional; defaults to the beginning of the data.
Window end, exclusive (RFC3339, unix seconds, or YYYY-MM-DD). Optional; defaults to now.
If true, return only the first and last point of the resolved time window instead of every point in it. A bounds request is exempt from the 9000-point maximum, since it returns at most two points per series however wide the window is.
Comma-separated metric fields to return; defaults to every metric. A point always leads with its timestamp, and the values that follow are described by point_schema in catalog order regardless of the order requested here.
seq, buyback5mUSD, buyback5mNative, status5m, buyback1hUSD, buyback1hNative, status1h, buyback24hUSD, buyback24hNative, status24h Response format, overriding the Accept header: json (default), csv, or jsonl (NDJSON). csv and jsonl return the rows as a downloadable file.
json, csv, jsonl