Data API
Query chart data
Prepare chart rows with runtime variables or filters.
POST
/
api
/
v1
/
projects
/
{project_id}
/
charts
/
{chart_id}
/
data
Query chart data
curl --request POST \
--url https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variables": {
"region": "APAC"
},
"filters": [
{
"type": "date",
"startDate": "2026-08-01",
"endDate": "2026-08-31",
"scope": "chart"
}
],
"refresh": false
}
'import requests
url = "https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data"
payload = {
"variables": { "region": "APAC" },
"filters": [
{
"type": "date",
"startDate": "2026-08-01",
"endDate": "2026-08-31",
"scope": "chart"
}
],
"refresh": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
variables: {region: 'APAC'},
filters: [{type: 'date', startDate: '2026-08-01', endDate: '2026-08-31', scope: 'chart'}],
refresh: false
})
};
fetch('https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data', 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.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variables' => [
'region' => 'APAC'
],
'filters' => [
[
'type' => 'date',
'startDate' => '2026-08-01',
'endDate' => '2026-08-31',
'scope' => 'chart'
]
],
'refresh' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data"
payload := strings.NewReader("{\n \"variables\": {\n \"region\": \"APAC\"\n },\n \"filters\": [\n {\n \"type\": \"date\",\n \"startDate\": \"2026-08-01\",\n \"endDate\": \"2026-08-31\",\n \"scope\": \"chart\"\n }\n ],\n \"refresh\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variables\": {\n \"region\": \"APAC\"\n },\n \"filters\": [\n {\n \"type\": \"date\",\n \"startDate\": \"2026-08-01\",\n \"endDate\": \"2026-08-31\",\n \"scope\": \"chart\"\n }\n ],\n \"refresh\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variables\": {\n \"region\": \"APAC\"\n },\n \"filters\": [\n {\n \"type\": \"date\",\n \"startDate\": \"2026-08-01\",\n \"endDate\": \"2026-08-31\",\n \"scope\": \"chart\"\n }\n ],\n \"refresh\": false\n}"
response = http.request(request)
puts response.read_body{
"version": 1,
"frameVersion": 1,
"identityVersion": 1,
"generatedAt": "2026-08-25T08:00:00.000Z",
"resource": {
"kind": "chart",
"id": 81
},
"results": [
{
"id": "revenue",
"mark": "line",
"name": "Revenue",
"fields": [
{
"key": "time",
"type": "temporal",
"role": "dimension",
"sourceField": "root[].createdAt"
},
{
"key": "value",
"type": "quantitative",
"role": "measure",
"sourceField": "root[].revenue"
}
],
"series": [
{
"id": "series-ec3bc4d7d9f66b02",
"label": "Pro"
}
],
"availableSeries": [
{
"id": "series-ec3bc4d7d9f66b02",
"label": "Pro"
}
],
"rows": [
{
"time": "2026-08-01T00:00:00.000Z",
"value": 21400,
"seriesId": "series-ec3bc4d7d9f66b02"
}
],
"stats": {},
"warnings": []
}
],
"stats": {},
"warnings": []
}Use this route for chart field filters, date filters, variables, or
refresh: true. The response
uses the same PreparedData contract as the default chart route.
Variables, date filters, forced refresh filters, and source refreshes require the Refresh data
from sources key permission.Authorizations
Path Parameters
Body
application/json
Response
Prepared chart data. A GET can return a stale saved result while a refresh runs.
⌘I
Query chart data
curl --request POST \
--url https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variables": {
"region": "APAC"
},
"filters": [
{
"type": "date",
"startDate": "2026-08-01",
"endDate": "2026-08-31",
"scope": "chart"
}
],
"refresh": false
}
'import requests
url = "https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data"
payload = {
"variables": { "region": "APAC" },
"filters": [
{
"type": "date",
"startDate": "2026-08-01",
"endDate": "2026-08-31",
"scope": "chart"
}
],
"refresh": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
variables: {region: 'APAC'},
filters: [{type: 'date', startDate: '2026-08-01', endDate: '2026-08-31', scope: 'chart'}],
refresh: false
})
};
fetch('https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data', 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.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variables' => [
'region' => 'APAC'
],
'filters' => [
[
'type' => 'date',
'startDate' => '2026-08-01',
'endDate' => '2026-08-31',
'scope' => 'chart'
]
],
'refresh' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data"
payload := strings.NewReader("{\n \"variables\": {\n \"region\": \"APAC\"\n },\n \"filters\": [\n {\n \"type\": \"date\",\n \"startDate\": \"2026-08-01\",\n \"endDate\": \"2026-08-31\",\n \"scope\": \"chart\"\n }\n ],\n \"refresh\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variables\": {\n \"region\": \"APAC\"\n },\n \"filters\": [\n {\n \"type\": \"date\",\n \"startDate\": \"2026-08-01\",\n \"endDate\": \"2026-08-31\",\n \"scope\": \"chart\"\n }\n ],\n \"refresh\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/api/v1/projects/{project_id}/charts/{chart_id}/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variables\": {\n \"region\": \"APAC\"\n },\n \"filters\": [\n {\n \"type\": \"date\",\n \"startDate\": \"2026-08-01\",\n \"endDate\": \"2026-08-31\",\n \"scope\": \"chart\"\n }\n ],\n \"refresh\": false\n}"
response = http.request(request)
puts response.read_body{
"version": 1,
"frameVersion": 1,
"identityVersion": 1,
"generatedAt": "2026-08-25T08:00:00.000Z",
"resource": {
"kind": "chart",
"id": 81
},
"results": [
{
"id": "revenue",
"mark": "line",
"name": "Revenue",
"fields": [
{
"key": "time",
"type": "temporal",
"role": "dimension",
"sourceField": "root[].createdAt"
},
{
"key": "value",
"type": "quantitative",
"role": "measure",
"sourceField": "root[].revenue"
}
],
"series": [
{
"id": "series-ec3bc4d7d9f66b02",
"label": "Pro"
}
],
"availableSeries": [
{
"id": "series-ec3bc4d7d9f66b02",
"label": "Pro"
}
],
"rows": [
{
"time": "2026-08-01T00:00:00.000Z",
"value": 21400,
"seriesId": "series-ec3bc4d7d9f66b02"
}
],
"stats": {},
"warnings": []
}
],
"stats": {},
"warnings": []
}