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.

GEThttps://apis.newssearchapi.com/v1/countsAPI key

Parameters

  • qarrayqueryRequired

    Search query in /v1/articles syntax (max 500 characters). Repeat 1–5 times for one series per query; values must be distinct.

    Example
    electric vehicles
  • fromstringquery

    First UTC day to count (inclusive), YYYY-MM-DD. Defaults to 29 days before to.

    Example
    2026-10-01
  • tostringquery

    Last UTC day to count (inclusive), YYYY-MM-DD. Defaults to today (UTC).

    Example
    2026-10-31
  • intervalstringquery

    Bucket size; week buckets are ISO weeks dated by their Monday.

    Default
    day
    One of
    dayweek
  • countrystringquery

    Comma-separated ISO 3166-1 alpha-2 codes (max 10, case-insensitive). Matches any of them.

    Example
    us,gb
  • categorystringquery

    Comma-separated categories (max 10, each 1–50 characters). Matches articles having any of them (case-insensitive, exact match).

    Example
    business,technology
  • languagestringquery

    Comma-separated ISO 639-1 codes (max 10, case-insensitive). Matches any of them.

    Example
    en,fr
  • sourcestringquery

    Comma-separated publisher domains (max 10); matching includes subdomains.

    Example
    example.com,news.example.org
  • minTrustnumberquery

    Count only articles with a trust score of at least this value.

    Example
    0.6
  • dedupebooleanquery

    Count each story once.

    Default
    false

Response 200 · application/json

One series per query plus share of voice.

  • statusstringalways
  • fromstringalways

    First counted UTC day (inclusive).

  • tostringalways

    Last counted UTC day (inclusive).

  • intervalstringalways

    One of dayweek

  • seriesobject[]always

    One entry per q, in request order.

    Show 6 child fields
    • querystring

      The q value as sent.

    • totalinteger

      Matching articles in the whole range.

    • bucketsobject[]

      Article count per interval, oldest first.

      Show 2 child fields
      • datestring

        First UTC day of the bucket (Monday for weeks).

      • countinteger
    • topSourcesobject[]

      Up to 5 publisher domains with the most matches.

      Show 2 child fields
      • sourcestring
      • countinteger
    • topCountriesobject[]

      Up to 5 lowercase country codes with the most matches.

      Show 2 child fields
      • countrystring
      • countinteger
    • topLanguagesobject[]

      Up to 5 ISO 639-1 language codes with the most matches.

      Show 2 child fields
      • languagestring
      • countinteger
  • shareOfVoiceobject[]always

    Each query's percentage of the summed totals (one decimal; all 0 when the sum is 0).

    Show 2 child fields
    • querystring
    • percentnumber

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.
Stuck or found a mistake?Email developer support

Esc to close · ↑↓ Tab to move through results