For the complete documentation index, see llms.txt. This page is also available as Markdown.

/search

Learn how to use Oxylabs Web API /search endpoint to search the live web and collect ranked results.

The /v1/search endpoint performs live web searches and returns ranked organic results, including titles, snippets, URLs, position metadata, and related queries. It works as a discovery tool to identify authoritative web pages before passing target URLs to the /v1/scrape endpoint for full-page extraction.

Request sample

The endpoint accepts a JSON request body with the search query, result limits, and geo-location parameters.

curl https://webapi.oxylabs.io/v1/search \
  -H "Authorization: Bearer $OXYLABS_WEB_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "eu ai act compliance deadlines",
    "max_results": 3,
    "location": "DE"
  }'

Request parameters

Parameter
Description
Type

query

Search keyword or phrase (between 1 and 2,048 characters).

string

max_results

Number of organic search results to return (between 1 and 20). Default: 10

integer

location

ISO 3166-1 alpha-2 country code (e.g. DE, US) for localized search.

string

– mandatory parameter.

Request optimization

query

It's recommended to write what a person would type into a search box. Keyword-shaped queries outperform sentence-shaped ones:

Instead of
Use

"Can you tell me what the compliance deadlines for the EU AI Act are?"

eu ai act compliance deadlines

"I want to know how much Figma costs per seat"

figma pricing per seat

One question per request. A compound query returns results that match neither half well.

max_results

Parameter is a limit, not a target. A query with fewer matches returns fewer results, which are ordered best-first.

location

Pricing, availability, language and rankings often shift by country.

ISO 3166-1 alpha-2 code is the only accepted format (e.g. DE, US). A well-formed pair that isn't an assigned country is rejected with a 400 error code. Omitting the the parameter sets a default locale, which is optimal only when the answer is not location-sensitive.

Output sample

Output dictionary

Field
Description
Type

state

"done" on success. A search that encounters an upstream failure returns 500 with state: "faulted" (see Error codes).

string

results

Ranked organic results, best first. Always present, so empty output means nothing matched.

array

results[].title

Fetched page title.

string

results[].outline[]

SERP result snippets. Truncated mid-sentence.

array of strings

results[].url

Absolute URL of the result. Pass to /v1/scrape.

string

results[].metadata.position

Organic SERP position, starting at 1.

integer

related_questions

"People also ask" question object containing question, title, and snippet (when available).

array

related_searches

Related search queries, each containing query.

array

params

Execution parameters including defaults.

object

metadata.timestamp

Unix timestamp in seconds.

integer

metadata.request_id

19-digit request handle. Include in support tickets.

string

related_searches is useful for query expansion when a first search comes back thin. It offers the phrasing that has more coverage behind it.

Last updated

Was this helpful?