Search
Get an on-demand search
Returns the current state of a search: running (with partialStats, a pollUrl, and a Retry-After header), completed (with the full mentions array + stats), failed, or quota_exhausted.
GET
/
api
/
v2
/
search
/
{searchId}
Get an on-demand search
curl --request GET \
--url https://app.octolens.com/api/v2/search/{searchId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.octolens.com/api/v2/search/{searchId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.octolens.com/api/v2/search/{searchId}', 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://app.octolens.com/api/v2/search/{searchId}",
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://app.octolens.com/api/v2/search/{searchId}"
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://app.octolens.com/api/v2/search/{searchId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.octolens.com/api/v2/search/{searchId}")
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{
"searchId": "<string>",
"status": "running",
"query": "<string>",
"timeWindow": "1d",
"sources": [
"<string>"
],
"startedAt": "<string>",
"completedAt": "<string>",
"stats": {
"rawMatches": 0,
"afterDedup": 0,
"afterRelevance": 0,
"mentionsConsumed": 0,
"perSource": {},
"skippedSources": {}
},
"mentions": [
{
"id": 0,
"sourceId": "reddit_t3_1abc234",
"url": "https://reddit.com/r/example/comments/abc123/...",
"title": "<string>",
"body": "<string>",
"source": "reddit",
"timestamp": "2026-05-06 13:35:37.000",
"author": "jane.doe",
"authorName": "<string>",
"authorAvatar": "<string>",
"authorUrl": "<string>",
"authorFollowers": 0,
"relevance": "relevant",
"relevanceComment": "<string>",
"sentiment": "Neutral",
"language": "english",
"tags": [
"competitor_mention",
"pricing"
],
"keywords": [
{
"id": 42,
"keyword": "social listening"
}
],
"engaged": true,
"relevanceScore": 123,
"feedbackRelevant": 123,
"imageUrl": "<string>",
"keywordId": 123,
"alreadyInWorkspace": true
}
],
"pollUrl": "<string>",
"error": "<string>"
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}Authorizations
Clerk API key. Create one in Settings → API Keys. Pass as Authorization: Bearer <key>.
Path Parameters
Response
200 response
State of a previously-started search.
Available options:
running, completed, failed, quota_exhausted Available options:
1d, 7d, 30d Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Get an on-demand search
curl --request GET \
--url https://app.octolens.com/api/v2/search/{searchId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.octolens.com/api/v2/search/{searchId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.octolens.com/api/v2/search/{searchId}', 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://app.octolens.com/api/v2/search/{searchId}",
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://app.octolens.com/api/v2/search/{searchId}"
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://app.octolens.com/api/v2/search/{searchId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.octolens.com/api/v2/search/{searchId}")
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{
"searchId": "<string>",
"status": "running",
"query": "<string>",
"timeWindow": "1d",
"sources": [
"<string>"
],
"startedAt": "<string>",
"completedAt": "<string>",
"stats": {
"rawMatches": 0,
"afterDedup": 0,
"afterRelevance": 0,
"mentionsConsumed": 0,
"perSource": {},
"skippedSources": {}
},
"mentions": [
{
"id": 0,
"sourceId": "reddit_t3_1abc234",
"url": "https://reddit.com/r/example/comments/abc123/...",
"title": "<string>",
"body": "<string>",
"source": "reddit",
"timestamp": "2026-05-06 13:35:37.000",
"author": "jane.doe",
"authorName": "<string>",
"authorAvatar": "<string>",
"authorUrl": "<string>",
"authorFollowers": 0,
"relevance": "relevant",
"relevanceComment": "<string>",
"sentiment": "Neutral",
"language": "english",
"tags": [
"competitor_mention",
"pricing"
],
"keywords": [
{
"id": 42,
"keyword": "social listening"
}
],
"engaged": true,
"relevanceScore": 123,
"feedbackRelevant": 123,
"imageUrl": "<string>",
"keywordId": 123,
"alreadyInWorkspace": true
}
],
"pollUrl": "<string>",
"error": "<string>"
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"status": 404,
"details": [
"<unknown>"
],
"upgradeUrl": "https://app.octolens.com/me/upgrade?src=agents",
"upgradeCommand": "octolens upgrade"
}
}