curl --request GET \
--url https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId} \
--header 'X-Honeycomb-Team: <api-key>'import requests
url = "https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}"
headers = {"X-Honeycomb-Team": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Honeycomb-Team': '<api-key>'}};
fetch('https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}', 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}/{queryResultId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Honeycomb-Team", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}")
.header("X-Honeycomb-Team", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Honeycomb-Team"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"query": {
"calculations": [
{
"op": "COUNT"
}
],
"orders": [
{
"op": "COUNT",
"order": "descending"
}
],
"limit": 10000,
"time_range": 7200
},
"complete": true,
"id": "dfg456",
"data": {
"series": [],
"results": [
{
"data": {
"COUNT": 20769
}
}
]
},
"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"
}
}Get Query Result
Get the Query Result details for a specific Query Result ID. This endpoint is used to fetch the results of a query that had previously been created. It is recommended to follow the Location header included in the Create Query Result output, but the URL can also be constructed manually with the <query-result-id>. Note: a query that fails to run still returns HTTP 200. Check the response body: a failed query has “complete”: true with an “error” field in place of “data”.
curl --request GET \
--url https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId} \
--header 'X-Honeycomb-Team: <api-key>'import requests
url = "https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}"
headers = {"X-Honeycomb-Team": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Honeycomb-Team': '<api-key>'}};
fetch('https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}', 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}/{queryResultId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Honeycomb-Team", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}")
.header("X-Honeycomb-Team", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/1/query_results/{datasetSlug}/{queryResultId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Honeycomb-Team"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"query": {
"calculations": [
{
"op": "COUNT"
}
],
"orders": [
{
"op": "COUNT",
"order": "descending"
}
],
"limit": 10000,
"time_range": 7200
},
"complete": true,
"id": "dfg456",
"data": {
"series": [],
"results": [
{
"data": {
"COUNT": 20769
}
}
]
},
"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
Response
Success
Query Results for the Query ID. The response body will be a JSON object with "complete": true and the results populated once the query is complete. If the query fails to run, the response will still return HTTP 200 with "complete": true, but the "data" field will be replaced by an "error" field describing the failure. The response body will contain caching headers to indicate that once complete, and the Query Result may be cached, as it will not change.