> ## Documentation Index
> Fetch the complete documentation index at: https://newscatcherinc-docs.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get aggregation count by interval

> Retrieves the count of articles aggregated by day or hour based on various search criteria, such as keyword, language, country, and source.



## OpenAPI

````yaml news-api-v3 get /api/aggregation_count
openapi: 3.1.0
info:
  title: NewsCatcher News API
  description: >
    NewsCatcher News API provides programmatic access to a continuously updated
    global news index. It includes endpoints for article search, latest
    headlines, breaking news, author search, aggregation counts, and source
    discovery.


    ## Key features


    - **Full-text search**: Query articles by keyword, phrase, language,
    country, source, publication date, sentiment, and more using Boolean
    operators and advanced filters.

    - **NLP enrichment**: Articles include theme classification, sentiment
    scores, and named entity recognition (people, organizations, locations).

    - **Article clustering**: Group similar articles into clusters to reduce
    noise and surface unique stories.

    - **Deduplication**: Exclude duplicate articles from results to keep
    datasets clean and relevant.

    - **Source intelligence**: Discover and filter news sources by domain, type,
    rank, and geographic origin.


    For documentation, integration guides, and SDKs, visit the [developer
    portal](https://wwwnewscatcherapi.com/docs).
  termsOfService: https://newscatcherapi.com/terms-of-service
  contact:
    name: Maksym Sugonyaka
    email: maksym@newscatcherapi.com
  version: 3.24.0
servers:
  - url: https://v3-api.newscatcherapi.com
    description: News API production server
security:
  - ApiKeyAuth: []
tags:
  - name: Search
    description: Operations to search for articles.
    externalDocs:
      description: Search for articles by keyword, language, country, source, and more.
      url: >-
        https://www.newscatcherapi.com/docs/news-api/api-reference/search/search-articles-get
  - name: LatestHeadlines
    description: Operations to retrieve latest headlines.
    externalDocs:
      description: >-
        Retrieve the latest headlines since a specified date, with filtering
        options.
      url: >-
        https://www.newscatcherapi.com/docs/news-api/api-reference/latest-headlines/retrieve-latest-headlines-get
  - name: BreakingNews
    description: Operations to retrieve breaking news articles.
    externalDocs:
      description: Retrieve breaking news articles.
      url: >-
        https://www.newscatcherapi.com/docs/news-api/api-reference/breaking-news/breaking-news-get
  - name: Authors
    description: Operations to search by author.
    externalDocs:
      description: Search for articles by author.
      url: >-
        https://www.newscatcherapi.com/docs/news-api/api-reference/authors/search-articles-by-author-get
  - name: SearchByLink
    description: Operations to search by link or ID.
    externalDocs:
      description: Search for articles by link or ID.
      url: >-
        https://www.newscatcherapi.com/docs/news-api/api-reference/search-by-link/search-articles-by-links-or-ids-get
  - name: Sources
    description: Operations to retrieve news sources.
    externalDocs:
      description: >-
        Retrieve the list of available sources, filtered by language and
        country.
      url: >-
        https://www.newscatcherapi.com/docs/news-api/api-reference/sources/retrieve-sources-get
  - name: AggregationCount
    description: Operations to aggregate news counts.
    externalDocs:
      description: >-
        Aggregate news counts based on specified criteria such as keyword,
        language, country, source, and more.
      url: >-
        https://www.newscatcherapi.com/docs/news-api/api-reference/aggregation-count/get-aggregation-count-by-interval-get
  - name: Subscription
    description: Operations to get subscription info.
    externalDocs:
      description: Retrieve information about your subscription plan.
      url: >-
        https://www.newscatcherapi.com/docs/news-api/api-reference/subscription/retrieve-subscription-plan-information-get
externalDocs:
  description: Find out more about NewsCatcher News API
  url: https://www.newscatcherapi.com/docs
paths:
  /api/aggregation_count:
    get:
      tags:
        - AggregationCount
      summary: Get aggregation count by interval
      description: >-
        Retrieves the count of articles aggregated by day or hour based on
        various search criteria, such as keyword, language, country, and source.
      operationId: aggregationCountGet
      parameters:
        - $ref: '#/components/parameters/Q'
        - $ref: '#/components/parameters/AggregationBy'
        - $ref: '#/components/parameters/SearchIn'
        - $ref: '#/components/parameters/PredefinedSources'
        - $ref: '#/components/parameters/Sources'
        - $ref: '#/components/parameters/NotSources'
        - $ref: '#/components/parameters/Lang'
        - $ref: '#/components/parameters/NotLang'
        - $ref: '#/components/parameters/Countries'
        - $ref: '#/components/parameters/NotCountries'
        - $ref: '#/components/parameters/NotAuthorName'
        - $ref: '#/components/parameters/From'
        - $ref: '#/components/parameters/To'
        - $ref: '#/components/parameters/PublishedDatePrecision'
        - $ref: '#/components/parameters/ByParseDate'
        - $ref: '#/components/parameters/SortBy'
        - $ref: '#/components/parameters/RankedOnly'
        - $ref: '#/components/parameters/FromRank'
        - $ref: '#/components/parameters/ToRank'
        - $ref: '#/components/parameters/IsHeadline'
        - $ref: '#/components/parameters/IsOpinion'
        - $ref: '#/components/parameters/IsPaidContent'
        - $ref: '#/components/parameters/ParentUrl'
        - $ref: '#/components/parameters/AllLinks'
        - $ref: '#/components/parameters/AllDomainLinks'
        - $ref: '#/components/parameters/AllLinksText'
        - $ref: '#/components/parameters/WordCountMin'
        - $ref: '#/components/parameters/WordCountMax'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/IncludeNlpData'
        - $ref: '#/components/parameters/HasNlp'
        - $ref: '#/components/parameters/Theme'
        - $ref: '#/components/parameters/NotTheme'
        - $ref: '#/components/parameters/OrgEntityName'
        - $ref: '#/components/parameters/PerEntityName'
        - $ref: '#/components/parameters/LocEntityName'
        - $ref: '#/components/parameters/MiscEntityName'
        - $ref: '#/components/parameters/TitleSentimentMin'
        - $ref: '#/components/parameters/TitleSentimentMax'
        - $ref: '#/components/parameters/ContentSentimentMin'
        - $ref: '#/components/parameters/ContentSentimentMax'
        - $ref: '#/components/parameters/IptcTags'
        - $ref: '#/components/parameters/NotIptcTags'
        - $ref: '#/components/parameters/RobotsCompliant'
      responses:
        '200':
          $ref: '#/components/responses/AggregationCountResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '408':
          $ref: '#/components/responses/RequestTimeoutError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    Q:
      name: q
      in: query
      required: true
      schema:
        $ref: '#/components/schemas/Q'
    AggregationBy:
      name: aggregation_by
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/AggregationBy'
    SearchIn:
      name: search_in
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/SearchIn'
    PredefinedSources:
      description: >
        Predefined top news sources per country. 


        Format: start with the word `top`, followed by the number of desired
        sources, and then the two-letter country code [ISO 3166-1
        alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). 


        Multiple countries with the number of top sources can be specified as a
        comma-separated string.
      name: predefined_sources
      in: query
      required: false
      schema:
        type: string
        example: top 50 US, top 20 GB
    Sources:
      description: >
        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.
      name: sources
      in: query
      required: false
      schema:
        type: string
        example: nytimes.com,finance.yahoo.com
    NotSources:
      description: >
        The news sources to exclude from the search. To exclude multiple
        sources, use a comma-separated string.
      name: not_sources
      in: query
      required: false
      schema:
        type: string
        example: cnn.com,wsj.com
    Lang:
      description: >
        The language(s) of the search. The only accepted format is the
        two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To
        select multiple languages, use a comma-separated string.


        To learn more, see [Enumerated parameters >
        Language](https://www.newscatcherapi.com/docs/news-api/api-reference/enumerated-parameters#language-lang-and-not-lang).
      name: lang
      in: query
      required: false
      schema:
        type: string
        example: en,es
    NotLang:
      description: >
        The language(s) to exclude from the search. The accepted format is the
        two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To
        exclude multiple languages, use a comma-separated string. 


        To learn more, see [Enumerated parameters >
        Language](https://www.newscatcherapi.com/docs/news-api/api-reference/enumerated-parameters#language-lang-and-not-lang).
      name: not_lang
      in: query
      required: false
      schema:
        type: string
        example: fr,de
    Countries:
      description: >
        The countries where the news publisher is located. The accepted format
        is the two-letter [ISO 3166-1
        alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To
        select multiple countries, use a comma-separated string.


        To learn more, see [Enumerated parameters >
        Country](https://www.newscatcherapi.com/docs/news-api/api-reference/enumerated-parameters#country-country-and-not-country).
      name: countries
      in: query
      required: false
      schema:
        type: string
        example: US,CA
    NotCountries:
      description: >
        The publisher location countries to exclude from the search. The
        accepted format is the two-letter [ISO 3166-1
        alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To
        exclude multiple countries, use a comma-separated string. 


        To learn more, see [Enumerated parameters >
        Country](https://www.newscatcherapi.com/docs/news-api/api-reference/enumerated-parameters#country-country-and-not-country).
      name: not_countries
      in: query
      required: false
      schema:
        type: string
        example: UK,FR
    NotAuthorName:
      description: >
        The list of author names to exclude from your search. To exclude
        articles by specific authors, use a comma-separated string.
      name: not_author_name
      in: query
      required: false
      schema:
        type: string
        example: John Doe, Jane Doe
    From:
      name: from_
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/From'
    To:
      name: to_
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/To'
    PublishedDatePrecision:
      name: published_date_precision
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/PublishedDatePrecision'
    ByParseDate:
      name: by_parse_date
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ByParseDate'
    SortBy:
      name: sort_by
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/SortBy'
      example: date
    RankedOnly:
      name: ranked_only
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/RankedOnly'
    FromRank:
      name: from_rank
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/FromRank'
    ToRank:
      name: to_rank
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ToRank'
    IsHeadline:
      name: is_headline
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/IsHeadline'
    IsOpinion:
      name: is_opinion
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/IsOpinion'
    IsPaidContent:
      name: is_paid_content
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/IsPaidContent'
    ParentUrl:
      description: >
        The categorical URL(s) to filter your search. To filter your search by
        multiple categorical URLs, use a comma-separated string.
      name: parent_url
      in: query
      required: false
      schema:
        type: string
        example: wsj.com/politics,wsj.com/tech
    AllLinks:
      description: >
        The complete URL(s) mentioned in the article. For multiple URLs, use a
        comma-separated string.


        For more details, see [Search by
        URL](https://www.newscatcherapi.com/docs/news-api/how-to/search-by-url).
      name: all_links
      in: query
      required: false
      schema:
        type: string
        example: https://aiindex.stanford.edu/report,https://www.stateof.ai
    AllDomainLinks:
      description: >
        The domain(s) mentioned in the article. For multiple domains, use a
        comma-separated string.


        For more details, see [Search by
        URL](https://www.newscatcherapi.com/docs/news-api/how-to/search-by-url).
      name: all_domain_links
      in: query
      required: false
      schema:
        type: string
        example: who.int,nih.gov
    AllLinksText:
      description: >
        The text content of links mentioned in the article. Searches for links
        where the anchor text contains the specified terms. For multiple terms,
        use a comma-separated string.


        **Note**: When this parameter is used, the response includes the
        `all_links_data` field with detailed link information.


        To learn more, see [Search by
        URL](https://www.newscatcherapi.com/docs/news-api/how-to/search-by-url).
      name: all_links_text
      in: query
      required: false
      schema:
        type: string
        example: Nvidia,Tesla
    WordCountMin:
      name: word_count_min
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/WordCountMin'
    WordCountMax:
      name: word_count_max
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/WordCountMax'
    Page:
      name: page
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/Page'
    PageSize:
      name: page_size
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/PageSize'
    IncludeNlpData:
      name: include_nlp_data
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/IncludeNlpData'
    HasNlp:
      name: has_nlp
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/HasNlp'
    Theme:
      name: theme
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/Theme'
    NotTheme:
      name: not_theme
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/NotTheme'
    OrgEntityName:
      name: ORG_entity_name
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/OrgEntityName'
    PerEntityName:
      name: PER_entity_name
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/PerEntityName'
    LocEntityName:
      name: LOC_entity_name
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/LocEntityName'
    MiscEntityName:
      name: MISC_entity_name
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/MiscEntityName'
    TitleSentimentMin:
      name: title_sentiment_min
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/TitleSentimentMin'
    TitleSentimentMax:
      name: title_sentiment_max
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/TitleSentimentMax'
    ContentSentimentMin:
      name: content_sentiment_min
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ContentSentimentMin'
    ContentSentimentMax:
      name: content_sentiment_max
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ContentSentimentMax'
    IptcTags:
      description: >
        Filters articles based on International Press Telecommunications Council
        (IPTC) media topic tags. To specify multiple IPTC tags, use a
        comma-separated string of tag IDs. 


        **Note**: The `iptc_tags` parameter is only available in the
        `v3_nlp_iptc_tags` subscription plan.


        To learn more, see [IPTC Media Topic
        NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
      name: iptc_tags
      in: query
      required: false
      schema:
        type: string
        example: 20000199,20000209
    NotIptcTags:
      description: >
        Inverse of the `iptc_tags` parameter. Excludes articles based on
        International Press Telecommunications Council (IPTC) media topic tags.
        To specify multiple IPTC tags to exclude, use a comma-separated string
        of tag IDs.


        **Note**: The `not_iptc_tags` parameter is only available in the
        `v3_nlp_iptc_tags` subscription plan.


        To learn more, see [IPTC Media Topic
        NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
      name: not_iptc_tags
      in: query
      required: false
      schema:
        type: string
        example: 20000205,20000209
    RobotsCompliant:
      name: robots_compliant
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/RobotsCompliant'
  responses:
    AggregationCountResponse:
      description: >-
        A successful response containing aggregation count results that match
        the search criteria. If no matches, returns a failed aggregation
        response according to the defined schema.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/AggregationCountResponseDto'
              - $ref: '#/components/schemas/FailedAggregationCountResponseDto'
    BadRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Invalid JSON in request body
            status_code: 400
            status: Bad request
    UnauthorizedError:
      description: Unauthorized - Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: >-
              The 'x-api-token' parameter has an invalid value. Please provide a
              valid API key.
            status_code: 401
            status: Unauthorized
    ForbiddenError:
      description: Forbidden - Server refuses action
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Your plan request date range cannot be greater than 400 days
            status_code: 403
            status: Forbidden
    RequestTimeoutError:
      description: Request timeout
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Request timed out after 30 seconds
            status_code: 408
            status: Request timeout
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Invalid date format
            status_code: 422
            status: Validation error
    RateLimitError:
      description: Too many requests - Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Max API requests concurrency reached
            status_code: 429
            status: Too many requests
    InternalServerError:
      description: Internal server error
      content:
        text/plain:
          schema:
            type: string
          example: Internal Server Error
  schemas:
    Q:
      type: string
      description: >
        The keyword(s) to search for in articles. Query syntax supports logical
        operators (`AND`, `OR`, `NOT`) and wildcards:


        - For exact phrases, use escaped quotes: `\"technology news\"`

        - Use `*` for wildcards: `technolog*` (cannot start with `*`)

        - Use `+` to include and `-` to exclude: `+Apple`, `-Google`

        - Boolean operators: `technology AND (Apple OR Microsoft) NOT Google`

        - Forbidden characters: `[` `]` `/` `\\` `:` `^` and URL-encoded
        equivalents


        **Note:** The API automatically inserts `AND` operators between
        standalone terms, so strings like `"machine learning"` become `"machine
        AND learning"`. To avoid syntax errors (especially in queries with `OR`
        operators), use literal escape `"\"machine learning\""`.


        For detailed syntax rules, see [Advanced
        querying](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/advanced-querying).
      example: '"supply chain" AND Amazon NOT China'
    AggregationBy:
      type: string
      enum:
        - day
        - hour
        - month
      description: |
        The aggregation interval for the results.
      default: day
    SearchIn:
      type: string
      default: title_content
      description: >
        The article fields to search in. Use a comma-separated string for
        multiple options, with a maximum of 2 in a single request.


        Available options: 

        - Standard fields: `title`, `content`, `summary`, `title_content`

        - Translation fields: `title_translated`, `content_translated`,
        `summary_translated`, `title_content_translated`
      example: title_content, title_content_translated
    From:
      oneOf:
        - type: string
          format: date-time
          example: '2024-07-01T00:00:00.000Z'
        - type: string
          example: 1 day ago
      default: 7 days ago
      description: >
        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-07-01T00:00:00`

        - YYYY-MM-dd: `2024-07-01`

        - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`

        - YYYY/mm/dd: `2024/07/01`

        - English phrases: `7 day ago`, `today`

        - Duration shorthand: `7d`, `30d`, `24h`, `48h`


        **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: 2021/01/01
    To:
      oneOf:
        - type: string
          example: now
        - type: string
          format: date-time
          example: '2024-01-01T00:00:00.000Z'
      description: >
        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-07-01T00:00:00`

        - YYYY-MM-dd: `2024-07-01`

        - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`

        - YYYY/mm/dd: `2024/07/01`

        - English phrases: `1 day ago`, `now`

        - Duration shorthand: `7d`, `30d`, `24h`, `48h`


        **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`.
      default: now
    PublishedDatePrecision:
      type: string
      description: >
        The precision of the published date. There are three types:

        - `full`: The day and time of an article is correctly identified with
        the appropriate timezone.

        - `timezone unknown`: The day and time of an article is correctly
        identified without timezone.

        - `date`: Only the day is identified without an exact time.
      example: full
    ByParseDate:
      type: boolean
      default: false
      description: >
        If true, the `from_` and `to_` parameters use article parse dates
        instead of published dates. Additionally, the `parse_date` variable is
        added to the output for each article object.
      example: true
    SortBy:
      type: string
      enum:
        - relevancy
        - date
        - rank
      default: relevancy
      description: |
        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.
      example: date
    RankedOnly:
      type: boolean
      default: true
      description: >
        If true, limits the search to sources ranked in the top 1 million online
        websites. If false, includes unranked sources which are assigned a rank
        of 999999.
      example: true
    FromRank:
      type: integer
      minimum: 1
      maximum: 999999
      default: 1
      format: int32
      description: >
        The lowest boundary of the rank of a news website to filter by. A lower
        rank indicates a more popular source.
      example: 100
    ToRank:
      type: integer
      minimum: 1
      maximum: 999999
      default: 999999
      format: int32
      description: >
        The highest boundary of the rank of a news website to filter by. A lower
        rank indicates a more popular source.
      example: 100
    IsHeadline:
      type: boolean
      description: >
        If true, only returns articles that were posted on the home page of a
        given news domain.
      example: true
    IsOpinion:
      type: boolean
      description: >
        If true, returns only opinion pieces. If false, excludes opinion-based
        articles and returns news only.
      example: true
    IsPaidContent:
      type: boolean
      description: >
        Filters articles by content completeness.


        If false, returns only articles for which full-text content is publicly
        available. If true, returns all indexed articles, including those where
        only partial content is publicly available (e.g., headlines, summaries,
        or preview paragraphs from paywalled sources).


        **Note**: NewsCatcher indexes content that is publicly accessible and
        available for crawling in accordance with publisher access controls
        (e.g., robots.txt and similar mechanisms). For paywalled sources, only
        content that publishers make publicly available (such as headlines,
        summaries, or preview text) is indexed. NewsCatcher does not bypass
        paywalls, authentication systems, or other technical access
        restrictions.
      example: false
    WordCountMin:
      type: integer
      minimum: 0
      description: >
        The minimum number of words an article must contain. To be used for
        avoiding articles with small content.
      example: 300
    WordCountMax:
      type: integer
      minimum: 0
      description: |
        The maximum number of words an article can contain. 
        To be used for avoiding articles with large content.
      example: 1000
    Page:
      type: integer
      minimum: 1
      default: 1
      description: >
        The page number to scroll through the results. Use for pagination, as a
        single API response can return up to 1,000 articles. 


        For details, see [Retrieve large
        datasets](https://www.newscatcherapi.com/docs/news-api/how-to/retrieve-more-than-10k-articles)
      example: 2
    PageSize:
      type: integer
      minimum: 1
      maximum: 1000
      default: 100
      description: |
        The number of articles to return per page.
      example: 50
    IncludeNlpData:
      type: boolean
      default: false
      description: >
        If true, includes an NLP object for each article in the response. This
        object provides results of NLP analysis, including article theme,
        summary, sentiment, tags, and named entity recognition if available.


        **Note**: NLP data is only available for articles indexed from July 2023
        onward. For articles indexed before July 2023, the `nlp` field is
        returned as an empty object `{}`.


        To learn more, see [NLP
        features](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/nlp-features).
      example: true
    HasNlp:
      type: boolean
      default: false
      description: >
        If true, filters results to include only articles that have NLP data.


        **Note**: NLP data is only available for articles indexed from July 2023
        onward. Applying this filter to a date range that predates July 2023
        returns zero results.


        To learn more, see [NLP
        features](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/nlp-features).
      example: true
    Theme:
      type: string
      example: Finance,Tech
      description: >
        Filters articles based on their general topic, as determined by NLP
        analysis. To select multiple themes, use a comma-separated string.


        To learn more, see [NLP
        features](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/nlp-features).


        Available options: `Business`, `Economics`, `Entertainment`, `Finance`,
        `Health`, `Politics`, `Science`, `Sports`, `Tech`, `Crime`, `Financial
        Crime`, `Lifestyle`, `Automotive`, `Travel`, `Weather`, `General`.
    NotTheme:
      type: string
      example: Crime,Sports
      description: >
        Inverse of the `theme` parameter. Excludes articles based on their
        general topic, as determined by NLP analysis. To exclude multiple
        themes, use a comma-separated string.


        To learn more, see [NLP
        features](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/nlp-features).
    OrgEntityName:
      type: string
      description: >
        Filters articles that mention specific organization names, as identified
        by NLP analysis. 


        - To specify multiple organizations, use `AND`, `OR`, `NOT` operators,
        and `\"` escape literals for exact matches. 

        - To search in translations, combine with the translation options of the
        `search_in` parameter (e.g., `title_content_translated`).


        To learn more, see [Search by
        entity](https://www.newscatcherapi.com/docs/news-api/how-to/search-by-entity).
      example: '"Apple Inc" OR Microsoft'
    PerEntityName:
      type: string
      description: >
        Filters articles that mention specific person names, as identified by
        NLP analysis. 


        - To specify multiple names, use `AND`, `OR`, `NOT` operators, and `\"`
        escape literals for exact matches. 

        - To search in translations, combine with the translation options of the
        `search_in` parameter (e.g., `title_content_translated`).


        To learn more, see [Search by
        entity](https://www.newscatcherapi.com/docs/news-api/how-to/search-by-entity).
      example: '"Elon Musk" OR "Jeff Bezos"'
    LocEntityName:
      type: string
      description: >
        Filters articles that mention specific location names, as identified by
        NLP analysis.


        - To specify multiple locations, use `AND`, `OR`, `NOT` operators, and
        `\"` escape literals for exact matches. 

        - To search in translations, combine with the translation options of the
        `search_in` parameter (e.g., `title_content_translated`).


        To learn more, see [Search by
        entity](https://www.newscatcherapi.com/docs/news-api/how-to/search-by-entity).
      example: '"San Francisco" OR "New York City"'
    MiscEntityName:
      type: string
      description: >
        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 `AND`, `OR`, `NOT` operators, and
        `\"` escape literals for exact matches. 

        - To search in translations, combine with the translation options of the
        `search_in` parameter (e.g., `title_content_translated`).


        To learn more, see [Search by
        entity](https://www.newscatcherapi.com/docs/news-api/how-to/search-by-entity).
      example: AWS OR "Microsoft Azure"
    TitleSentimentMin:
      type: number
      format: float
      minimum: -1
      maximum: 1
      description: >
        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](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/nlp-features).
      example: -0.5
    TitleSentimentMax:
      type: number
      format: float
      minimum: -1
      maximum: 1
      description: >
        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](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/nlp-features).
      example: 0.5
    ContentSentimentMin:
      type: number
      format: float
      minimum: -1
      maximum: 1
      description: >
        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](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/nlp-features).
      example: -0.5
    ContentSentimentMax:
      type: number
      format: float
      minimum: -1
      maximum: 1
      description: >
        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](https://www.newscatcherapi.com/docs/news-api/guides-and-concepts/nlp-features).
      example: 0.5
    RobotsCompliant:
      type: boolean
      description: >
        If true, returns only articles that comply with the publisher's
        robots.txt rules. If false, returns only articles that do not comply
        with robots.txt rules. If omitted, returns all articles regardless of
        compliance status.
      example: true
    AggregationCountResponseDto:
      title: Aggregation Response
      description: >
        The response model for a successful `Aggregation count` request.
        Response field behavior:

        - Required fields are guaranteed to be present and non-null. 

        - Optional fields may be `null` or `undefined` if the data point is not
        presented or couldn't be extracted during processing.
      allOf:
        - $ref: '#/components/schemas/BaseSearchResponseDto'
        - type: object
          properties:
            aggregations:
              title: Aggregations
              description: >-
                The aggregation results. Can be either a dictionary or a list of
                dictionaries.
              oneOf:
                - $ref: '#/components/schemas/AggregationItem'
                - type: array
                  items:
                    $ref: '#/components/schemas/AggregationItem'
            user_input:
              $ref: '#/components/schemas/UserInputDto'
    FailedAggregationCountResponseDto:
      title: Failed Aggregation Response
      description: The response model for a failed `Aggregation count` request.
      allOf:
        - $ref: '#/components/schemas/BaseSearchResponseDto'
        - type: object
          properties:
            user_input:
              $ref: '#/components/schemas/UserInputDto'
    Error:
      type: object
      properties:
        message:
          type: string
          description: A detailed description of the error.
        status_code:
          type: integer
          description: The HTTP status code of the error.
        status:
          type: string
          description: A short description of the status code.
      required:
        - message
        - status_code
        - status
    BaseSearchResponseDto:
      title: Base Search Response
      description: The base response model containing common fields for search operations.
      required:
        - status
        - total_hits
        - page
        - total_pages
        - page_size
      type: object
      properties:
        status:
          title: Status
          description: The status of the response.
          type: string
        total_hits:
          title: Total Hits
          description: The total number of articles matching the search criteria.
          type: integer
        page:
          title: Page
          description: The current page number of the results.
          type: integer
        total_pages:
          title: Total Pages
          description: The total number of pages available for the given search criteria.
          type: integer
        page_size:
          title: Page Size
          description: The number of articles per page.
          type: integer
    AggregationItem:
      title: Aggregation Item
      description: >
        A single item in the aggregations array containing a collection of
        time-based article counts.
      required:
        - aggregation_count
      type: object
      properties:
        aggregation_count:
          type: array
          description: Array of time frames and their corresponding article counts
          items:
            $ref: '#/components/schemas/TimeFrameCount'
    UserInputDto:
      type: object
      description: The user input parameters for the request.
      additionalProperties: true
    TimeFrameCount:
      title: Time Frame Count
      description: |
        Represents the article count for a specific time frame.
      required:
        - time_frame
        - article_count
      type: object
      properties:
        time_frame:
          type: string
          format: date-time
          description: >-
            The timestamp for the aggregation period in format "YYYY-MM-DD
            HH:mm:ss"
          example: '2024-12-31 00:00:00'
        article_count:
          type: integer
          description: The number of articles published during this time frame
          example: 86
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-token
      description: >
        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](https://www.newscatcherapi.com/book-a-demo) or contact us
        directly.

````