Get search status and retained results
Retrieve the status and saved results of a search started with POST /v1/searches. Use this endpoint to follow a search that is still running or to retrieve its results again while they are retained.
This reads the existing search without starting new work. Start a new search to change the query, targets, or result page.
Selector catalogue
Use the following selectors with the fields query parameter to choose which fields the response includes. See Choose what the response includes for details.
| Selector | Data | Default |
|---|---|---|
results | Matching items, their text, relevance scores, source locations, and coverage information. | Yes |
results.highlights | Highlight locations within result titles and summaries. Also includes results. | No |
results.* | Results and highlights together. | No |
sources | Source status, applied filters, coverage, and suggested documentation sites. | No |
progress | Search request details, readiness counts, and available or suggested versions and refs. | No |
curl --request GET \
--url https://api.githits.dev/v1/searches/{search_ref} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.githits.dev/v1/searches/{search_ref}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.githits.dev/v1/searches/{search_ref}', 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.githits.dev/v1/searches/{search_ref}",
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.githits.dev/v1/searches/{search_ref}"
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.githits.dev/v1/searches/{search_ref}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.githits.dev/v1/searches/{search_ref}")
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_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional client attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.
Optional client-version attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.
Optional agent attribution: trimmed printable ASCII, at most 160 bytes. Invalid optional values are dropped.
Optional caller-defined session ID: one to 64 ASCII letters, digits, underscores or hyphens, preserved exactly. Supply the header at most once. Invalid supplied IDs return 400 INVALID_SESSION_ID; no session is created.
1 - 64^[A-Za-z0-9_-]{1,64}$Path Parameters
Opaque effective-user-owned reference; encode as one path segment, decoded exactly once without trimming.
1Query Parameters
Comma-separated results/results.highlights/results.*/sources/progress; default results, 2048 decoded bytes. No arbitrary leaf masks.
Use the case-sensitive selectors in the catalogue. Order and duplicate selectors do not affect the result. ASCII whitespace around selectors is ignored. The decoded value is limited to 2048 UTF-8 bytes. Empty or unknown selectors and repeated fields query parameters return 400 VALIDATION_ERROR. A group does not include nested groups unless the catalogue says so; only listed wildcard bundles are supported.
2048Time to wait for an updated search observation, in milliseconds. Default 20000; zero returns immediately. When only progress is selected, a positive wait can continue until the search is terminal or the wait expires.
0 <= x <= 60000Response
Source-qualified active, interim or retained terminal observation
One canonical source observation; a reference does not imply active work.
Source POST completion flag; GET is true exactly for completed status. Other terminal statuses remain false.
Source expiration timestamp, not a gateway retention guarantee or exact 410 boundary.
Parser warnings from the result or inline progress, never inferred from query text.
Latest complete page; null when results is unselected or no page is available. Inspect selected_fields.
Show child attributes
Show child attributes
Effective-user-owned opaque reference; null for an immediate unreferenced result.
Canonical expanded selected groups in stable order; disambiguates unselected result:null.
Atomic evidence groups, independent of the transport protocol.
results, results.highlights, sources, progress Explicit source session state, null when the initial operation supplies none.
pending, indexing, searching, completed, deferred, timeout, failed Concise readiness/provenance supplied by inline progress; null when absent.
Show child attributes
Show child attributes
Omitted when unselected; null when selected without inline progress.
Show child attributes
Show child attributes
Omitted when unselected; null when selected without a source snapshot.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.githits.dev/v1/searches/{search_ref} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.githits.dev/v1/searches/{search_ref}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.githits.dev/v1/searches/{search_ref}', 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.githits.dev/v1/searches/{search_ref}",
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.githits.dev/v1/searches/{search_ref}"
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.githits.dev/v1/searches/{search_ref}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.githits.dev/v1/searches/{search_ref}")
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