curl --request GET \
--url https://api.hyperspell.com/evaluate/query/{query_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperspell.com/evaluate/query/{query_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hyperspell.com/evaluate/query/{query_id}', 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.hyperspell.com/evaluate/query/{query_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.hyperspell.com/evaluate/query/{query_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.hyperspell.com/evaluate/query/{query_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/evaluate/query/{query_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"query_id": "<string>",
"errors": [
{}
],
"documents": [
{
"resource_id": "<string>",
"source": "reddit",
"type": "<string>",
"document": {
"children": [
{
"text": "The next release adds calendar search.",
"type": "text"
}
],
"title": "Project notes",
"type": "document"
},
"body_status": "full",
"title": "<string>",
"status": "pending",
"collection": "<string>",
"metadata": {},
"ingested_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z",
"document_date": "2023-11-07T05:31:56Z",
"chunks": [
{
"chunk_id": "<string>",
"summary": "<string>"
}
],
"score": 123,
"highlights": [
"<unknown>"
],
"summary": "<string>"
}
],
"answer": "<string>",
"disclaimer": "<string>",
"provenance": {
"sources": [
{
"source": "reddit",
"resource_id": "<string>",
"owner": "<string>",
"chunk_id": "<string>",
"span": [
0,
120
],
"content_sha256": "<string>",
"title": "<string>",
"score": 123
}
],
"entities": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
}
],
"failed_sources": [
"<string>"
],
"steps": [
{
"iteration": 123,
"tool": "<string>",
"status": "<string>",
"query": "<string>",
"source": "<string>",
"result_count": 0
}
],
"entity_searches": [
{
"surface": "<string>",
"entity_type": "<string>",
"query": "<string>",
"partial": false,
"matches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>",
"match_kind": "<string>",
"sources": [
{
"source": "reddit",
"resource_id": "<string>",
"owner": "<string>",
"chunk_id": "<string>",
"span": [
0,
120
],
"content_sha256": "<string>"
}
],
"context": [
{
"source": "reddit",
"resource_id": "<string>",
"chunk_id": "<string>",
"text": "<string>",
"owner": "<string>",
"span": [
0,
120
],
"content_sha256": "<string>",
"title": "<string>",
"kind": "retrieved_context",
"mention": "<string>",
"observed_surface": "<string>"
}
]
}
],
"passage_mapping": "unavailable"
}
],
"entity_resolutions": [
{
"reference": "<string>",
"status": "complete",
"candidates": [
{
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"canonical_name": "<string>",
"entity_type": "<string>",
"reason": "<string>",
"evidence": [
{
"source": "reddit",
"resource_id": "<string>",
"text": "<string>",
"chunk_id": "<string>"
}
],
"description": "<string>"
}
],
"limitations": [
"<string>"
]
}
]
},
"score": 123,
"query": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get query result
Retrieve the result of a previous query.
curl --request GET \
--url https://api.hyperspell.com/evaluate/query/{query_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperspell.com/evaluate/query/{query_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hyperspell.com/evaluate/query/{query_id}', 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.hyperspell.com/evaluate/query/{query_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.hyperspell.com/evaluate/query/{query_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.hyperspell.com/evaluate/query/{query_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/evaluate/query/{query_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"query_id": "<string>",
"errors": [
{}
],
"documents": [
{
"resource_id": "<string>",
"source": "reddit",
"type": "<string>",
"document": {
"children": [
{
"text": "The next release adds calendar search.",
"type": "text"
}
],
"title": "Project notes",
"type": "document"
},
"body_status": "full",
"title": "<string>",
"status": "pending",
"collection": "<string>",
"metadata": {},
"ingested_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z",
"document_date": "2023-11-07T05:31:56Z",
"chunks": [
{
"chunk_id": "<string>",
"summary": "<string>"
}
],
"score": 123,
"highlights": [
"<unknown>"
],
"summary": "<string>"
}
],
"answer": "<string>",
"disclaimer": "<string>",
"provenance": {
"sources": [
{
"source": "reddit",
"resource_id": "<string>",
"owner": "<string>",
"chunk_id": "<string>",
"span": [
0,
120
],
"content_sha256": "<string>",
"title": "<string>",
"score": 123
}
],
"entities": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
}
],
"failed_sources": [
"<string>"
],
"steps": [
{
"iteration": 123,
"tool": "<string>",
"status": "<string>",
"query": "<string>",
"source": "<string>",
"result_count": 0
}
],
"entity_searches": [
{
"surface": "<string>",
"entity_type": "<string>",
"query": "<string>",
"partial": false,
"matches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>",
"match_kind": "<string>",
"sources": [
{
"source": "reddit",
"resource_id": "<string>",
"owner": "<string>",
"chunk_id": "<string>",
"span": [
0,
120
],
"content_sha256": "<string>"
}
],
"context": [
{
"source": "reddit",
"resource_id": "<string>",
"chunk_id": "<string>",
"text": "<string>",
"owner": "<string>",
"span": [
0,
120
],
"content_sha256": "<string>",
"title": "<string>",
"kind": "retrieved_context",
"mention": "<string>",
"observed_surface": "<string>"
}
]
}
],
"passage_mapping": "unavailable"
}
],
"entity_resolutions": [
{
"reference": "<string>",
"status": "complete",
"candidates": [
{
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"canonical_name": "<string>",
"entity_type": "<string>",
"reason": "<string>",
"evidence": [
{
"source": "reddit",
"resource_id": "<string>",
"text": "<string>",
"chunk_id": "<string>"
}
],
"description": "<string>"
}
],
"limitations": [
"<string>"
]
}
]
},
"score": 123,
"query": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Headers
Document response budget: api scales with result count; mcp uses 256 KiB.
api, mcp Optionally set this header to act as a specific user when using an API Key, equivalent to first exchanging the API Key for a User Token
Path Parameters
Response
Successful Response
The ID of the query. This can be used to retrieve the query later, or add feedback to it. If the query failed, this will be None.
Errors that occurred during the query. These are meant to help the developer debug the query, and are not meant to be shown to the user.
Show child attributes
Show child attributes
The matching documents, each carrying its hyperdoc tree plus query-path score, highlights, and summary.
Show child attributes
Show child attributes
The answer to the query, if the request was set to answer.
Privacy notice for the answer, when applicable. If present, callers must display it alongside the answer.
Auditability record (source documents, entities, search trajectory, failed sources), if the request set provenance=True on a very_high query.
Show child attributes
Show child attributes
The average score of the query feedback, if any.
The query string that was issued.
Was this page helpful?