Run a search
POST
/
api
/
search
/
query
Run a search
curl --request POST \
--url https://api.truscan.co/api/search/query \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"q": "<string>",
"tier": "instant",
"limit": 10,
"enrich": true,
"format": "json",
"site": "<string>",
"lang": "<string>",
"category": "general"
}
'import requests
url = "https://api.truscan.co/api/search/query"
payload = {
"query": "<string>",
"q": "<string>",
"tier": "instant",
"limit": 10,
"enrich": True,
"format": "json",
"site": "<string>",
"lang": "<string>",
"category": "general"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
q: '<string>',
tier: 'instant',
limit: 10,
enrich: true,
format: 'json',
site: '<string>',
lang: '<string>',
category: 'general'
})
};
fetch('https://api.truscan.co/api/search/query', 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.truscan.co/api/search/query",
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' => '<string>',
'q' => '<string>',
'tier' => 'instant',
'limit' => 10,
'enrich' => true,
'format' => 'json',
'site' => '<string>',
'lang' => '<string>',
'category' => 'general'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.truscan.co/api/search/query"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"q\": \"<string>\",\n \"tier\": \"instant\",\n \"limit\": 10,\n \"enrich\": true,\n \"format\": \"json\",\n \"site\": \"<string>\",\n \"lang\": \"<string>\",\n \"category\": \"general\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.truscan.co/api/search/query")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"q\": \"<string>\",\n \"tier\": \"instant\",\n \"limit\": 10,\n \"enrich\": true,\n \"format\": \"json\",\n \"site\": \"<string>\",\n \"lang\": \"<string>\",\n \"category\": \"general\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truscan.co/api/search/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"q\": \"<string>\",\n \"tier\": \"instant\",\n \"limit\": 10,\n \"enrich\": true,\n \"format\": \"json\",\n \"site\": \"<string>\",\n \"lang\": \"<string>\",\n \"category\": \"general\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"result": {
"id": "<string>",
"query": "<string>",
"tier": "instant",
"total": 123,
"format": "json",
"rendered": "<string>",
"results": [
{
"rank": 123,
"url": "<string>",
"title": "<string>",
"snippet": "<string>",
"domain": "<string>",
"score": 123,
"components": {
"consensus": 123,
"position": 123,
"lexical": 123,
"proximity": 123,
"authority": 123,
"freshness": 123
},
"published_at": "2023-11-07T05:31:56Z",
"content": {
"text": "<string>",
"markdown": "<string>",
"excerpt": "<string>",
"words": 123,
"lang": "<string>",
"author": "<string>",
"site_name": "<string>",
"truncated": true,
"error": "<string>",
"highlights": [
{
"text": "<string>",
"start": 123,
"end": 123,
"score": 123
}
]
}
}
],
"stats": {
"took_ms": 123,
"recall_ms": 123,
"enrich_ms": 123,
"candidates": 123,
"deduped": 123,
"enriched": 123,
"cached": true
}
}
}{
"success": false,
"message": "<string>",
"result": {
"code": "<string>"
}
}{
"success": false,
"message": "<string>",
"result": {
"code": "<string>"
}
}{
"success": false,
"message": "<string>",
"result": {
"code": "<string>"
}
}{
"success": false,
"message": "<string>",
"result": {
"code": "<string>"
}
}Body
application/json
Maximum string length:
512Accepted as an alias for query.
Search depth. instant/fast/auto share one recall budget; deep doubles it; deep_reasoning widens it further and extracts nearly everything it recalls.
Available options:
instant, fast, auto, deep, deep_reasoning Required range:
1 <= x <= 50Fetch and extract page bodies for the top results. Off is roughly ten times faster and returns engine snippets only.
Available options:
json, markdown, text Restrict to one host.
Available options:
any, day, week, month, year Available options:
general, news, science, images, videos, it ⌘I
Run a search
curl --request POST \
--url https://api.truscan.co/api/search/query \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"q": "<string>",
"tier": "instant",
"limit": 10,
"enrich": true,
"format": "json",
"site": "<string>",
"lang": "<string>",
"category": "general"
}
'import requests
url = "https://api.truscan.co/api/search/query"
payload = {
"query": "<string>",
"q": "<string>",
"tier": "instant",
"limit": 10,
"enrich": True,
"format": "json",
"site": "<string>",
"lang": "<string>",
"category": "general"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
q: '<string>',
tier: 'instant',
limit: 10,
enrich: true,
format: 'json',
site: '<string>',
lang: '<string>',
category: 'general'
})
};
fetch('https://api.truscan.co/api/search/query', 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.truscan.co/api/search/query",
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' => '<string>',
'q' => '<string>',
'tier' => 'instant',
'limit' => 10,
'enrich' => true,
'format' => 'json',
'site' => '<string>',
'lang' => '<string>',
'category' => 'general'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.truscan.co/api/search/query"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"q\": \"<string>\",\n \"tier\": \"instant\",\n \"limit\": 10,\n \"enrich\": true,\n \"format\": \"json\",\n \"site\": \"<string>\",\n \"lang\": \"<string>\",\n \"category\": \"general\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.truscan.co/api/search/query")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"q\": \"<string>\",\n \"tier\": \"instant\",\n \"limit\": 10,\n \"enrich\": true,\n \"format\": \"json\",\n \"site\": \"<string>\",\n \"lang\": \"<string>\",\n \"category\": \"general\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truscan.co/api/search/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"q\": \"<string>\",\n \"tier\": \"instant\",\n \"limit\": 10,\n \"enrich\": true,\n \"format\": \"json\",\n \"site\": \"<string>\",\n \"lang\": \"<string>\",\n \"category\": \"general\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"result": {
"id": "<string>",
"query": "<string>",
"tier": "instant",
"total": 123,
"format": "json",
"rendered": "<string>",
"results": [
{
"rank": 123,
"url": "<string>",
"title": "<string>",
"snippet": "<string>",
"domain": "<string>",
"score": 123,
"components": {
"consensus": 123,
"position": 123,
"lexical": 123,
"proximity": 123,
"authority": 123,
"freshness": 123
},
"published_at": "2023-11-07T05:31:56Z",
"content": {
"text": "<string>",
"markdown": "<string>",
"excerpt": "<string>",
"words": 123,
"lang": "<string>",
"author": "<string>",
"site_name": "<string>",
"truncated": true,
"error": "<string>",
"highlights": [
{
"text": "<string>",
"start": 123,
"end": 123,
"score": 123
}
]
}
}
],
"stats": {
"took_ms": 123,
"recall_ms": 123,
"enrich_ms": 123,
"candidates": 123,
"deduped": 123,
"enriched": 123,
"cached": true
}
}
}{
"success": false,
"message": "<string>",
"result": {
"code": "<string>"
}
}{
"success": false,
"message": "<string>",
"result": {
"code": "<string>"
}
}{
"success": false,
"message": "<string>",
"result": {
"code": "<string>"
}
}{
"success": false,
"message": "<string>",
"result": {
"code": "<string>"
}
}