Search Search the web programmatically and get structured results with content extraction.
The Search API allows you to search the web programmatically and get structured results. Each result includes the page content extracted in your preferred format. Control results with geographic targeting, time filters, and per-result scrape options.
POST https://api.octivas.com/api/v1/search
Parameter Type Required Default Description querystringYes — Search query (1–500 characters). Supports operators like "" (exact match), - (exclude), site:, filetype:. limitintegerNo 5Maximum number of results (1–20) formatsstring[]No ["markdown"]Output formats for scraped content (see Output Formats )
Parameter Type Required Default Description locationstringNo — Geographic location for geo-targeted results (e.g. "San Francisco,California,United States", "Germany") countrystringNo — ISO 3166-1 alpha-2 country code (e.g. "US", "DE", "JP", "BR") tbsstringNo — Time-based search filter: qdr:h (past hour), qdr:d (past day), qdr:w (past week), qdr:m (past month), qdr:y (past year)
Parameter Type Required Default Description only_main_contentbooleanNo — Extract only the primary content of each result page, excluding navigation, sidebars, footers, etc. timeoutintegerNo — Request timeout in milliseconds (1,000–300,000)
The formats array accepts any combination of:
Format Description markdownPage content converted to Markdown htmlCleaned HTML content rawHtmlOriginal unprocessed HTML screenshotScreenshot of the page (returned as a URL) linksList of URLs found on the page jsonStructured data extraction imagesList of image URLs found on the page summaryAI-generated summary of the page content
cURL JavaScript Python
curl -X POST https://api.octivas.com/api/v1/search \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"query": "machine learning tutorials",
"limit": 5,
"formats": ["markdown"]
}' import Octivas from 'octivas' ;
const client = new Octivas ( 'your_api_key' );
const results = await client. search ({
query: 'machine learning tutorials' ,
numResults: 5 ,
extractContent: true
});
results.results. forEach ( result => {
console. log (result.title);
console. log (result.url);
console. log (result.markdown);
}); from octivas import Octivas
with Octivas( api_key = "your_api_key" ) as client:
results = client.search(
"machine learning tutorials" ,
limit = 5 ,
formats = [ "markdown" ],
)
for item in results.results:
print (item.title or item.url)
print (item.url)
print (item.markdown)
Use location targeting, time filters, and content options to refine your search:
cURL JavaScript Python
curl -X POST https://api.octivas.com/api/v1/search \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"query": "best web scraping tools 2025",
"limit": 10,
"formats": ["markdown", "links"],
"country": "US",
"tbs": "qdr:m",
"only_main_content": true,
"timeout": 60000
}' const response = await fetch ( "https://api.octivas.com/api/v1/search" , {
method: "POST" ,
headers: {
"Authorization" : "Bearer your_api_key" ,
"Content-Type" : "application/json" ,
},
body: JSON . stringify ({
query: "best web scraping tools 2025" ,
limit: 10 ,
formats: [ "markdown" , "links" ],
country: "US" ,
tbs: "qdr:m" ,
only_main_content: true ,
timeout: 60000 ,
}),
});
const result = await response. json ();
console. log ( `Found ${ result . results_count } results` ); from octivas import Octivas
with Octivas( api_key = "your_api_key" ) as client:
result = client.search(
"best web scraping tools 2025" ,
limit = 10 ,
formats = [ "markdown" , "links" ],
country = "US" ,
tbs = "qdr:m" ,
only_main_content = True ,
timeout = 60000 ,
)
print ( f "Found { result.results_count } results" )
{
"success" : true ,
"query" : "machine learning tutorials" ,
"results_count" : 3 ,
"credits_used" : 5 ,
"results" : [
{
"url" : "https://example.com/ml-guide" ,
"title" : "Complete Machine Learning Guide" ,
"description" : "A comprehensive guide to machine learning concepts and tools." ,
"markdown" : "# Machine Learning Guide \n\n This comprehensive guide..." ,
"html" : "<h1>Machine Learning Guide</h1><p>This comprehensive guide...</p>" ,
"links" : [
"https://example.com/ml-basics" ,
"https://example.com/ml-advanced"
]
},
{
"url" : "https://example.com/ml-basics" ,
"title" : "ML Basics for Beginners" ,
"description" : "Learn the fundamentals of machine learning." ,
"markdown" : "# ML Basics \n\n Learn the fundamentals..."
}
]
}
Field Type Description successbooleanWhether the request succeeded querystringThe search query used results_countintegerNumber of results returned credits_usedintegerTotal credits consumed resultsarrayArray of search result objects results[].urlstringURL of the result page results[].titlestring | nullPage title results[].descriptionstring | nullPage meta description or search snippet results[].markdownstring | nullPage content as Markdown (if requested) results[].htmlstring | nullPage content as HTML (if requested) results[].raw_htmlstring | nullOriginal unprocessed HTML (if requested) results[].screenshotstring | nullScreenshot URL (if requested) results[].linksstring[] | nullURLs found on the page (if requested) results[].imagesstring[] | nullImage URLs found on the page (if requested) results[].summarystring | nullAI-generated page summary (if requested)