Fetch live widget data
Fetch live data for one or more widgets in a report. Pass an optional list of widget_ids to fetch a subset; leave widget_ids empty to fetch data for every widget in the report. An optional date range override (date_start / date_end) takes precedence over the report’s configured date range for this request only. The response is a dict keyed by widget UUID string, where each value is the resolved data payload for that widget.
curl --request POST \
--url https://api.example.com/v1/projects/{project_id}/reports/{report_id}/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"widget_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"date_start": "2023-12-25",
"date_end": "2023-12-25",
"widgets": [
{
"id": "<string>",
"widget_type": "<string>",
"data_source": "<string>",
"config": {}
}
]
}
'import requests
url = "https://api.example.com/v1/projects/{project_id}/reports/{report_id}/data"
payload = {
"widget_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"date_start": "2023-12-25",
"date_end": "2023-12-25",
"widgets": [
{
"id": "<string>",
"widget_type": "<string>",
"data_source": "<string>",
"config": {}
}
]
}
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({
widget_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
date_start: '2023-12-25',
date_end: '2023-12-25',
widgets: [{id: '<string>', widget_type: '<string>', data_source: '<string>', config: {}}]
})
};
fetch('https://api.example.com/v1/projects/{project_id}/reports/{report_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.example.com/v1/projects/{project_id}/reports/{report_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([
'widget_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'date_start' => '2023-12-25',
'date_end' => '2023-12-25',
'widgets' => [
[
'id' => '<string>',
'widget_type' => '<string>',
'data_source' => '<string>',
'config' => [
]
]
]
]),
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.example.com/v1/projects/{project_id}/reports/{report_id}/data"
payload := strings.NewReader("{\n \"widget_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"date_start\": \"2023-12-25\",\n \"date_end\": \"2023-12-25\",\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"widget_type\": \"<string>\",\n \"data_source\": \"<string>\",\n \"config\": {}\n }\n ]\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.example.com/v1/projects/{project_id}/reports/{report_id}/data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"widget_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"date_start\": \"2023-12-25\",\n \"date_end\": \"2023-12-25\",\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"widget_type\": \"<string>\",\n \"data_source\": \"<string>\",\n \"config\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_id}/reports/{report_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 \"widget_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"date_start\": \"2023-12-25\",\n \"date_end\": \"2023-12-25\",\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"widget_type\": \"<string>\",\n \"data_source\": \"<string>\",\n \"config\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
Request body for fetching live data for one or more widgets.
UUIDs of the widgets to fetch data for. If empty, data is fetched for all widgets on the page.
Override start date for data fetching. Falls back to the report's configured date range when null.
Override end date for data fetching. Falls back to the report's configured date range when null.
When provided, the API uses these widget definitions directly instead of loading from the database. This allows fetching data for unsaved widgets in the editor.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.example.com/v1/projects/{project_id}/reports/{report_id}/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"widget_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"date_start": "2023-12-25",
"date_end": "2023-12-25",
"widgets": [
{
"id": "<string>",
"widget_type": "<string>",
"data_source": "<string>",
"config": {}
}
]
}
'import requests
url = "https://api.example.com/v1/projects/{project_id}/reports/{report_id}/data"
payload = {
"widget_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"date_start": "2023-12-25",
"date_end": "2023-12-25",
"widgets": [
{
"id": "<string>",
"widget_type": "<string>",
"data_source": "<string>",
"config": {}
}
]
}
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({
widget_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
date_start: '2023-12-25',
date_end: '2023-12-25',
widgets: [{id: '<string>', widget_type: '<string>', data_source: '<string>', config: {}}]
})
};
fetch('https://api.example.com/v1/projects/{project_id}/reports/{report_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.example.com/v1/projects/{project_id}/reports/{report_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([
'widget_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'date_start' => '2023-12-25',
'date_end' => '2023-12-25',
'widgets' => [
[
'id' => '<string>',
'widget_type' => '<string>',
'data_source' => '<string>',
'config' => [
]
]
]
]),
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.example.com/v1/projects/{project_id}/reports/{report_id}/data"
payload := strings.NewReader("{\n \"widget_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"date_start\": \"2023-12-25\",\n \"date_end\": \"2023-12-25\",\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"widget_type\": \"<string>\",\n \"data_source\": \"<string>\",\n \"config\": {}\n }\n ]\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.example.com/v1/projects/{project_id}/reports/{report_id}/data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"widget_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"date_start\": \"2023-12-25\",\n \"date_end\": \"2023-12-25\",\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"widget_type\": \"<string>\",\n \"data_source\": \"<string>\",\n \"config\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/projects/{project_id}/reports/{report_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 \"widget_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"date_start\": \"2023-12-25\",\n \"date_end\": \"2023-12-25\",\n \"widgets\": [\n {\n \"id\": \"<string>\",\n \"widget_type\": \"<string>\",\n \"data_source\": \"<string>\",\n \"config\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}