POST
/
api
/
search
curl --request POST \
  --url https://local-news.newscatcherapi.com/api/search \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '{
  "q": "technology AND (Apple OR Microsoft) NOT Google",
  "from_": "2024/09/24",
  "to_": "2024/09/25",
  "search_in": "title,content",
  "sort_by": "date",
  "locations": [
    "New York City, New York",
    "Los Angeles, California"
  ],
  "detection_methods": [
    "dedicated_source",
    "proximity_mention",
    "ai_extracted"
  ],
  "lang": [
    "en",
    "es"
  ],
  "sources": [
    "nytimes.com",
    "theguardian.com"
  ],
  "not_sources": [
    "cnn.com",
    "wsj.com"
  ],
  "parent_url": [
    "wsj.com/politics",
    "wsj.com/tech"
  ],
  "is_paid_content": false,
  "page": 2,
  "page_size": 100,
  "word_count_min": 300,
  "word_count_max": 1000,
  "clustering": true,
  "theme": [
    "Business",
    "Finance"
  ],
  "PER_entity_name": [
    "Elon Musk",
    "Jeff Bezos"
  ],
  "LOC_entity_name": [
    "California",
    "New York"
  ],
  "MISC_entity_name": [
    "Bitcoin",
    "Blockchain"
  ],
  "ORG_entity_name": [
    "Apple",
    "Microsoft"
  ],
  "title_sentiment_min": -0.5,
  "title_sentiment_max": 0.5,
  "content_sentiment_min": -0.5,
  "content_sentiment_max": 0.5
}'
{
  "status": "ok",
  "total_hits": 123,
  "page": 123,
  "total_pages": 123,
  "page_size": 123,
  "articles": [],
  "user_input": {}
}

Authorizations

x-api-token
string
header
required

API Key to authenticate requests.

To access the API, include your API key in the x-api-token header. To obtain your API key, complete the form or contact us directly.

Body

application/json
q
string
default:*

The keyword(s) to search for in articles. Query syntax supports logical operators (AND, OR, NOT) and wildcards:

  • For an exact match, use double quotes. For example, "technology news".
  • Use * to search for any keyword.
  • Use + to include and - to exclude specific words or phrases. For example, +Apple, -Google.
  • Use AND, OR, and NOT to refine search results. For example, technology AND (Apple OR Microsoft) NOT Google.

For more details, see Advanced querying.

Example:

"technology AND (Apple OR Microsoft) NOT Google"

from_
default:7 days ago

The starting point in time to search from. Accepts date-time strings in ISO 8601 format and plain text strings. The default time zone is UTC.

Formats with examples:

  • YYYY-mm-ddTHH:MM:SS: 2024-09-24T00:00:00
  • YYYY-MM-dd: 2024-09-24
  • YYYY/mm/dd HH:MM:SS: 2024/09/24 00:00:00
  • YYYY/mm/dd: 2024/09/24
  • English phrases: 1 day ago, today

Note: By default, applied to the publication date of the article. To use the article's parse date instead, set the by_parse_date parameter to true.

Example:

"2024/09/24"

to_
default:now

The ending point in time to search up to. Accepts date-time strings in ISO 8601 format and plain text strings. The default time zone is UTC.

Formats with examples:

  • YYYY-mm-ddTHH:MM:SS: 2024-09-25T00:00:00
  • YYYY-MM-dd: 2024-09-25
  • YYYY/mm/dd HH:MM:SS: 2024/09/25 00:00:00
  • YYYY/mm/dd: 2024/09/25
  • English phrases: 1 day ago, today, now

Note: By default, applied to the publication date of the article. To use the article's parse date instead, set the by_parse_date parameter to true.

Example:

"2024/09/25"

search_in
string
default:title,content

The article fields to search in. To search in multiple fields, use a comma-separated string.

Example: "title, summary"

Available options: title, summary, content.

Example:

"title,content"

sort_by
enum<string>
default:relevancy

The sorting order of the results. Possible values are:

  • relevancy: The most relevant results first.
  • date: The most recently published results first.
  • rank: The results from the highest-ranked sources first.
Available options:
relevancy,
date,
rank
Example:

"date"

locations
string[]

The location(s) to search for in articles. Format should be "City, State".

Example: ["San Francisco, California"]

Example:
[
  "New York City, New York",
  "Los Angeles, California"
]
detection_methods
enum<string>[]

The location detection methods to filter results by:

  • dedicated_source: Identifies locations based on sources exclusively covering a specific location.
  • local_section: Identifies locations through location-specific sections within larger publications.
  • regional_source: Identifies locations using regional context from state-level publications.
  • standard_format: Identifies locations written in standard formats like "City, State" or "City, County".
  • proximity_mention: Identifies cities and states mentioned within 15 words of each other.
  • ai_extracted: Identifies locations through AI-based content analysis. Requires AI Extraction plan.

For detailed information, see Location detection methods.

Available options:
dedicated_source,
local_section,
regional_source,
standard_format,
proximity_mention,
ai_extracted
Example:
[
  "dedicated_source",
  "proximity_mention",
  "ai_extracted"
]
lang

The language(s) of the search. The only accepted format is the two-letter ISO 639-1 code. To select multiple languages, use a comma-separated string or an array of strings.

Examples:

  • "en,es"
  • ["en", "es"]

To learn more, see Enumerated parameters > Language.

Example:
["en", "es"]
sources

One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as finance.yahoo.com, are also acceptable. To specify multiple sources, use a comma-separated string or an array of strings.

Examples:

  • "nytimes.com, theguardian.com"
  • ["nytimes.com", "theguardian.com"]
