Shell
curl -X PUT --compressed "https://api.coinmetrics.io/v4/blockchain-job/account-balances?api_key=<your_key>" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "assets=sol" \
--data-urlencode "accounts=account1,account2" \
--data-urlencode "at_time=2024-07-04T00:00:00.000000000Z"import requests
data = {
"assets": "sol",
"accounts": "account1,account2",
"at_time": "2024-07-04T00:00:00.000000000Z"
}
response = requests.put('https://api.coinmetrics.io/v4/blockchain-job/account-balances?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>',
at_time: '2023-11-07T05:31:56Z',
at_slot: '123',
at_height: '123'
})
};
fetch('https://api.coinmetrics.io/v4/blockchain-job/account-balances?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/account-balances?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&at_time=2023-11-07T05%3A31%3A56Z&at_slot=123&at_height=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/account-balances?api_key="
payload := strings.NewReader("assets=%3Cstring%3E&accounts=%3Cstring%3E&at_time=2023-11-07T05%3A31%3A56Z&at_slot=123&at_height=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/account-balances?api_key=")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("assets=%3Cstring%3E&accounts=%3Cstring%3E&at_time=2023-11-07T05%3A31%3A56Z&at_slot=123&at_height=123")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinmetrics.io/v4/blockchain-job/account-balances?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&at_time=2023-11-07T05%3A31%3A56Z&at_slot=123&at_height=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"
}Blockchain Explorer Job
Account balances
Creates asynchronous job for retrieving account balances data.
Use the /jobs endpoint to poll job’s status. The result file when downloaded will contain a newline-delimited JSON stream of BlockchainJobAccountBalance objects.
PUT
/
blockchain-job
/
account-balances
Shell
curl -X PUT --compressed "https://api.coinmetrics.io/v4/blockchain-job/account-balances?api_key=<your_key>" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "assets=sol" \
--data-urlencode "accounts=account1,account2" \
--data-urlencode "at_time=2024-07-04T00:00:00.000000000Z"import requests
data = {
"assets": "sol",
"accounts": "account1,account2",
"at_time": "2024-07-04T00:00:00.000000000Z"
}
response = requests.put('https://api.coinmetrics.io/v4/blockchain-job/account-balances?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>',
at_time: '2023-11-07T05:31:56Z',
at_slot: '123',
at_height: '123'
})
};
fetch('https://api.coinmetrics.io/v4/blockchain-job/account-balances?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/account-balances?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&at_time=2023-11-07T05%3A31%3A56Z&at_slot=123&at_height=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/account-balances?api_key="
payload := strings.NewReader("assets=%3Cstring%3E&accounts=%3Cstring%3E&at_time=2023-11-07T05%3A31%3A56Z&at_slot=123&at_height=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/account-balances?api_key=")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("assets=%3Cstring%3E&accounts=%3Cstring%3E&at_time=2023-11-07T05%3A31%3A56Z&at_slot=123&at_height=123")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinmetrics.io/v4/blockchain-job/account-balances?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&at_time=2023-11-07T05%3A31%3A56Z&at_slot=123&at_height=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
application/x-www-form-urlencoded
Indicates the point in time for which the set of account balances will be returned.
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.
UTC timezone by default. Z suffix is optional.
Mutually exclusive with at_height and at_slot.
Specifying either at_time or at_height / at_slot parameter is mandatory.

