Query Parameters

# News Search API

This table lists the query parameters supported by the News Search API. Some are required, but most are optional.

Parameter Required Type Default Description
q yes string none

The user's search query term.

Query can not be empty. Maximum of 400 characters and 50 words in the query.

country no string us

The search query country, where the results come from.

The country string is limited to 2 character country codes of supported countries. For a list of supported values, see Country Codes.

search_lang no string en

The search language preference.

The 2 or more character language code for which the search results are provided. For a list of possible values, see Language Codes.

ui_lang no string en-US

User interface language preferred in response.

Usually of the format <language_code>-<country_code>, see RFC 9110. For a list of supported values, see UI Language Codes.

count no int 20

The number of search results returned in response.

The maximum is 100. The actual number delivered may be less than requested. Combine this parameter with offset to paginate search results.

offset no int 0

The zero-based offset that indicates the number of news search results per page (count) to skip before returning the result. The maximum is 9. The actual number delivered may be less than requested based on the query.

In order to paginate results use this parameter together with count. For example, if your user interface displays 20 news search results per page, set count to 20 and offset to 0 to show the first page of results. To get subsequent pages, increment offset by 1 (e.g. 0, 1, 2). The results may overlap across multiple pages.

safesearch no string strict

Filters search results for adult content.

The following values are supported:

off
Adult content is included where relevant.
moderate
Adult text but no adult images or videos.
strict
No adult content with adult text, images, and videos.
spellcheck no bool 1 Whether to enable spell checker.
freshness no string none

Filters news search results by when they were discovered.

Defaults to None. The following time deltas are supported:

pd
Discovered within the last 24 hours.
pw
Discovered within the last 7 Days.
pm
Discovered within the last 31 Days.
py
Discovered within the last 365 Days.
YYYY-MM-DDtoYYYY-MM-DD
A timeframe is also supported by specifying the date range e.g. 2022-04-01to2022-07-30.
extra_snippets no bool none A snippet is an excerpt from a page you get as a result of the query, and extra_snippets allow you to get up to 5 additional, alternative excerpts. Only available under Free AI, Base AI, Pro AI, Base Data, Pro Data and Custom plans.