V2 File Search
Get File Search Job Status
Poll this endpoint to retrieve the latest raw file-search job snapshot.
GET
https://oathnet.org/api
/
service
/
v2
/
file-search
/
{job_id}
Get File Search Job Status
curl --request GET \
--url https://oathnet.org/api/service/v2/file-search/{job_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://oathnet.org/api/service/v2/file-search/{job_id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://oathnet.org/api/service/v2/file-search/{job_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://oathnet.org/api/service/v2/file-search/{job_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 => [
"x-api-key: <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://oathnet.org/api/service/v2/file-search/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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://oathnet.org/api/service/v2/file-search/{job_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://oathnet.org/api/service/v2/file-search/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"progress": {
"logs_total": 123,
"logs_completed": 123,
"files_total": 123,
"files_scanned": 123,
"percent": 123,
"updated_at": "2023-11-07T05:31:56Z"
},
"summary": {
"files_total": 123,
"files_scanned": 123,
"files_matched": 123,
"matches": 123,
"duration_ms": 123,
"bytes_scanned": 123,
"timeouts": 123,
"budget_exceeded": true,
"truncated": true
},
"matches": [
{
"log_id": "<string>",
"file_id": "<string>",
"file_name": "<string>",
"relative_path": "<string>",
"size_bytes": 123,
"match_text": "<string>",
"line_number": 123,
"column_range": {
"start": 123,
"end": 123
},
"snippet": {
"pre": [
"<string>"
],
"line": "<string>",
"post": [
"<string>"
],
"truncated": true
},
"extra": {}
}
],
"limits": {
"max_matches": 123,
"max_file_size_bytes": 123,
"byte_budget_bytes": 123,
"max_context_lines": 123,
"job_ttl_seconds": 123,
"max_log_ids": 123,
"max_expression_length": 123
},
"next_poll_after_ms": 123
}Authorizations
API key for authentication (lowercase header name)
Path Parameters
Response
Raw file-search job snapshot
Available options:
queued, running, completed, canceled Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
Get File Search Job Status
curl --request GET \
--url https://oathnet.org/api/service/v2/file-search/{job_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://oathnet.org/api/service/v2/file-search/{job_id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://oathnet.org/api/service/v2/file-search/{job_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://oathnet.org/api/service/v2/file-search/{job_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 => [
"x-api-key: <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://oathnet.org/api/service/v2/file-search/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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://oathnet.org/api/service/v2/file-search/{job_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://oathnet.org/api/service/v2/file-search/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"progress": {
"logs_total": 123,
"logs_completed": 123,
"files_total": 123,
"files_scanned": 123,
"percent": 123,
"updated_at": "2023-11-07T05:31:56Z"
},
"summary": {
"files_total": 123,
"files_scanned": 123,
"files_matched": 123,
"matches": 123,
"duration_ms": 123,
"bytes_scanned": 123,
"timeouts": 123,
"budget_exceeded": true,
"truncated": true
},
"matches": [
{
"log_id": "<string>",
"file_id": "<string>",
"file_name": "<string>",
"relative_path": "<string>",
"size_bytes": 123,
"match_text": "<string>",
"line_number": 123,
"column_range": {
"start": 123,
"end": 123
},
"snippet": {
"pre": [
"<string>"
],
"line": "<string>",
"post": [
"<string>"
],
"truncated": true
},
"extra": {}
}
],
"limits": {
"max_matches": 123,
"max_file_size_bytes": 123,
"byte_budget_bytes": 123,
"max_context_lines": 123,
"job_ttl_seconds": 123,
"max_log_ids": 123,
"max_expression_length": 123
},
"next_poll_after_ms": 123
}