Skip to main content
Docs API Ref
POST /search

Search API reference

Run a search query and get ranked results, each with a title, a description and a URL. Set fetch_page_content and the same call visits each result and returns its content in your format. Useful for market research, competitive analysis, and building datasets around a topic.

Parameters

Endpoint Parameters(14)
NameTypeDefaultDescription
searchrequiredstring

The search query you want to search for.

search_limitoptionalnumber

The limit amount of URLs to fetch or crawl from the search results. Remove the value or set it to 0 to crawl all URLs from the realtime search results. This is a shorthand if you do not want to use num.

fetch_page_contentoptionalbooleanfalse

Fetch the content of each result, one page per result unless you set limit. If disabled, only the search results are returned with the meta title and description.

countryoptionalstring

The country code to use for the search. It's a two-letter country code. (e.g. us for the United States).

locationoptionalstring

The location from where you want the search to originate.

latitudeoptionalnumber

Latitude for exact-coordinate localization. Pair with longitude. Takes precedence over location when both are set.

longitudeoptionalnumber

Longitude for exact-coordinate localization. Pair with latitude.

radiusoptionalnumber

Optional bias radius in meters for coordinate localization. Defaults to -1 (unset).

languageoptionalstring

The language to use for the search. It's a two-letter language code (e.g., en for English).

numoptionalnumber

The maximum number of results to return for the search.

tbsoptional'qdr:h' | 'qdr:d' | 'qdr:w' | 'qdr:m' | 'qdr:y'

Restrict results to a specific time range. Common options:qdr:h (past hour), qdr:d (past 24 hours), qdr:w (past week),qdr:m (past month), qdr:y (past year).

pageoptionalnumber

The page number for the search results.

quick_searchoptionalboolean

Prioritize speed over output quantity.

auto_paginationoptionalboolean

Automatically paginates to fetch the exact number of desired results, as specified by the num parameter. Note that credit usage may increase, and response time may be slower when retrieving larger result sets.

Request samples

cURL
curl 'https://api.spider.cloud/search' \
    -H "Authorization: Bearer $SPIDER_API_KEY" \
    -H 'Content-Type: application/json' \
    -d'{"search":"sports news today","search_limit":3,"limit":5,"return_format":"markdown"}'
Python
import requests, os

headers = {
    'Authorization': f'Bearer {os.getenv("SPIDER_API_KEY")}',
    'Content-Type': 'application/json',
}

json_data = {"search":"sports news today","search_limit":3,"limit":5,"return_format":"markdown"}

response = requests.post('https://api.spider.cloud/search', 
  headers=headers, json=json_data)

print(response.json())
Node.js
import https from 'https';

const options = {
  hostname: 'api.spider.cloud',
  port: 443,
  path: '/search',
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.SPIDER_API_KEY}`,
    'Content-Type': 'application/json'
  }
};

const req = https.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({"search":"sports news today","search_limit":3,"limit":5,"return_format":"markdown"}));
req.end();

See the SERP tracking and rank tracking API use case for how to turn this endpoint into geo-targeted ranking data.