List Wholesale Credit Balances
curl --request GET \
--url https://api.blockworks.com/query/tabular/wholesale-credit-balances \
--header 'X-Blockworks-API-Key: <api-key>'import requests
url = "https://api.blockworks.com/query/tabular/wholesale-credit-balances"
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/tabular/wholesale-credit-balances', 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/tabular/wholesale-credit-balances",
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/tabular/wholesale-credit-balances"
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/tabular/wholesale-credit-balances")
.header("X-Blockworks-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blockworks.com/query/tabular/wholesale-credit-balances")
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": [
{
"balanceSubtype": "<balanceSubtype>",
"balanceType": "<balanceType>",
"chain": "<chain>",
"creditLineID": "<creditLineID>",
"creditLineName": "<creditLineName>",
"id": "<id>",
"name": "<name>",
"networkID": "<networkID>",
"parentSlug": "<parentSlug>",
"productSlug": "<productSlug>",
"projectID": "<projectID>",
"protocolName": "<protocolName>",
"protocolSlug": "<protocolSlug>",
"slug": "<slug>",
"tokenAddress": "<tokenAddress>",
"tokenSymbol": "<tokenSymbol>"
}
],
"error": null,
"metadata": {
"totalPages": 1,
"totalRows": 1
}
}{
"data": null,
"error": "unknown query parameter \"id\": column \"id\" is filtered by \"idEq\", \"idIsOneOf\""
}{
"data": null,
"error": "this model requires authentication"
}{
"data": null,
"error": "You are out of credits (balance 0). Do not retry this request. Visit https://app.blockworks.com/account/api to see balance and get more credits."
}{
"data": null,
"error": "this model requires the \"lending-protocols-dataset\" permission; see https://app.blockworks.com/account/api for the public API permissions you hold"
}{
"data": null,
"error": "tabular model \"unknown-model\" not found"
}{
"data": null,
"error": "the credit service is temporarily unavailable and this request was refused without charge; retry in a moment"
}Wholesale Credit Balances
List Wholesale Credit Balances
One row per wholesale credit balance, keyed by protocol, chain, credit line, token, balance type and balance subtype: the parent protocol and product, chain, token and the mapped protocol, project and network records. The id is the series key of the wholesale-credit-balances timeseries model.
GET
/
query
/
tabular
/
wholesale-credit-balances
List Wholesale Credit Balances
curl --request GET \
--url https://api.blockworks.com/query/tabular/wholesale-credit-balances \
--header 'X-Blockworks-API-Key: <api-key>'import requests
url = "https://api.blockworks.com/query/tabular/wholesale-credit-balances"
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/tabular/wholesale-credit-balances', 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/tabular/wholesale-credit-balances",
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/tabular/wholesale-credit-balances"
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/tabular/wholesale-credit-balances")
.header("X-Blockworks-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blockworks.com/query/tabular/wholesale-credit-balances")
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": [
{
"balanceSubtype": "<balanceSubtype>",
"balanceType": "<balanceType>",
"chain": "<chain>",
"creditLineID": "<creditLineID>",
"creditLineName": "<creditLineName>",
"id": "<id>",
"name": "<name>",
"networkID": "<networkID>",
"parentSlug": "<parentSlug>",
"productSlug": "<productSlug>",
"projectID": "<projectID>",
"protocolName": "<protocolName>",
"protocolSlug": "<protocolSlug>",
"slug": "<slug>",
"tokenAddress": "<tokenAddress>",
"tokenSymbol": "<tokenSymbol>"
}
],
"error": null,
"metadata": {
"totalPages": 1,
"totalRows": 1
}
}{
"data": null,
"error": "unknown query parameter \"id\": column \"id\" is filtered by \"idEq\", \"idIsOneOf\""
}{
"data": null,
"error": "this model requires authentication"
}{
"data": null,
"error": "You are out of credits (balance 0). Do not retry this request. Visit https://app.blockworks.com/account/api to see balance and get more credits."
}{
"data": null,
"error": "this model requires the \"lending-protocols-dataset\" permission; see https://app.blockworks.com/account/api for the public API permissions you hold"
}{
"data": null,
"error": "tabular model \"unknown-model\" not found"
}{
"data": null,
"error": "the credit service is temporarily unavailable and this request was refused without charge; retry in a moment"
}