curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate" \
-H "Authorization: Bearer $BLOCKDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
}'
#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURL *curl = curl_easy_init();
if (!curl) return 1;
const char *token = getenv("BLOCKDB_API_KEY");
char auth_header[256];
snprintf(auth_header, sizeof(auth_header), "Authorization: Bearer %s", token ? token : "");
const char *payload = "{\"chain_id\":1,\"base_token_address\":\"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"quote_token_address\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"from_block\":18930000,\"to_block\":18939999,\"bucket_seconds\":3600,\"dense\":false,\"limit\":200,\"cursor\":null}";
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, auth_header);
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return res == CURLE_OK ? 0 : 1;
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("BLOCKDB_API_KEY"));
var payload = new StringContent(
"{\"chain_id\":1,\"base_token_address\":\"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"quote_token_address\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"from_block\":18930000,\"to_block\":18939999,\"bucket_seconds\":3600,\"dense\":false,\"limit\":200,\"cursor\":null}",
Encoding.UTF8,
"application/json"
);
var response = await client.PostAsync("https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", payload);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
}
import os
import requests
response = requests.post(
"https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate",
headers={
"Authorization": f"Bearer {os.getenv('BLOCKDB_API_KEY')}",
"Content-Type": "application/json"
},
json={
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": False,
"limit": 200,
"cursor": None
}
)
data = response.json()
print(data)
const response = await fetch("https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.BLOCKDB_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
}`)
req, _ := http.NewRequest("POST", "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", payload)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", os.Getenv("BLOCKDB_API_KEY")))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
// Handle response
}
{
"meta": {
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"request_window": {
"from_block": 18930000,
"to_block": 18939999,
"from_timestamp": null,
"to_timestamp": null
},
"resolved_window": {
"from_block": 18930000,
"to_block": 18939999,
"from_timestamp": "2024-01-11T13:00:00Z",
"to_timestamp": "2024-01-12T22:00:00Z"
},
"filters": {
"bucket_seconds": 3600,
"dense": false
}
},
"data": [
{
"bucket_start": "2025-11-11T18:00:00.000Z",
"bucket_end": "2025-11-11T19:00:00.000Z",
"bucket_seconds": 3600,
"token_in": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_out": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"price_vwap": "3024.112233445566778899",
"total_volume_in_raw": "580000000000000000000",
"total_volume_in": "580.000000000000000000",
"total_volume_out_raw": "1750000000000",
"total_volume_out": "1750000.000000000000000000",
"trade_count": 142,
"pool_count": 23,
"block_bucket_first_block_number": null,
"block_bucket_last_block_number": null,
"block_bucket_first_block_timestamp": null,
"block_bucket_last_block_timestamp": null,
"block_bucket_block_count": null,
"_tracing_id": "0505000000000000000000000000000000000001",
"_parent_tracing_ids": null,
"_created_at": "2025-11-11T19:00:05.000Z",
"_updated_at": "2025-11-11T19:00:05.000Z"
}
],
"cursor": null,
"page_count": 1
}
{
"error": {
"code": "BAD_REQUEST",
"http_status": 400,
"message": "The request contains invalid or missing parameters.",
"hint": "Validate all required parameters against the endpoint specification before retrying.",
"severity": "error",
"retryable": false,
"details": {
"invalid_parameters": [
{
"name": "chain_id",
"location": "query",
"reason": "missing",
"expected": "positive integer, e.g. 1"
},
{
"name": "from_timestamp",
"location": "query",
"reason": "invalid_format",
"expected": "ISO-8601 UTC timestamp, e.g. 2025-11-11T00:00:00Z"
}
]
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/home"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"http_status": 401,
"message": "Invalid or missing API key.",
"hint": "Ensure you send 'Authorization: Bearer <API_KEY>' in every request to this endpoint.",
"severity": "error",
"retryable": false,
"details": {
"auth_scheme": "bearer",
"expected_header": "Authorization: Bearer <API_KEY>",
"provided_header": "Authorization: <REDACTED_OR_MISSING>",
"token_status": "invalid_or_missing",
"recommendation": "Regenerate the API key if you suspect it is expired or compromised."
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/authorization"
}
}
{
"error": {
"code": "FORBIDDEN",
"http_status": 403,
"message": "Your API key does not have permission to access this endpoint.",
"hint": "Upgrade your subscription tier or request additional access.",
"severity": "warning",
"retryable": false,
"details": {
"required_plan": "production",
"your_plan": null,
"contact": "support@blockdb.io",
"recommendation": "Contact BlockDB Support Team via email support@blockdb.io."
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "NOT_FOUND",
"http_status": 404,
"message": "The requested resource does not exist.",
"hint": "Verify the API endpoint",
"severity": "warning",
"retryable": false,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "PAYLOAD_TOO_LARGE",
"http_status": 413,
"message": "The requested response exceeds the maximum allowed size of 10 MB.",
"hint": "Reduce the limit, narrow the block or time window, or apply additional filters before retrying.",
"details": {
"max_allowed_bytes": 10485760,
"estimated_response_bytes": 15360000,
"recommended_actions": [
"Decrease the 'limit' parameter value",
"Shorten the block range or time window",
"Filter by fewer exchanges"
]
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/pagination-and-limits"
}
}
{
"error": {
"code": "CHAIN_NOT_SUPPORTED",
"http_status": 422,
"message": "chain_id=137 is not supported.",
"hint": "Use a supported chain_id. Consult the documentation for the list of available chains.",
"severity": "error",
"retryable": false,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"http_status": 429,
"message": "You have exceeded the allowed request rate.",
"hint": "Introduce client-side throttling or exponential backoff and respect the retry_after_seconds value.",
"details": {
"limit_rps": 1000,
"current_estimated_rps": 73,
"retry_after_seconds": 2,
"limit_scope": "api_key",
"limit_window_seconds": 1
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/rate-limiting"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"http_status": 500,
"message": "An unexpected server error occurred.",
"hint": "This error is not caused by your request. You may retry after a short delay.",
"severity": "critical",
"retryable": true,
"details": {
"incident_id": "INC-2025-11-11-123456",
"temporary_issue": true,
"expected_recovery_seconds": 5
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "SERVICE_UNAVAILABLE",
"http_status": 503,
"message": "The service is temporarily unable to handle the request.",
"hint": "The database connection pool is briefly saturated. Retry after a short delay.",
"severity": "warning",
"retryable": true,
"details": null,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
Pricing Suite - Crypto
Prices · Cross-Pool VWAP
Compute cross-pool (cross-venue) VWAP windows aggregated across all pools and exchanges.
POST
/
v1
/
evm
/
prices
/
spot
/
crypto
/
vwap-aggregate
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate" \
-H "Authorization: Bearer $BLOCKDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
}'
#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURL *curl = curl_easy_init();
if (!curl) return 1;
const char *token = getenv("BLOCKDB_API_KEY");
char auth_header[256];
snprintf(auth_header, sizeof(auth_header), "Authorization: Bearer %s", token ? token : "");
const char *payload = "{\"chain_id\":1,\"base_token_address\":\"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"quote_token_address\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"from_block\":18930000,\"to_block\":18939999,\"bucket_seconds\":3600,\"dense\":false,\"limit\":200,\"cursor\":null}";
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, auth_header);
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return res == CURLE_OK ? 0 : 1;
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("BLOCKDB_API_KEY"));
var payload = new StringContent(
"{\"chain_id\":1,\"base_token_address\":\"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"quote_token_address\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"from_block\":18930000,\"to_block\":18939999,\"bucket_seconds\":3600,\"dense\":false,\"limit\":200,\"cursor\":null}",
Encoding.UTF8,
"application/json"
);
var response = await client.PostAsync("https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", payload);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
}
import os
import requests
response = requests.post(
"https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate",
headers={
"Authorization": f"Bearer {os.getenv('BLOCKDB_API_KEY')}",
"Content-Type": "application/json"
},
json={
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": False,
"limit": 200,
"cursor": None
}
)
data = response.json()
print(data)
const response = await fetch("https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.BLOCKDB_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
}`)
req, _ := http.NewRequest("POST", "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", payload)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", os.Getenv("BLOCKDB_API_KEY")))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
// Handle response
}
{
"meta": {
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"request_window": {
"from_block": 18930000,
"to_block": 18939999,
"from_timestamp": null,
"to_timestamp": null
},
"resolved_window": {
"from_block": 18930000,
"to_block": 18939999,
"from_timestamp": "2024-01-11T13:00:00Z",
"to_timestamp": "2024-01-12T22:00:00Z"
},
"filters": {
"bucket_seconds": 3600,
"dense": false
}
},
"data": [
{
"bucket_start": "2025-11-11T18:00:00.000Z",
"bucket_end": "2025-11-11T19:00:00.000Z",
"bucket_seconds": 3600,
"token_in": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_out": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"price_vwap": "3024.112233445566778899",
"total_volume_in_raw": "580000000000000000000",
"total_volume_in": "580.000000000000000000",
"total_volume_out_raw": "1750000000000",
"total_volume_out": "1750000.000000000000000000",
"trade_count": 142,
"pool_count": 23,
"block_bucket_first_block_number": null,
"block_bucket_last_block_number": null,
"block_bucket_first_block_timestamp": null,
"block_bucket_last_block_timestamp": null,
"block_bucket_block_count": null,
"_tracing_id": "0505000000000000000000000000000000000001",
"_parent_tracing_ids": null,
"_created_at": "2025-11-11T19:00:05.000Z",
"_updated_at": "2025-11-11T19:00:05.000Z"
}
],
"cursor": null,
"page_count": 1
}
{
"error": {
"code": "BAD_REQUEST",
"http_status": 400,
"message": "The request contains invalid or missing parameters.",
"hint": "Validate all required parameters against the endpoint specification before retrying.",
"severity": "error",
"retryable": false,
"details": {
"invalid_parameters": [
{
"name": "chain_id",
"location": "query",
"reason": "missing",
"expected": "positive integer, e.g. 1"
},
{
"name": "from_timestamp",
"location": "query",
"reason": "invalid_format",
"expected": "ISO-8601 UTC timestamp, e.g. 2025-11-11T00:00:00Z"
}
]
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/home"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"http_status": 401,
"message": "Invalid or missing API key.",
"hint": "Ensure you send 'Authorization: Bearer <API_KEY>' in every request to this endpoint.",
"severity": "error",
"retryable": false,
"details": {
"auth_scheme": "bearer",
"expected_header": "Authorization: Bearer <API_KEY>",
"provided_header": "Authorization: <REDACTED_OR_MISSING>",
"token_status": "invalid_or_missing",
"recommendation": "Regenerate the API key if you suspect it is expired or compromised."
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/authorization"
}
}
{
"error": {
"code": "FORBIDDEN",
"http_status": 403,
"message": "Your API key does not have permission to access this endpoint.",
"hint": "Upgrade your subscription tier or request additional access.",
"severity": "warning",
"retryable": false,
"details": {
"required_plan": "production",
"your_plan": null,
"contact": "support@blockdb.io",
"recommendation": "Contact BlockDB Support Team via email support@blockdb.io."
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "NOT_FOUND",
"http_status": 404,
"message": "The requested resource does not exist.",
"hint": "Verify the API endpoint",
"severity": "warning",
"retryable": false,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "PAYLOAD_TOO_LARGE",
"http_status": 413,
"message": "The requested response exceeds the maximum allowed size of 10 MB.",
"hint": "Reduce the limit, narrow the block or time window, or apply additional filters before retrying.",
"details": {
"max_allowed_bytes": 10485760,
"estimated_response_bytes": 15360000,
"recommended_actions": [
"Decrease the 'limit' parameter value",
"Shorten the block range or time window",
"Filter by fewer exchanges"
]
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/pagination-and-limits"
}
}
{
"error": {
"code": "CHAIN_NOT_SUPPORTED",
"http_status": 422,
"message": "chain_id=137 is not supported.",
"hint": "Use a supported chain_id. Consult the documentation for the list of available chains.",
"severity": "error",
"retryable": false,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"http_status": 429,
"message": "You have exceeded the allowed request rate.",
"hint": "Introduce client-side throttling or exponential backoff and respect the retry_after_seconds value.",
"details": {
"limit_rps": 1000,
"current_estimated_rps": 73,
"retry_after_seconds": 2,
"limit_scope": "api_key",
"limit_window_seconds": 1
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/rate-limiting"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"http_status": 500,
"message": "An unexpected server error occurred.",
"hint": "This error is not caused by your request. You may retry after a short delay.",
"severity": "critical",
"retryable": true,
"details": {
"incident_id": "INC-2025-11-11-123456",
"temporary_issue": true,
"expected_recovery_seconds": 5
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "SERVICE_UNAVAILABLE",
"http_status": 503,
"message": "The service is temporarily unable to handle the request.",
"hint": "The database connection pool is briefly saturated. Retry after a short delay.",
"severity": "warning",
"retryable": true,
"details": null,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
Overview
- Dataset ID:
0505 - Token-to-Token Cross-Pool VWAP - Description: Cross-venue VWAP bars (1m..1d) per token pair direction, aggregated from per-pool VWAP (
0405) across all pools and exchanges. - CSV Sample: Download
- JSON Sample: Download
Parameters
ERC-20 contract address for the base asset (hex string, 20 bytes, no
0x prefix).ERC-20 contract address for the quote asset (hex string, 20 bytes, no
0x prefix).Range Filters (mutually exclusive)
Starting block (inclusive). Block ranges use strict containment: only buckets whose entire span maps to blocks within
[from_block, to_block] are returned, so each bar aggregates only blocks inside your range. The partial bucket that merely contains from_block (and also spans earlier blocks) is excluded. A range narrower than one bucket_seconds returns no bars. Use with to_block.Ending block (inclusive). The partial bucket that contains
to_block (and also spans later blocks) is excluded — only buckets ending at or before to_block’s timestamp are returned. Use with from_block.Window start (ISO-8601, inclusive). Used directly as
bucket_start >= from_timestamp. Use with to_timestamp.Window end (ISO-8601, inclusive). Buckets with
bucket_end <= to_timestamp are included. Use with from_timestamp.Provide either a block range (
from_block + to_block) or a time range (from_timestamp + to_timestamp), not both. Omitting both is HTTP 400.Bucket Controls
Bucket width in seconds. Allowed values:
60, 300, 900, 1800, 3600, 14400, 86400.Gap-fill: one row per bucket in the requested window. Gap buckets LOCF the last
price_vwap, with zero volumes, trade_count=0, and pool_count=0.LOCF seeds from the last cross-pool bar before the window start when available, then from in-window bars (same 0505 table).Works with a timestamp or block range (blocks resolve to timestamps, then align to bucket boundaries).Pagination Controls
Recommended default
250; maximum 1000 to stay under ~10 MB responses.Opaque pagination cursor supplied by a previous response.
Response Fields
Meta
Echo of request metadata applied to the response.
EVM chain ID echoed from the request.
ERC-20 contract address of the base asset, echoed from the request.
ERC-20 contract address of the quote asset, echoed from the request.
Pure echo of the window you sent (
from_block/to_block/from_timestamp/to_timestamp); unset bounds are null.The concrete window the query actually executed against, after resolving the request. For a block range on a time-bucketed endpoint (OHLC/VWAP/VWAP-aggregate/fiat VWAP),
from_timestamp/to_timestamp hold the resolved timestamp window (and from_block/to_block echo your request). For a time range on a block-keyed endpoint, from_block/to_block hold the resolved block range (and the timestamps echo your request). null for selector-only requests (no window). No extra database work is done — these are the values the query already computed.Resolved/echoed start block of the executed window.
Resolved/echoed end block of the executed window.
Resolved/echoed start timestamp (ISO-8601) of the executed window.
Resolved/echoed end timestamp (ISO-8601) of the executed window.
Filter parameters echoed from the request.
Data
Cross-pool VWAP aggregates matching the request; each object uses the same field names as
0505.Inclusive UTC start of the VWAP bucket (ISO-8601).
Exclusive UTC end of the VWAP bucket (ISO-8601). Equal to
bucket_start + bucket_seconds.Bucket width in seconds:
60, 300, 900, 1800, 3600, 14400, or 86400.Input token address (hex, 20 bytes, no
0x prefix).Output token address (hex, 20 bytes, no
0x prefix).Cross-venue VWAP (
quote_token_address per 1 base_token_address, decimals-adjusted). null only when no prior bar exists for this pair and bucket_seconds before the window ends. In dense mode, gap buckets LOCF the last price (including pre-window bars).Sum of raw UInt256
amountIn values across all contributing pools. "0" for carry-forward buckets in dense mode.Decimal-adjusted
token_in volume. null when token decimals are unknown. "0" for carry-forward buckets in dense mode when decimals are known.Sum of raw UInt256
amountOut values across all contributing pools. "0" for carry-forward buckets in dense mode.Decimal-adjusted
token_out volume. null when token decimals are unknown. "0" for carry-forward buckets in dense mode when decimals are known.Total swaps across all contributing pools.
0 for carry-forward buckets in dense mode.Distinct pools that contributed to the bucket.
0 for carry-forward buckets in dense mode.First block number in the chain-wide bucket. Populated when
dense=true; null in sparse mode.Last block number in the chain-wide bucket. Populated when
dense=true; null in sparse mode.Timestamp of the first block in the chain-wide bucket (ISO-8601). Populated when
dense=true; null in sparse mode.Timestamp of the last block in the chain-wide bucket (ISO-8601). Populated when
dense=true; null in sparse mode.Block count in the chain-wide bucket. Populated when
dense=true; null in sparse mode.BlockDB tracing ID (hex, no
0x prefix). null for synthetic gap-fill rows when dense=true.Tracing IDs of contributing per-pool VWAP (
0405) bars; optional. null for gap-fill rows and by default.Record creation timestamp (ISO-8601).
null for gap-fill rows.Record update timestamp (ISO-8601).
null for gap-fill rows.Envelope Fields
Pagination cursor.
Number of VWAP entries returned in this page.
Usage Notes
- For per-pool VWAP, use
POST /evm/prices/spot/crypto/vwap(0405). - For USD VWAP buckets, use
POST /evm/prices/spot/fiat/vwap(0605). dense=trueworks with a timestamp or block range.- Responses are read from the pre-aggregated cross-pool dataset (
0505).
curl -X POST "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate" \
-H "Authorization: Bearer $BLOCKDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
}'
#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
CURL *curl = curl_easy_init();
if (!curl) return 1;
const char *token = getenv("BLOCKDB_API_KEY");
char auth_header[256];
snprintf(auth_header, sizeof(auth_header), "Authorization: Bearer %s", token ? token : "");
const char *payload = "{\"chain_id\":1,\"base_token_address\":\"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"quote_token_address\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"from_block\":18930000,\"to_block\":18939999,\"bucket_seconds\":3600,\"dense\":false,\"limit\":200,\"cursor\":null}";
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, auth_header);
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return res == CURLE_OK ? 0 : 1;
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("BLOCKDB_API_KEY"));
var payload = new StringContent(
"{\"chain_id\":1,\"base_token_address\":\"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\"quote_token_address\":\"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\"from_block\":18930000,\"to_block\":18939999,\"bucket_seconds\":3600,\"dense\":false,\"limit\":200,\"cursor\":null}",
Encoding.UTF8,
"application/json"
);
var response = await client.PostAsync("https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", payload);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
}
import os
import requests
response = requests.post(
"https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate",
headers={
"Authorization": f"Bearer {os.getenv('BLOCKDB_API_KEY')}",
"Content-Type": "application/json"
},
json={
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": False,
"limit": 200,
"cursor": None
}
)
data = response.json()
print(data)
const response = await fetch("https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.BLOCKDB_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"from_block": 18930000,
"to_block": 18939999,
"bucket_seconds": 3600,
"dense": false,
"limit": 200,
"cursor": null
}`)
req, _ := http.NewRequest("POST", "https://api.blockdb.io/v1/evm/prices/spot/crypto/vwap-aggregate", payload)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", os.Getenv("BLOCKDB_API_KEY")))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
// Handle response
}
{
"meta": {
"chain_id": 1,
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"request_window": {
"from_block": 18930000,
"to_block": 18939999,
"from_timestamp": null,
"to_timestamp": null
},
"resolved_window": {
"from_block": 18930000,
"to_block": 18939999,
"from_timestamp": "2024-01-11T13:00:00Z",
"to_timestamp": "2024-01-12T22:00:00Z"
},
"filters": {
"bucket_seconds": 3600,
"dense": false
}
},
"data": [
{
"bucket_start": "2025-11-11T18:00:00.000Z",
"bucket_end": "2025-11-11T19:00:00.000Z",
"bucket_seconds": 3600,
"token_in": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_out": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"price_vwap": "3024.112233445566778899",
"total_volume_in_raw": "580000000000000000000",
"total_volume_in": "580.000000000000000000",
"total_volume_out_raw": "1750000000000",
"total_volume_out": "1750000.000000000000000000",
"trade_count": 142,
"pool_count": 23,
"block_bucket_first_block_number": null,
"block_bucket_last_block_number": null,
"block_bucket_first_block_timestamp": null,
"block_bucket_last_block_timestamp": null,
"block_bucket_block_count": null,
"_tracing_id": "0505000000000000000000000000000000000001",
"_parent_tracing_ids": null,
"_created_at": "2025-11-11T19:00:05.000Z",
"_updated_at": "2025-11-11T19:00:05.000Z"
}
],
"cursor": null,
"page_count": 1
}
{
"error": {
"code": "BAD_REQUEST",
"http_status": 400,
"message": "The request contains invalid or missing parameters.",
"hint": "Validate all required parameters against the endpoint specification before retrying.",
"severity": "error",
"retryable": false,
"details": {
"invalid_parameters": [
{
"name": "chain_id",
"location": "query",
"reason": "missing",
"expected": "positive integer, e.g. 1"
},
{
"name": "from_timestamp",
"location": "query",
"reason": "invalid_format",
"expected": "ISO-8601 UTC timestamp, e.g. 2025-11-11T00:00:00Z"
}
]
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/home"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"http_status": 401,
"message": "Invalid or missing API key.",
"hint": "Ensure you send 'Authorization: Bearer <API_KEY>' in every request to this endpoint.",
"severity": "error",
"retryable": false,
"details": {
"auth_scheme": "bearer",
"expected_header": "Authorization: Bearer <API_KEY>",
"provided_header": "Authorization: <REDACTED_OR_MISSING>",
"token_status": "invalid_or_missing",
"recommendation": "Regenerate the API key if you suspect it is expired or compromised."
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/authorization"
}
}
{
"error": {
"code": "FORBIDDEN",
"http_status": 403,
"message": "Your API key does not have permission to access this endpoint.",
"hint": "Upgrade your subscription tier or request additional access.",
"severity": "warning",
"retryable": false,
"details": {
"required_plan": "production",
"your_plan": null,
"contact": "support@blockdb.io",
"recommendation": "Contact BlockDB Support Team via email support@blockdb.io."
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "NOT_FOUND",
"http_status": 404,
"message": "The requested resource does not exist.",
"hint": "Verify the API endpoint",
"severity": "warning",
"retryable": false,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "PAYLOAD_TOO_LARGE",
"http_status": 413,
"message": "The requested response exceeds the maximum allowed size of 10 MB.",
"hint": "Reduce the limit, narrow the block or time window, or apply additional filters before retrying.",
"details": {
"max_allowed_bytes": 10485760,
"estimated_response_bytes": 15360000,
"recommended_actions": [
"Decrease the 'limit' parameter value",
"Shorten the block range or time window",
"Filter by fewer exchanges"
]
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/pagination-and-limits"
}
}
{
"error": {
"code": "CHAIN_NOT_SUPPORTED",
"http_status": 422,
"message": "chain_id=137 is not supported.",
"hint": "Use a supported chain_id. Consult the documentation for the list of available chains.",
"severity": "error",
"retryable": false,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"http_status": 429,
"message": "You have exceeded the allowed request rate.",
"hint": "Introduce client-side throttling or exponential backoff and respect the retry_after_seconds value.",
"details": {
"limit_rps": 1000,
"current_estimated_rps": 73,
"retry_after_seconds": 2,
"limit_scope": "api_key",
"limit_window_seconds": 1
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/rate-limiting"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"http_status": 500,
"message": "An unexpected server error occurred.",
"hint": "This error is not caused by your request. You may retry after a short delay.",
"severity": "critical",
"retryable": true,
"details": {
"incident_id": "INC-2025-11-11-123456",
"temporary_issue": true,
"expected_recovery_seconds": 5
},
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
{
"error": {
"code": "SERVICE_UNAVAILABLE",
"http_status": 503,
"message": "The service is temporarily unable to handle the request.",
"hint": "The database connection pool is briefly saturated. Retry after a short delay.",
"severity": "warning",
"retryable": true,
"details": null,
"docs_url": "https://docs.blockdb.io/api-reference/overview/error-codes"
}
}
Last modified on July 6, 2026
Was this page helpful?
⌘I