Example:
["nytimes.com", "theguardian.com"]
not_sources

The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string or an array of strings.

Examples:

  • "cnn.com, wsj.com"
  • ["cnn.com", "wsj.com"]
Example:
["cnn.com", "wsj.com"]
parent_url

The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string or an array of strings.

Examples:

  • "wsj.com/politics,wsj.com/tech"
  • ["wsj.com/politics", "wsj.com/tech"]
Example:
["wsj.com/politics", "wsj.com/tech"]
is_paid_content
boolean

If false, returns only articles that have publicly available complete content. Some publishers partially block content, so this setting ensures that only full articles are retrieved.

Example:

false

page
integer
default:1

The page number to scroll through the results. This parameter is used to paginate: scroll through results because one API response cannot return more than 1000 articles.

Required range: x >= 1
Example:

2

page_size
integer
default:100

The number of articles to return per page. Range: 1 to 1000.

Required range: 1 <= x <= 1000
Example:

100

word_count_min
integer

The minimum number of words an article must contain. To be used for avoiding articles with small content.

Required range: x >= 0
Example:

300

word_count_max
integer

The maximum number of words an article can contain. To be used for avoiding articles with large content.

Required range: x >= 0
Example:

1000

clustering
boolean
default:false

Determines whether to group similar articles into clusters. If true, the API returns clustered results.

To learn more, see Clustering news articles.

Example:

true

theme

Filters articles based on their general topic, as determined by NLP analysis. To select multiple themes, use a comma-separated string or an array of strings.

Examples:

  • "Finance, Tech"
  • ["Finance", "Tech"]

To learn more, see NLP features.

Available options: Business, Economics, Entertainment, Finance, Health, Politics, Science, Sports, Tech, Crime, Financial Crime, Lifestyle, Automotive, Travel, Weather, General.

Example:
["Business", "Finance"]
PER_entity_name

Filters articles that mention specific person names, as identified by NLP analysis. To specify multiple names, use a comma-separated string or an array of strings.

Examples:

  • "Elon Musk, Jeff Bezos"
  • ["Elon Musk", "Jeff Bezos"]

To learn more, see Search by entity.

Example:
["Elon Musk", "Jeff Bezos"]
LOC_entity_name

Filters articles that mention specific location names, as identified by NLP analysis. To specify multiple locations, use a comma-separated string or an array of strings.

Examples:

  • "California, New York"
  • ["California", "New York"]

To learn more, see Search by entity.

Example:
["California", "New York"]
MISC_entity_name

Filters articles that mention other named entities not falling under person, organization, or location categories. Includes events, nationalities, products, works of art, and more. To specify multiple entities, use a comma-separated string or an array of strings.

Examples:

  • "Bitcoin, Blockchain"
  • ["Bitcoin", "Blockchain"]

To learn more, see Search by entity.

Example:
["Bitcoin", "Blockchain"]
ORG_entity_name

Filters articles that mention specific organization names, as identified by NLP analysis. To specify multiple organizations, use a comma-separated string or an array of strings.

Examples:

  • "Apple, Microsoft"
  • ["Apple", "Microsoft"]

To learn more, see Search by entity.

Example:
["Apple", "Microsoft"]
title_sentiment_min
number

Filters articles based on the minimum sentiment score of their titles.

Range is -1.0 to 1.0, where:

  • Negative values indicate negative sentiment.
  • Positive values indicate positive sentiment.
  • Values close to 0 indicate neutral sentiment.

To learn more, see NLP features.

Required range: -1 <= x <= 1
Example:

-0.5

title_sentiment_max
number

Filters articles based on the maximum sentiment score of their titles.

Range is -1.0 to 1.0, where:

  • Negative values indicate negative sentiment.
  • Positive values indicate positive sentiment.
  • Values close to 0 indicate neutral sentiment.

To learn more, see NLP features.

Required range: -1 <= x <= 1
Example:

0.5

content_sentiment_min
number

Filters articles based on the minimum sentiment score of their content.

Range is -1.0 to 1.0, where:

  • Negative values indicate negative sentiment.
  • Positive values indicate positive sentiment.
  • Values close to 0 indicate neutral sentiment.

To learn more, see NLP features.

Required range: -1 <= x <= 1
Example:

-0.5

content_sentiment_max
number

Filters articles based on the maximum sentiment score of their content.

Range is -1.0 to 1.0, where:

  • Negative values indicate negative sentiment.
  • Positive values indicate positive sentiment.
  • Values close to 0 indicate neutral sentiment.

To learn more, see NLP features.

Required range: -1 <= x <= 1
Example:

0.5

Response

200
application/json
A successful response containing articles that match the specified search criteria. The response may include clustering information if enabled.

The response model for the Search, Latest headlines, and Search by requests, including search results and metadata.

Response field behavior:

  • Required fields are guaranteed to be present and non-null.
  • Optional fields may be null/undefined if the data couldn't be extracted during processing.
  • To access article properties in the articles response array, use array index notation. For example, articles[n].title, where n is the zero-based index of the article object (0, 1, 2, etc.).
status
string
default:ok
required

The status of the response.

total_hits
integer
required

The total number of articles matching the search criteria.

page
integer
required

The current page number of the results.

total_pages
integer
required

The total number of pages available for the given search criteria.

page_size
integer
required

The number of articles per page.

articles
object[]

A list of articles matching the search criteria.

The data model representing a single article in the search results. Required fields are always non-null. Optional fields may be null/undefined if data extraction is unsuccessful.

user_input
object

The user input parameters for the search.