AggregationCount

Aggregate article counts

Returns article counts bucketed over time instead of individual articles. Supports the same filtering parameters as /api/search (keyword, language, country, source, date range, and more); aggregate_by controls the bucket granularity (day, hour, week, or month; defaults to day). Useful for estimating result volume before running a full search.

post/api/aggregation_count

Request

  • Base URL
    https://v3-api.newscatcherapi.com (the document declares no server; this is the origin it was published from)
  • Auth
    none declared. Required headers: x-api-token

Headers

x-api-tokenstring required

Your NewsCatcher API key, used to authenticate this request.

Request body

qstring required

Search query using Lucene-like syntax: supports boolean operators (AND, OR, NOT, and &&, ||, ! as aliases), exact phrase matching with double quotes, grouping with parentheses, and wildcards. Cannot be empty.

search_instring

Which fields to search the query against. Up to 2 values from: title, content, title_content, summary (summary requires an NLP plan). NLP/translation plans additionally allow searching translated fields: title_translated, content_translated, summary_translated, title_content_translated.

predefined_sourcesunknown
sourcesunknown
not_sourcesunknown
langunknown
not_langunknown
countriesunknown
not_countriesunknown
not_author_nameunknown
published_date_precisionstring

Filter by how precisely the published date is known: 'full' (exact date and time), 'date' (day known, time unknown), or 'timezone unknown' (date and time known, but not the timezone).

by_parse_dateboolean

When true, the date range and sorting apply to the date NewsCatcher parsed/ingested the article instead of its published date.

sort_bystring

Sort order for results: 'relevancy' (default, best text match first), 'date' (newest first), '-date' (oldest first), or 'rank' (most authoritative source first).

from_rankinteger

Minimum source rank (lower rank = more authoritative/popular source). Integer between 1 and 999999.

to_rankinteger

Maximum source rank (lower rank = more authoritative/popular source). Integer between 1 and 999999.

parent_urlunknown
all_linksunknown
all_domain_linksunknown
all_links_textunknown
word_count_mininteger

Minimum article word count. Must be non-negative, and less than word_count_max if both are set.

word_count_maxinteger

Maximum article word count. Must be non-negative, and greater than word_count_min if both are set.

pageinteger

Page number of results to return, starting at 1.

page_sizeinteger

Number of articles per page. Integer between 1 and 1000.

clustering_variablestring

Which article field to base clustering similarity on: 'content', 'title', or 'summary'.

clustering_thresholdnumber

Similarity threshold for clustering, greater than 0 and up to 1 inclusive. Higher values require greater similarity to group articles into the same cluster.

include_nlp_databoolean

For NLP-enabled plans, controls whether the nlp object is included in the response for each article (excluded by default). Basic plan always includes nlp.theme regardless of this setting.

has_nlpboolean

When true, only returns articles that have NLP enrichment data. Requires an NLP plan.

themestring

Filter by article theme. One of: Business, Politics, Entertainment, Sports, Finance, Crime, Tech, General, Health, Economics, Science, Automotive, Weather, Travel, Lifestyle, Financial Crime. Comma-separated values are OR'd together; values joined with ' AND ' within one comma-separated group must all match the same article (e.g. 'Tech AND Finance,Sports' matches Tech-and-Finance articles, or Sports articles).

not_themestring

Exclude articles with any of the given themes. Same allowed values as theme, but does not support ' AND ' grouping - always excludes on any match.

ORG_entity_namestring

Filter articles that mention the given organization name(s) in NLP-extracted named entities. Requires an NLP plan.

PER_entity_namestring

Filter articles that mention the given person name(s) in NLP-extracted named entities. Requires an NLP plan.

LOC_entity_namestring

Filter articles that mention the given location name(s) in NLP-extracted named entities. Requires an NLP plan.

MISC_entity_namestring

Filter articles that mention the given miscellaneous entity name(s) in NLP-extracted named entities. Requires an NLP plan.

title_sentiment_minnumber

Minimum sentiment score for the article title, from -1 (most negative) to 1 (most positive), as determined by NLP analysis. Requires an NLP plan.

title_sentiment_maxnumber

Maximum sentiment score for the article title, from -1 (most negative) to 1 (most positive), as determined by NLP analysis. Requires an NLP plan.

content_sentiment_minnumber

Minimum sentiment score for the article content, from -1 (most negative) to 1 (most positive), as determined by NLP analysis. Requires an NLP plan.

content_sentiment_maxnumber

Maximum sentiment score for the article content, from -1 (most negative) to 1 (most positive), as determined by NLP analysis. Requires an NLP plan.

iptc_tagsunknown
not_iptc_tagsunknown
aggregation_bystring

Deprecated alias for aggregate_by - only one of the two may be set; whichever is set is copied to the other.

aggregate_bystring

Time interval to aggregate article counts by: 'day', 'hour', 'week', or 'month'.

Response

Successful Response

statusstring

Always 'ok' for a successful aggregation request.

total_hitsinteger required

Total number of articles matching the query filters, across the full date range (not limited by page_size).

pageinteger required

Page number echoed from the request. Aggregation buckets are not paginated - the full set of buckets for the date range is always returned regardless of page.

total_pagesinteger required

Total number of pages implied by total_hits and page_size, for reference only - the aggregations list itself is not split across pages.

page_sizeinteger required

Page size echoed from the request. Used only to compute total_pages; does not limit the number of aggregation buckets returned.

user_inputobject required

Echo of the request parameters that produced this response.

Changes

No recorded changes to this operation across all 1 revision of this API.