String API
Search

Overview

Search Google, DuckDuckGo, Brave, or Mojeek and get the top organic results as structured JSON, or results pages as HTML.

POST /search runs a Google, DuckDuckGo, Brave, or Mojeek search for a query and returns the top organic results as structured JSON: title, URL, display URL, snippet, and position.

Search defaults to Google and US results. Set engine to "duckduckgo", "brave", or "mojeek" to choose another engine. Set country to any ISO 3166-1 alpha-2 country code and optionally set language to a language tag such as "en" or "pt-br"; lowercase country codes work too. Locale controls apply to all four engines.

curl https://request.usestring.ai/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "construction consulting firms", "engine": "mojeek", "country": "GB", "language": "en" }'

Response

{
  "results": [
    {
      "position": 1,
      "title": "Example Result Title",
      "url": "https://example.com/page",
      "displayUrl": "https://example.com › page",
      "displayText": "https://example.com › page",
      "snippet": "A short description of the page as shown on the results page."
    },
    {
      "position": 2,
      "title": "Which GPU should I buy?",
      "url": "https://www.reddit.com/r/buildapc/comments/example/which_gpu_should_i_buy/",
      "displayUrl": "",
      "displayText": "20+ comments · 3 months ago",
      "source": "Reddit · r/buildapc",
      "snippet": "A short description of the page as shown on the results page."
    }
  ],
  "zeroResults": false
}
FieldDescription
position1-based rank of the result on the results page.
titleResult title as shown on the results page.
urlThe page the result links to, with no redirect or tracking parameters. Safe to fetch. Absent when the destination is not known; the result is still returned.
displayUrlGoogle's displayed URL line. Empty when Google shows none.
displayTextThe source line Google shows under the title, verbatim: a URL, engagement counts such as 20+ comments · 3 months ago, or other text. Google only.
sourceThe site name Google shows beside the result, such as Reddit · r/buildapc. Optional; Google only.
snippetDescription text shown with the result.

Fetch url, not displayUrl. Google shows no URL line for many social and forum results, such as Reddit, YouTube and Stack Overflow, so displayUrl is empty for them and displayText holds the line Google shows instead.

zeroResults is true when the engine itself reported that nothing matched, so you can tell a genuinely empty answer from a page that simply carried no web results. Google queries that name a business are often answered with a local pack or a knowledge panel instead of web results; the listings come back in a separate places array and the panel in entity, never mixed into results. Ads, spelling corrections, answer widgets, video and discussion blocks, sitelinks and Google's generated summaries come back the same way, each under its own field. See the API reference for every field.

Set engine to "google_ai_mode" to ask Google AI Mode instead: aiMode carries its generated answer as plain text, Markdown and structured blocks (tables included), the pages it cites, and any products, places and videos it shows, with results empty. See Google AI Mode.

Google results take three more controls. page starts from a later results page, dateRange limits results to the past hour, day, week, month or year or to a range of dates, and "sortBy": "date" puts the newest results first. Any other engine rejects them with a 400 that names the field. See Page and Date range and sort order.

curl https://request.usestring.ai/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "interest rate decision", "page": 2, "dateRange": "week", "sortBy": "date" }'

Set searchType to search one of Google's tabs instead of the results page: "images" answers images, about 100 a page with each image file's URL and size; "shopping" answers products, about 55 product listings with price, merchant and rating; "places" answers places, 20 businesses a page; and "videos", "books" and "forums" answer results, with each video's channel and duration and each book's authors and publication date. Each page is billed as one search. See Search type.

curl https://request.usestring.ai/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "noise cancelling headphones", "searchType": "shopping" }'

Google searches also take filters: "safeSearch": true removes explicit results, "includeOmittedResults": true includes the results Google hides as near-duplicates, "autocorrect": false searches the query exactly as sent, restrictCountry keeps only pages from one country, and "verbatim": true matches the query's words exactly. See Filters.

Many of Google's AI Overviews are streamed in after the page loads. Set "aiOverview": true to fill them: it makes a second, sequential fetch, which adds about 2.8 s at p50 and 5.6 s at p90 on the roughly 64% of results pages that carry one. It is off by default, and an overview already present in the page is returned without it. See Streamed AI Overviews.

Raw HTML

format is "structured" (the default), for results as JSON, or "raw", for HTML; Google only, and we recommend "structured". With "raw" the response is the Google results page as HTML, one page per request, billed as one search. Raw supports page only: choose the page with page, and a raw request with searchCount is rejected with a 400. dateRange and sortBy work with raw. Any other engine rejects "format": "raw" with a 400. See Raw HTML.

curl https://request.usestring.ai/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "heat pump grants", "format": "raw" }'

Pricing

Search has its own rate — $1.50 per 1,000 searches on Starter, $1.00 per 1,000 on Growth. A Google AI Mode answer is one search at the same rate. A request with "aiOverview": true costs 2x a normal search. See Pricing.

Use Search to find the right pages for a query, then Fetch those URLs to pull their content.

Sending a https://www.google.com/search?q=... URL to Fetch reaches this endpoint too, and returns the response above. Calling /search directly is clearer and lets you set country explicitly, along with page, dateRange, sortBy and format.

On this page