curl --request POST \
--url https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"date_range": {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"timezone": "<string>"
},
"query": {
"kind": "time_series",
"measures": [
{
"metric": "<string>",
"id": "<string>"
}
],
"bucket": {
"max_points": 2
},
"split_by": "<string>",
"split_ranking": {
"limit": 2,
"include_other": true
}
},
"filters": [
{
"field": "<string>",
"value": "<string>"
}
],
"product_filters": {
"experiment_run_id": "<string>",
"only_experiments": true
}
}
'import requests
url = "https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query"
payload = {
"date_range": {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"timezone": "<string>"
},
"query": {
"kind": "time_series",
"measures": [
{
"metric": "<string>",
"id": "<string>"
}
],
"bucket": { "max_points": 2 },
"split_by": "<string>",
"split_ranking": {
"limit": 2,
"include_other": True
}
},
"filters": [
{
"field": "<string>",
"value": "<string>"
}
],
"product_filters": {
"experiment_run_id": "<string>",
"only_experiments": True
}
}
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({
date_range: {
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
timezone: '<string>'
},
query: {
kind: 'time_series',
measures: [{metric: '<string>', id: '<string>'}],
bucket: {max_points: 2},
split_by: '<string>',
split_ranking: {limit: 2, include_other: true}
},
filters: [{field: '<string>', value: '<string>'}],
product_filters: {experiment_run_id: '<string>', only_experiments: true}
})
};
fetch('https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query', 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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query",
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([
'date_range' => [
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'timezone' => '<string>'
],
'query' => [
'kind' => 'time_series',
'measures' => [
[
'metric' => '<string>',
'id' => '<string>'
]
],
'bucket' => [
'max_points' => 2
],
'split_by' => '<string>',
'split_ranking' => [
'limit' => 2,
'include_other' => true
]
],
'filters' => [
[
'field' => '<string>',
'value' => '<string>'
]
],
'product_filters' => [
'experiment_run_id' => '<string>',
'only_experiments' => true
]
]),
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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query"
payload := strings.NewReader("{\n \"date_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\"\n },\n \"query\": {\n \"kind\": \"time_series\",\n \"measures\": [\n {\n \"metric\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"bucket\": {\n \"max_points\": 2\n },\n \"split_by\": \"<string>\",\n \"split_ranking\": {\n \"limit\": 2,\n \"include_other\": true\n }\n },\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"product_filters\": {\n \"experiment_run_id\": \"<string>\",\n \"only_experiments\": true\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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"date_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\"\n },\n \"query\": {\n \"kind\": \"time_series\",\n \"measures\": [\n {\n \"metric\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"bucket\": {\n \"max_points\": 2\n },\n \"split_by\": \"<string>\",\n \"split_ranking\": {\n \"limit\": 2,\n \"include_other\": true\n }\n },\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"product_filters\": {\n \"experiment_run_id\": \"<string>\",\n \"only_experiments\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query")
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 \"date_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\"\n },\n \"query\": {\n \"kind\": \"time_series\",\n \"measures\": [\n {\n \"metric\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"bucket\": {\n \"max_points\": 2\n },\n \"split_by\": \"<string>\",\n \"split_ranking\": {\n \"limit\": 2,\n \"include_other\": true\n }\n },\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"product_filters\": {\n \"experiment_run_id\": \"<string>\",\n \"only_experiments\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"kind": "time_series",
"meta": {
"matched_event_count": 123,
"warnings": [
{
"code": "<string>",
"message": "<string>",
"details": {}
}
],
"effective_bucket": {
"interval": "<string>",
"fill": "zero"
},
"ranking": {
"limit": 123,
"total_series": 123
}
},
"measures": [
{
"id": "<string>",
"label": "<string>",
"unit": "ms",
"format": "number"
}
],
"data": {
"buckets": [
"<string>"
],
"series": [
{
"key": "<string>",
"label": "<string>",
"dimensions": {},
"values": [
123
]
}
]
}
}
}Run a chart query
Aggregate the project’s events into one chart result. query.kind selects the result shape: time series, categorical, scalar, histogram, or table. Every query must include an event_type is <type> or event_type is not <type> filter; an event_type is session filter queries sessions instead of events. The scatter kind and a categorical split_by / split_ranking are accepted by the schema but not served yet, and answer 501.
curl --request POST \
--url https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"date_range": {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"timezone": "<string>"
},
"query": {
"kind": "time_series",
"measures": [
{
"metric": "<string>",
"id": "<string>"
}
],
"bucket": {
"max_points": 2
},
"split_by": "<string>",
"split_ranking": {
"limit": 2,
"include_other": true
}
},
"filters": [
{
"field": "<string>",
"value": "<string>"
}
],
"product_filters": {
"experiment_run_id": "<string>",
"only_experiments": true
}
}
'import requests
url = "https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query"
payload = {
"date_range": {
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"timezone": "<string>"
},
"query": {
"kind": "time_series",
"measures": [
{
"metric": "<string>",
"id": "<string>"
}
],
"bucket": { "max_points": 2 },
"split_by": "<string>",
"split_ranking": {
"limit": 2,
"include_other": True
}
},
"filters": [
{
"field": "<string>",
"value": "<string>"
}
],
"product_filters": {
"experiment_run_id": "<string>",
"only_experiments": True
}
}
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({
date_range: {
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
timezone: '<string>'
},
query: {
kind: 'time_series',
measures: [{metric: '<string>', id: '<string>'}],
bucket: {max_points: 2},
split_by: '<string>',
split_ranking: {limit: 2, include_other: true}
},
filters: [{field: '<string>', value: '<string>'}],
product_filters: {experiment_run_id: '<string>', only_experiments: true}
})
};
fetch('https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query', 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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query",
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([
'date_range' => [
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'timezone' => '<string>'
],
'query' => [
'kind' => 'time_series',
'measures' => [
[
'metric' => '<string>',
'id' => '<string>'
]
],
'bucket' => [
'max_points' => 2
],
'split_by' => '<string>',
'split_ranking' => [
'limit' => 2,
'include_other' => true
]
],
'filters' => [
[
'field' => '<string>',
'value' => '<string>'
]
],
'product_filters' => [
'experiment_run_id' => '<string>',
'only_experiments' => true
]
]),
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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query"
payload := strings.NewReader("{\n \"date_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\"\n },\n \"query\": {\n \"kind\": \"time_series\",\n \"measures\": [\n {\n \"metric\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"bucket\": {\n \"max_points\": 2\n },\n \"split_by\": \"<string>\",\n \"split_ranking\": {\n \"limit\": 2,\n \"include_other\": true\n }\n },\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"product_filters\": {\n \"experiment_run_id\": \"<string>\",\n \"only_experiments\": true\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.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"date_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\"\n },\n \"query\": {\n \"kind\": \"time_series\",\n \"measures\": [\n {\n \"metric\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"bucket\": {\n \"max_points\": 2\n },\n \"split_by\": \"<string>\",\n \"split_ranking\": {\n \"limit\": 2,\n \"include_other\": true\n }\n },\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"product_filters\": {\n \"experiment_run_id\": \"<string>\",\n \"only_experiments\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/charts/query")
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 \"date_range\": {\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\"\n },\n \"query\": {\n \"kind\": \"time_series\",\n \"measures\": [\n {\n \"metric\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"bucket\": {\n \"max_points\": 2\n },\n \"split_by\": \"<string>\",\n \"split_ranking\": {\n \"limit\": 2,\n \"include_other\": true\n }\n },\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"product_filters\": {\n \"experiment_run_id\": \"<string>\",\n \"only_experiments\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"kind": "time_series",
"meta": {
"matched_event_count": 123,
"warnings": [
{
"code": "<string>",
"message": "<string>",
"details": {}
}
],
"effective_bucket": {
"interval": "<string>",
"fill": "zero"
},
"ranking": {
"limit": 123,
"total_series": 123
}
},
"measures": [
{
"id": "<string>",
"label": "<string>",
"unit": "ms",
"format": "number"
}
],
"data": {
"buckets": [
"<string>"
],
"series": [
{
"key": "<string>",
"label": "<string>",
"dimensions": {},
"values": [
123
]
}
]
}
}
}Authorizations
A fine-grained data plane API key (values begin with hh_fgdp_). Rooted at an organization, workspace, or project, it carries the permissions chosen when it was created, and only the operations whose paths begin with /v1/projects/{project_id}/ accept it. Create one in the HoneyHive app under the project's, workspace's, or organization's Settings → API Keys, on the Data Plane tab.
Path Parameters
The unique identifier of the project whose events are queried
Body
Request body for POST /v1/charts/query
Was this page helpful?