Count articles over time
News Intelligence: daily or weekly article volume for 1–5 queries over the same filters, with each query's top 5 sources, countries and languages, and its share of voice (total / sum of totals × 100, one decimal; all 0 when nothing matched). Use it for trend charts and to compare topics, brands or people. Repeat q once per query (the only parameter that may be repeated); each q uses the /v1/articles search syntax and the series are returned in request order. from/to are inclusive UTC days and default to the last 30 days; a range may span at most 366 days. Week buckets are ISO weeks starting Monday. A successful request costs one search base charge, regardless of the range or number of queries; errors cost nothing. A query the archive rejects as too broad returns 400; narrow the range or add filters.
https://apis.newssearchapi.com/v1/countsAPI keyParameters
qarrayqueryRequiredSearch query in
/v1/articlessyntax (max 500 characters). Repeat 1–5 times for one series per query; values must be distinct.fromstringqueryFirst UTC day to count (inclusive),
YYYY-MM-DD. Defaults to 29 days beforeto.tostringqueryLast UTC day to count (inclusive),
YYYY-MM-DD. Defaults to today (UTC).intervalstringqueryBucket size;
weekbuckets are ISO weeks dated by their Monday.countrystringqueryComma-separated ISO 3166-1 alpha-2 codes (max 10, case-insensitive). Matches any of them.
categorystringqueryComma-separated categories (max 10, each 1–50 characters). Matches articles having any of them (case-insensitive, exact match).
languagestringqueryComma-separated ISO 639-1 codes (max 10, case-insensitive). Matches any of them.
sourcestringqueryComma-separated publisher domains (max 10); matching includes subdomains.
minTrustnumberqueryCount only articles with a trust score of at least this value.
dedupebooleanqueryCount each story once.
Response
One series per query plus share of voice.
statusstringalwaysfromstringalwaysFirst counted UTC day (inclusive).
tostringalwaysLast counted UTC day (inclusive).
intervalstringalwaysOne of
dayweekseriesobject[]alwaysOne entry per
q, in request order.Show 6 child fields
querystringThe
qvalue as sent.totalintegerMatching articles in the whole range.
bucketsobject[]Article count per interval, oldest first.
Show 2 child fields
datestringFirst UTC day of the bucket (Monday for weeks).
countinteger
topSourcesobject[]Up to 5 publisher domains with the most matches.
Show 2 child fields
sourcestringcountinteger
topCountriesobject[]Up to 5 lowercase country codes with the most matches.
Show 2 child fields
countrystringcountinteger
topLanguagesobject[]Up to 5 ISO 639-1 language codes with the most matches.
Show 2 child fields
languagestringcountinteger
shareOfVoiceobject[]alwaysEach query's percentage of the summed totals (one decimal; all 0 when the sum is 0).
Show 2 child fields
querystringpercentnumber
Errors
Every error uses the same envelope with a stable code. See error handling for which ones to retry.
- 400Invalid parameter, or a query the archive rejects as too broad; no credits are charged.
- 401Missing (`apiKeyMissing`) or invalid (`apiKeyInvalid`) API key.
- 402Sharedstack could not reserve the maximum charge for this article request (`insufficientCredits`). `X-Credits-Remaining` is `unknown` if Stack does not return a balance.
- 403No active sharedstack plan or subscription; no credits are charged. Revoked-key responses may omit these headers.
- 405Only GET, HEAD and OPTIONS are supported (`methodNotAllowed`).
- 429The uniform gateway rate limit was exceeded; no credits are charged.
- 500Unexpected server error after authentication; no credits are charged.
- 503Dependency unavailable after authentication; no credits are charged.