curl -X PUT --compressed "https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=<your_key>" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "assets=sol" \
--data-urlencode "accounts=account1,account2" \
--data-urlencode "start_time=2023-07-04T00:00:00.000000000Z" \
--data-urlencode "end_time=2024-07-04T00:00:00.000000000Z"import requests
data = {
"assets": "sol",
"accounts": "account1,account2",
"start_time": "2023-07-04T00:00:00.000000000Z",
"end_time": "2024-07-04T00:00:00.000000000Z"
}
response = requests.put('https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=<your_key>',data=data).json()
print(response)
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
assets: '<string>',
accounts: '<string>',
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
start_height: '123',
end_height: '123',
start_slot: '123',
end_slot: '123'
})
};
fetch('https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=', 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.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "assets=%3Cstring%3E&accounts=%3Cstring%3E&start_time=2023-11-07T05%3A31%3A56Z&end_time=2023-11-07T05%3A31%3A56Z&start_height=123&end_height=123&start_slot=123&end_slot=123",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key="
payload := strings.NewReader("assets=%3Cstring%3E&accounts=%3Cstring%3E&start_time=2023-11-07T05%3A31%3A56Z&end_time=2023-11-07T05%3A31%3A56Z&start_height=123&end_height=123&start_slot=123&end_slot=123")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("assets=%3Cstring%3E&accounts=%3Cstring%3E&start_time=2023-11-07T05%3A31%3A56Z&end_time=2023-11-07T05%3A31%3A56Z&start_height=123&end_height=123&start_slot=123&end_slot=123")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "assets=%3Cstring%3E&accounts=%3Cstring%3E&start_time=2023-11-07T05%3A31%3A56Z&end_time=2023-11-07T05%3A31%3A56Z&start_height=123&end_height=123&start_slot=123&end_slot=123"
response = http.request(request)
puts response.read_body{
"job_id": "ZjRjZDE2N2EtYzljYy00MjQ5LTk4ZWYtOTlkZDljZTE1ZDU3OjgzNTZkODQyLTA5ODMtNGM2NC1hMGE5LWY5MzBhZTMxODFiZg",
"job_url": "https://api.coinmetrics.io/v4/jobs?api_key=<your_key>&ids=ZjRjZDE2N2EtYzljYy00MjQ5LTk4ZWYtOTlkZDljZTE1ZDU3OjgzNTZkODQyLTA5ODMtNGM2NC1hMGE5LWY5MzBhZTMxODFiZg"
}Balance updates
Creates asynchronous job for retrieving balance updates data. Both start_* and end_* parameters must be specified (time or height).
Use the /jobs endpoint to poll job’s status. The result file when downloaded will contain a newline-delimited JSON stream of BlockchainJobBalanceUpdate objects.
curl -X PUT --compressed "https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=<your_key>" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "assets=sol" \
--data-urlencode "accounts=account1,account2" \
--data-urlencode "start_time=2023-07-04T00:00:00.000000000Z" \
--data-urlencode "end_time=2024-07-04T00:00:00.000000000Z"import requests
data = {
"assets": "sol",
"accounts": "account1,account2",
"start_time": "2023-07-04T00:00:00.000000000Z",
"end_time": "2024-07-04T00:00:00.000000000Z"
}
response = requests.put('https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=<your_key>',data=data).json()
print(response)
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
assets: '<string>',
accounts: '<string>',
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
start_height: '123',
end_height: '123',
start_slot: '123',
end_slot: '123'
})
};
fetch('https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=', 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.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "assets=%3Cstring%3E&accounts=%3Cstring%3E&start_time=2023-11-07T05%3A31%3A56Z&end_time=2023-11-07T05%3A31%3A56Z&start_height=123&end_height=123&start_slot=123&end_slot=123",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key="
payload := strings.NewReader("assets=%3Cstring%3E&accounts=%3Cstring%3E&start_time=2023-11-07T05%3A31%3A56Z&end_time=2023-11-07T05%3A31%3A56Z&start_height=123&end_height=123&start_slot=123&end_slot=123")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("assets=%3Cstring%3E&accounts=%3Cstring%3E&start_time=2023-11-07T05%3A31%3A56Z&end_time=2023-11-07T05%3A31%3A56Z&start_height=123&end_height=123&start_slot=123&end_slot=123")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinmetrics.io/v4/blockchain-job/balance-updates?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "assets=%3Cstring%3E&accounts=%3Cstring%3E&start_time=2023-11-07T05%3A31%3A56Z&end_time=2023-11-07T05%3A31%3A56Z&start_height=123&end_height=123&start_slot=123&end_slot=123"
response = http.request(request)
puts response.read_body{
"job_id": "ZjRjZDE2N2EtYzljYy00MjQ5LTk4ZWYtOTlkZDljZTE1ZDU3OjgzNTZkODQyLTA5ODMtNGM2NC1hMGE5LWY5MzBhZTMxODFiZg",
"job_url": "https://api.coinmetrics.io/v4/jobs?api_key=<your_key>&ids=ZjRjZDE2N2EtYzljYy00MjQ5LTk4ZWYtOTlkZDljZTE1ZDU3OjgzNTZkODQyLTA5ODMtNGM2NC1hMGE5LWY5MzBhZTMxODFiZg"
}Authorizations
Body
Start of the time interval.
Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789Z, 2006-01-20, 20060120.
Inclusive by default. Mutually exclusive with start_height/end_height and start_slot/end_slot.
When specified, end_time parameter is mandatory.
UTC timezone by default. Z suffix is optional.
End of the time interval.
Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789Z, 2006-01-20, 20060120.
Inclusive by default. Mutually exclusive with start_height/end_height and start_slot/end_slot.
When specified, start_time parameter is mandatory.
UTC timezone by default. Z suffix is optional.
The start height indicates the beginning block height for the set of data that are returned.
Inclusive by default. Mutually exclusive with start_time/end_time and start_slot/end_slot.
When specified, end_height parameter is mandatory.
Not compatible with requests containing more than one asset.
The end height indicates the ending block height for the set of data that are returned.
Inclusive by default. Mutually exclusive with start_time/end_time and start_slot/end_slot.
When specified, start_height parameter is mandatory.
Not compatible with requests containing more than one asset.
The start slot indicates the beginning slot for the set of data that are returned.
Inclusive by default. Mutually exclusive with start_time/end_time and start_height/end_height.
When specified, end_slot parameter is mandatory.
Not compatible with requests containing more than one asset.
The end slot indicates the ending slot for the set of data that are returned.
Inclusive by default. Mutually exclusive with start_time/end_time and start_height/end_height.
When specified, start_slot parameter is mandatory.
Not compatible with requests containing more than one asset.

