curl --request POST \
--url https://api.honeycomb.io/1/query_results/{datasetSlug} \
--header 'Content-Type: application/json' \
--header 'X-Honeycomb-Team: <api-key>' \
--data '
{
"query_id": "mabAMpSPDjH",
"disable_series": false,
"disable_total_by_aggregate": true,
"disable_other_by_aggregate": true,
"limit": 123
}
'import requests
url = "https://api.honeycomb.io/1/query_results/{datasetSlug}"
payload = {
"query_id": "mabAMpSPDjH",
"disable_series": False,
"disable_total_by_aggregate": True,
"disable_other_by_aggregate": True,
"limit": 123
}
headers = {
"X-Honeycomb-Team": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Honeycomb-Team': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query_id: 'mabAMpSPDjH',
disable_series: false,
disable_total_by_aggregate: true,
disable_other_by_aggregate: true,
limit: 123
})
};
fetch('https://api.honeycomb.io/1/query_results/{datasetSlug}', 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.honeycomb.io/1/query_results/{datasetSlug}",
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([
'query_id' => 'mabAMpSPDjH',
'disable_series' => false,
'disable_total_by_aggregate' => true,
'disable_other_by_aggregate' => true,
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Honeycomb-Team: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.honeycomb.io/1/query_results/{datasetSlug}"
payload := strings.NewReader("{\n \"query_id\": \"mabAMpSPDjH\",\n \"disable_series\": false,\n \"disable_total_by_aggregate\": true,\n \"disable_other_by_aggregate\": true,\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Honeycomb-Team", "<api-key>")
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.honeycomb.io/1/query_results/{datasetSlug}")
.header("X-Honeycomb-Team", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query_id\": \"mabAMpSPDjH\",\n \"disable_series\": false,\n \"disable_total_by_aggregate\": true,\n \"disable_other_by_aggregate\": true,\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/1/query_results/{datasetSlug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Honeycomb-Team"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query_id\": \"mabAMpSPDjH\",\n \"disable_series\": false,\n \"disable_total_by_aggregate\": true,\n \"disable_other_by_aggregate\": true,\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"query": {
"calculations": [
{
"op": "COUNT"
}
],
"orders": [
{
"op": "COUNT",
"order": "descending"
}
],
"limit": 10000,
"time_range": 7200
},
"complete": false,
"id": "dfg456",
"links": {
"query_url": "https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/dfg456",
"graph_image_url": "https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/dfg456/snapshot"
}
}Create a Query Result
Kick off processing of a Query to then get back the Query Results.
Once the Query Result has been created, the query will be run asynchronously, allowing the result data to be fetched from the GET query result endpoint.
A maximum duration of 7 days of data can be queried. Any queries with a start_time, end_time, or time_range resulting in a duration longer than 7 days will result in a 400 error response.
curl --request POST \
--url https://api.honeycomb.io/1/query_results/{datasetSlug} \
--header 'Content-Type: application/json' \
--header 'X-Honeycomb-Team: <api-key>' \
--data '
{
"query_id": "mabAMpSPDjH",
"disable_series": false,
"disable_total_by_aggregate": true,
"disable_other_by_aggregate": true,
"limit": 123
}
'import requests
url = "https://api.honeycomb.io/1/query_results/{datasetSlug}"
payload = {
"query_id": "mabAMpSPDjH",
"disable_series": False,
"disable_total_by_aggregate": True,
"disable_other_by_aggregate": True,
"limit": 123
}
headers = {
"X-Honeycomb-Team": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Honeycomb-Team': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query_id: 'mabAMpSPDjH',
disable_series: false,
disable_total_by_aggregate: true,
disable_other_by_aggregate: true,
limit: 123
})
};
fetch('https://api.honeycomb.io/1/query_results/{datasetSlug}', 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.honeycomb.io/1/query_results/{datasetSlug}",
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([
'query_id' => 'mabAMpSPDjH',
'disable_series' => false,
'disable_total_by_aggregate' => true,
'disable_other_by_aggregate' => true,
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Honeycomb-Team: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.honeycomb.io/1/query_results/{datasetSlug}"
payload := strings.NewReader("{\n \"query_id\": \"mabAMpSPDjH\",\n \"disable_series\": false,\n \"disable_total_by_aggregate\": true,\n \"disable_other_by_aggregate\": true,\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Honeycomb-Team", "<api-key>")
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.honeycomb.io/1/query_results/{datasetSlug}")
.header("X-Honeycomb-Team", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query_id\": \"mabAMpSPDjH\",\n \"disable_series\": false,\n \"disable_total_by_aggregate\": true,\n \"disable_other_by_aggregate\": true,\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/1/query_results/{datasetSlug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Honeycomb-Team"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query_id\": \"mabAMpSPDjH\",\n \"disable_series\": false,\n \"disable_total_by_aggregate\": true,\n \"disable_other_by_aggregate\": true,\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"query": {
"calculations": [
{
"op": "COUNT"
}
],
"orders": [
{
"op": "COUNT",
"order": "descending"
}
],
"limit": 10000,
"time_range": 7200
},
"complete": false,
"id": "dfg456",
"links": {
"query_url": "https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/dfg456",
"graph_image_url": "https://ui.honeycomb.io/myteam/datasets/test-via-curl/result/dfg456/snapshot"
}
}Authorizations
Authenticate using a Honeycomb Configuration Key.
Pass the Token in the X-Honeycomb-Team header:
X-Honeycomb-Team: 1234567890123456789012
If you created your key using the API, use data.attributes.secret; this is the same value as the Token in the UI.
To learn how to create a Configuration Key, visit Manage Environment API Keys. To learn more about authenticating requests, visit API Authentication.
Path Parameters
Body
A Query Result is created with the Query ID.
Response
Created
A Query Result is created with the Query ID.