Search Parameters

Web Data

The Search API provides several parameters to control what results are returned. The query parameter is required, while locale, engine, page, safe, and time_range are optional.

query

The query parameter contains the search query you want to submit.

It is the only required parameter.

Requirements

  • Type: string
  • Minimum length: 1
  • Maximum length: 1000

Example

{
  "query": "web scraping best practice"
}

Required Parameter

Every Search request must include query. The value must contain between 1 and 1,000 characters.


locale

The locale parameter specifies the locale for the search.

It accepts:

  • A language code, such as en
  • A language-region tag, such as en-US
  • all

Example

{
  "query": "web scraping",
  "locale": "en-US"
}

The locale parameter is optional.


engine

Optional. Pin the search to one engine with no fallback.

ValueMeaning
omit / nullService rotates across engines and can fall back on failure (recommended for most callers)
duckduckgoPin to DuckDuckGo
yahooPin to Yahoo
naverPin to Naver

Pinning trades reliability for control: if that engine fails, you get the error instead of a fallback (live example: 502 with PINNED_ENGINE_UNAVAILABLE).

Example

{
  "query": "web scraping",
  "engine": "duckduckgo"
}

The response engine field reports which engine actually served the results.


page

The page parameter specifies which result page to fetch.

Requirements

  • Type: integer
  • Minimum: 1
  • Default: 1
  • Maximum without engine: 9
  • Maximum with engine: DuckDuckGo 5, Yahoo 9, Naver 9

Example

{
  "query": "web scraping",
  "page": 2
}

Page Limit

Without engine, page is 1–9. With engine set, use that engine’s own limit (DuckDuckGo 5, Yahoo/Naver 9).


safe

The safe parameter controls the safe-search filtering level.

The accepted values are:

ValueDescription
offSafe-search filtering is disabled.
moderateModerate safe-search filtering.
strictStrict safe-search filtering.

The default value is off.

Example

{
  "query": "web scraping",
  "safe": "moderate"
}

The OpenAPI only defines these three values for safe.

Accepted Values

Use only off, moderate, or strict for the safe parameter.


time_range

The time_range parameter restricts results to a recency window.

The accepted values are:

ValueRecency window
dayDay
weekWeek
monthMonth
yearYear

Example

{
  "query": "web scraping",
  "time_range": "week"
}

The parameter is optional. Accepted values are day, week, month, or year.

Yahoo time_range

Yahoo accepts day, week, or month only. With engine: "yahoo", year is rejected. Without engine, Yahoo is skipped for that request when time_range is year.


Using Multiple Parameters

You can combine the optional parameters with the required query parameter in a single request.

For example:

{
  "query": "web scraping best practice",
  "locale": "en-US",
  "engine": "yahoo",
  "page": 2,
  "safe": "moderate",
  "time_range": "month"
}

The same parameters can be sent to:

POST /v1/search

Complete Request Example

The following request uses all available Search request parameters:

curl -X POST "https://scraper.geonode.io/v1/search" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "web scraping best practice",
    "locale": "en-US",
    "engine": "yahoo",
    "page": 2,
    "safe": "moderate",
    "time_range": "month"
  }'

Parameter Summary

ParameterRequiredTypeDefaultAccepted values / limits
queryYesstring—1–1,000 characters
localeNostring—Language code, language-region tag, or all
engineNostringrotateduckduckgo, yahoo, naver, or omit
pageNointeger11–9 without pin; DuckDuckGo max 5, Yahoo/Naver max 9 when pinned
safeNostringoffoff, moderate, strict
time_rangeNostring—day, week, month, year (Yahoo: day/week/month only)

These are the complete request parameters defined by the current SearchRequest schema.


What's Next?

You now know how to configure a Search request.

Continue with Understanding Search Results to learn how the API structures the returned search results.

Was this page helpful?

On this page