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

# Mention volume over time

> Returns mention volume aggregated into time buckets over the requested date
range. Use the optional `group_by` parameter to add a secondary breakdown
within each bucket by any filterable dimension (e.g., channel, language,
bot rating, smart category, etc.), and the optional `metric` parameter to
measure reach or an integer custom enrichment instead of mention counts.

The bucket size follows the length of the requested range: hourly up to
10 days, daily up to 100 days, weekly up to about six months, monthly
beyond that. Each bucket's `date` is its start, in UTC.

All standard mention filters can be applied to narrow the results.




## OpenAPI

````yaml /api/api_docs.yaml get /workspaces/{workspaceId}/analytics/timeline
openapi: 3.1.0
info:
  title: PeakMetrics API
  description: >
    The PeakMetrics API provides programmatic access to narrative intelligence
    data.


    Access millions of mentions across news, social media, and online platforms,
    enriched with custom AI-powered

    smart categories and over 50 metadata properties. The API enables you to

    identify, analyze, and act on emerging narratives in real-time.
  version: 2.0.0
servers:
  - url: https://api.peakmetrics.com
    description: Main (production) server
security:
  - BearerAuth: []
tags:
  - name: Authorization
  - name: Workspaces
  - name: Explore
    description: >
      Run an ad-hoc [Explore](/help/get-started-with-peakmetrics/explore) query
      without creating a workspace, and get back Volume Over Time (`POST
      /explore/analytics/timeline`) or a Channel, Language, or Domain
      distribution (`POST /explore/analytics/distribution`).


      Both endpoints use the same Bearer JWT authentication as the rest of the
      API and take their parameters as a JSON body.


      ### Rate limits and quota


      - **5 queries per user per minute**, shared across both Explore endpoints.
      The minute is a fixed window of 60 seconds from the first request in the
      window. Exceeding it returns a `429` with `error: "rate_limited"` and
      `retryAfterSeconds`.

      - **1,000 queries per user per endpoint per month.** Each endpoint has its
      own monthly allowance, which resets at the start of each calendar month
      (UTC). Exceeding it returns a `429` with `error: "quota_exceeded"` and
      `retryAfterSeconds` set to the time until the reset.


      Every request counts toward the per-minute limit; only successful (`200`)
      requests count toward the monthly quota.


      Both limits are shared with the Explore tools in the [PeakMetrics MCP
      server](/mcp/capabilities), so queries your AI assistant runs there count
      toward the same totals.
  - name: Folders
  - name: Channels
  - name: Locations
    description: >
      PeakMetrics resolves a normalized location on mentions across every
      channel, using a

      six-level taxonomy: `region`, `subregion`, `country`, `state`, `county`,
      and `city`.

      `state` and `county` are United States only.


      Look locations up with `GET /locations`, read a mention's resolved
      location from the

      `location` object on `GET /workspaces/{workspaceId}/mentions`, filter the
      mentions,

      timeline, or distribution endpoints with the `locations.<level>`
      parameters, and

      break counts down with the matching `locations.<level>` `group_by` values.
  - name: Custom Channels
  - name: Custom Enrichments
    description: >
      Custom enrichments let you push external context about mentions into
      PeakMetrics,

      attached to individual mentions and used alongside all other mention
      metadata across

      the platform. Once written, enrichment values feed into narrative
      analysis, workspace

      summaries, and notifications, and are available through the customer API
      and the MCP

      server.


      Your team manages its own custom enrichments through the API: create one
      with

      `POST /customEnrichments`, list them with `GET /customEnrichments`, rename
      one or

      replace its option list with `PUT /customEnrichments/{enrichmentId}`,
      retire one with

      `DELETE /customEnrichments/{enrichmentId}`, and push values for individual
      mentions

      with `PUT /mentions/customEnrichments`.
paths:
  /workspaces/{workspaceId}/analytics/timeline:
    get:
      tags:
        - Workspaces
      summary: Mention volume over time
      description: >
        Returns mention volume aggregated into time buckets over the requested
        date

        range. Use the optional `group_by` parameter to add a secondary
        breakdown

        within each bucket by any filterable dimension (e.g., channel, language,

        bot rating, smart category, etc.), and the optional `metric` parameter
        to

        measure reach or an integer custom enrichment instead of mention counts.


        The bucket size follows the length of the requested range: hourly up to

        10 days, daily up to 100 days, weekly up to about six months, monthly

        beyond that. Each bucket's `date` is its start, in UTC.


        All standard mention filters can be applied to narrow the results.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/Since'
        - $ref: '#/components/parameters/To'
        - $ref: '#/components/parameters/GroupByTimeline'
        - $ref: '#/components/parameters/Metric'
        - $ref: '#/components/parameters/Channels'
        - $ref: '#/components/parameters/FilterExpression'
        - $ref: '#/components/parameters/Domains'
        - $ref: '#/components/parameters/Authors'
        - $ref: '#/components/parameters/Languages'
        - $ref: '#/components/parameters/BotRatings'
        - $ref: '#/components/parameters/SmartCategories'
        - $ref: '#/components/parameters/CustomEnrichments'
        - $ref: '#/components/parameters/MentionTypeSocialMedia'
        - $ref: '#/components/parameters/MentionTypeNews'
        - $ref: '#/components/parameters/MentionTypePodcasts'
        - $ref: '#/components/parameters/LocationsRegion'
        - $ref: '#/components/parameters/LocationsSubregion'
        - $ref: '#/components/parameters/LocationsCountry'
        - $ref: '#/components/parameters/LocationsState'
        - $ref: '#/components/parameters/LocationsCounty'
        - $ref: '#/components/parameters/LocationsCity'
        - $ref: '#/components/parameters/PublisherGeographySourceCountry'
        - $ref: '#/components/parameters/PublisherGeographySourceRegion'
        - $ref: '#/components/parameters/PublisherGeographySourceSubRegion'
      responses:
        '200':
          description: A JSON object containing time-bucketed mention volume.
          content:
            application/json:
              schema:
                type: object
                properties:
                  totalCount:
                    type: number
                    minimum: 0
                    description: >
                      Total across all time buckets: the number of mentions
                      matching

                      the filters, or with `metric` set, the summed value of
                      that

                      metric (reach, or the integer enrichment's values).
                    example: 125000
                  buckets:
                    type: array
                    description: |
                      Mention volume aggregated into time buckets over the
                      requested date range (hourly, daily, weekly or monthly
                      depending on the range; see the endpoint description).
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                          format: date-time
                          description: The start of the time bucket (UTC).
                          example: '2025-01-15T00:00:00Z'
                        count:
                          type: number
                          minimum: 0
                          description: >
                            The number of mentions published during this bucket,
                            or

                            with `metric` set, the summed value of that metric
                            over

                            the bucket's mentions.
                        groups:
                          type: array
                          description: |
                            Secondary breakdown by the `group_by` dimension.
                            Only present when `group_by` is specified. Each
                            entry represents one option value within the
                            dimension.
                          items:
                            type: object
                            properties:
                              key:
                                type: string
                                description: >
                                  The option value for this group (e.g.,
                                  `"news"`,

                                  `"en"`, `"almost_certain"`).


                                  For the six `locations.*` dimensions this is
                                  the

                                  location `id` as a string, and the display
                                  name is

                                  returned separately in `name`.
                              name:
                                type: string
                                description: >
                                  The location's display name. Returned **only**
                                  for the six

                                  `locations.*` `group_by` dimensions, where
                                  names are not

                                  unique across levels (Georgia is both a US
                                  state and a

                                  country) so the id has to travel in `key`.
                                  Every other

                                  dimension carries its label in `key` and omits
                                  this field.
                                example: San Francisco
                              count:
                                type: number
                                minimum: 0
                                description: >
                                  The number of mentions in this group for this
                                  bucket,

                                  or with `metric` set, the summed value of that
                                  metric.
        '400':
          description: Invalid `group_by` or `metric` value, or other invalid parameters.
        '401':
          description: Missing or invalid access token.
        '403':
          description: The workspace exists, but your account does not have access to it.
        '404':
          description: No workspace with the given `workspaceId` exists.
components:
  parameters:
    WorkspaceId:
      name: workspaceId
      in: path
      required: true
      schema:
        type: integer
        minimum: 1
      description: The unique identifier for the workspace.
    Since:
      name: since
      in: query
      required: true
      schema:
        type: string
        format: date-time
      description: The minimum published date of the mentions to return.
      example: '2024-01-01T00:00:00Z'
    To:
      name: to
      in: query
      required: true
      schema:
        type: string
        format: date-time
      description: The maximum published date of the mentions to return.
      example: '2024-01-01T23:59:59Z'
    GroupByTimeline:
      name: group_by
      in: query
      required: false
      schema:
        type: string
      description: >
        Adds a secondary breakdown within each time bucket by the specified

        dimension. The value must be a valid filter `key` as returned by

        `GET /workspaces/{workspaceId}/available-filters`, or one of the
        following

        built-in dimensions:


        - `channels` — Mention counts by channel

        - `bot_ratings` — Mention counts by bot detection confidence

        - `mention_type.social_media` — Mention counts by social media post type

        - `locations.region` — Mention counts by region

        - `locations.subregion` — Mention counts by subregion

        - `locations.country` — Mention counts by country

        - `locations.state` — Mention counts by state

        - `locations.county` — Mention counts by county

        - `locations.city` — Mention counts by city

        - `publisher_geography.source_country` — Mention counts by publisher
        country
          (**deprecated** — removed December 1, 2026, use `locations.country`)
        - `publisher_geography.source_region` — Mention counts by publisher
        region
          (**deprecated** — removed December 1, 2026, use `locations.region`)
        - `publisher_geography.source_sub_region` — Mention counts by publisher
        subregion
          (**deprecated** — removed December 1, 2026, use `locations.subregion`)

        For Smart Categories and Custom Enrichments, use the format
        `{model_key}:{enrichment_id}`, where `model_key` is either
        `smart_category_enrichment_id` or `custom_enrichment_id` and
        `enrichment_id` is the model's ID (e.g.,
        `smart_category_enrichment_id:244` or `custom_enrichment_id:1681`).
        Available IDs are returned by `GET
        /workspaces/{workspaceId}/available-filters`.


        The six `locations.*` dimensions break counts down by PeakMetrics'
        location

        taxonomy. **For these six dimensions only**, each entry in a bucket's
        `groups`

        array carries an extra `name` field holding the location's display name,
        while

        `key` holds the location `id` as a string. Location names are not unique
        across

        levels — Georgia is both a US state and a country — and it is the `id`
        that

        round-trips back into the `locations.<level>` filter, so the name is
        returned

        separately. Every other dimension is unchanged and still carries its
        label in

        `key`.


        `group_by` takes a single value, so you can break down by only one level
        at a time.

        Grouping by `locations.county` or `locations.city` returns only the
        locations that

        mentions actually resolved to that depth.


        When omitted, each bucket contains only the total mention count.

        When provided, each bucket includes a `groups` array with counts

        broken down by the dimension's option values.
      example: channels
    Metric:
      name: metric
      in: query
      required: false
      schema:
        type: string
        default: mentions
      description: >
        What each bucket or group measures. One of:


        - `mentions` (default) — the number of mentions. Existing behavior,
        unchanged.

        - `reach` — the sum of the reach of the mentions.

        - `custom_enrichment_sum:{enrichment_id}` — the sum of an **integer**
        custom
          enrichment's values across the mentions, where `enrichment_id` is the
          `enrichment_id` returned by `GET /customEnrichments` (e.g.
          `custom_enrichment_sum:1681`). Only integer enrichments provisioned for
          your team are accepted; a categorical enrichment or an id your team does
          not hold is a `400`.

        The response shape does not change with the metric: `count` and
        `totalCount`

        report the number of mentions by default, and the summed value of the
        chosen

        metric when one is set. Mentions that carry no value for the chosen
        field

        contribute nothing to a sum. All filters and `group_by` apply alongside
        any

        `metric`.
      example: reach
    Channels:
      name: channels
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          enum:
            - blogsdiscussions
            - bluesky
            - facebook
            - instagram
            - news
            - reddit
            - redditComment
            - telegram
            - threads
            - tiktok
            - twitter
            - vk
            - weibo
            - youtube
      description: Filter to mentions that are part of the provided channel.
      example: '[''twitter'', ''news'']'
    FilterExpression:
      name: filter_expression
      in: query
      required: false
      schema:
        type: string
      description: >
        A keyword search string applied against mention content. Supports

        Boolean operators (AND, OR, NOT) and quoted phrases for exact matching.

        Field-scoped expressions are also supported (e.g., `title:word` or
        `text:phrase`).


        This filter is applied in addition to the workspace query and any other

        filters. Use this for ad-hoc keyword narrowing without modifying the

        workspace configuration.
      example: (title:word OR text:word2) AND (title:word4 OR text:word3)
    Domains:
      name: domains
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
      description: |
        Filter to mentions published on the provided domains.
        Multiple values are combined with OR logic.
      example: '[''nytimes.com'', ''reuters.com'']'
    Authors:
      name: authors
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
      description: |
        Filter to mentions attributed to the provided authors.
        Multiple values are combined with OR logic.
      example: '[''@exampleuser'', ''Jane Doe'']'
    Languages:
      name: languages
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
      description: |
        Filter to mentions in the provided languages, specified as two-letter
        ISO 639-1 codes. Multiple values are combined with OR logic.
      example: '[''en'', ''es'']'
    BotRatings:
      name: bot_ratings
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          enum:
            - none
            - further_investigation
            - very_unlikely
            - unlikely
            - potential
            - likely
            - very_likely
            - almost_certain
      description: >
        Filter by bot detection confidence level. Bot detection analyzes social

        media accounts to identify automated or coordinated inauthentic
        behavior.

        Multiple values are combined with OR logic.
      example: '[''likely'', ''very_likely'', ''almost_certain'']'
    SmartCategories:
      name: smart_categories
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
      description: >
        Filter by Smart Category classification results. Smart Categories are

        custom AI-powered classifiers configured per workspace (e.g., sentiment

        models, topic classifiers, violent rhetoric detection).


        Each value is a composite string in the format
        `{enrichmentId}:{categoryKey}`,

        where `enrichmentId` identifies the Smart Category model and
        `categoryKey`

        identifies the classification label (e.g., `c0`, `c1`, `c2`).


        Available enrichment IDs and their category key mappings can be
        discovered

        via `GET /workspaces/{workspaceId}/available-filters`. Multiple values
        are combined with OR logic.
      example: '[''244:c0'', ''294:c1'']'
    CustomEnrichments:
      name: custom_enrichments
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
      description: >
        Filter by custom enrichment values. Custom enrichments are structured
        fields

        provisioned for your team that attach external context to mentions.


        Each value is a composite string in the format
        `{enrichment_id}:{value}`,

        where `enrichment_id` identifies the custom enrichment and `value` is
        the

        category value to match (e.g., `1681:Substantiated`).


        Available custom enrichments and their recorded values for this
        workspace can

        be discovered via `GET /workspaces/{workspaceId}/available-filters`
        under

        `custom_enrichments`. Multiple values are combined with OR logic.
      example: '[''1681:Substantiated'', ''1681:Mixed'']'
    MentionTypeSocialMedia:
      name: mention_type.social_media
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          enum:
            - original_posts
            - reposts
            - comments
            - quoting_posts
      description: >
        Filter by social media post type. Use the values returned by

        `GET /workspaces/{workspaceId}/available-filters` under

        `mention_type.social_media.options`. Multiple values from the same
        sub-filter are combined with OR logic.
      example: '[''original_posts'', ''reposts'']'
    MentionTypeNews:
      name: mention_type.news
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          enum:
            - news
      description: |
        Filter to news mention type. Use the values returned by
        `GET /workspaces/{workspaceId}/available-filters` under
        `mention_type.news.options`. Multiple values are combined with OR logic.
      example: '[''news'']'
    MentionTypePodcasts:
      name: mention_type.podcasts
      in: query
      required: false
      schema:
        type: array
        items:
          type: string
          enum:
            - podcasts
      description: >
        Filter to podcast mention types. Use the values returned by

        `GET /workspaces/{workspaceId}/available-filters` under

        `mention_type.podcasts.options`. Multiple values are combined with OR
        logic.
      example: '[''podcasts'']'
    LocationsRegion:
      name: locations.region
      in: query
      required: false
      schema:
        type: array
        items:
          type: integer
      description: >
        Filter to mentions that resolved to the provided regions, identified by
        the

        numeric `id` returned by `GET /locations?level=region`. Location ids are
        unique

        only within a level, so these must be region ids.


        Selecting a region also matches mentions that resolved to anything
        beneath it —

        its subregions, countries, states, counties, and cities — so there is no
        need to

        enumerate children. Multiple values are combined with OR logic, and all
        six

        `locations.*` parameters are OR'd together as a single group, which is
        then

        combined with your other filters using AND logic.
      example: '[1, 2]'
    LocationsSubregion:
      name: locations.subregion
      in: query
      required: false
      schema:
        type: array
        items:
          type: integer
      description: >
        Filter to mentions that resolved to the provided subregions, identified
        by the

        numeric `id` returned by `GET /locations?level=subregion`. Location ids
        are unique

        only within a level, so these must be subregion ids.


        Selecting a subregion also matches mentions that resolved to anything
        beneath it —

        its countries, states, counties, and cities — so there is no need to
        enumerate

        children. Multiple values are combined with OR logic, and all six
        `locations.*`

        parameters are OR'd together as a single group, which is then combined
        with your

        other filters using AND logic.
      example: '[3, 5]'
    LocationsCountry:
      name: locations.country
      in: query
      required: false
      schema:
        type: array
        items:
          type: integer
      description: >
        Filter to mentions that resolved to the provided countries, identified
        by the

        numeric `id` returned by `GET /locations?level=country`. Location ids
        are unique

        only within a level, so these must be country ids.


        Selecting a country also matches mentions that resolved to anything
        beneath it —

        its states, counties, and cities — so there is no need to enumerate
        children.

        Multiple values are combined with OR logic, and all six `locations.*`
        parameters

        are OR'd together as a single group, which is then combined with your
        other

        filters using AND logic.
      example: '[10, 20]'
    LocationsState:
      name: locations.state
      in: query
      required: false
      schema:
        type: array
        items:
          type: integer
      description: >
        Filter to mentions that resolved to the provided states, identified by
        the numeric

        `id` returned by `GET /locations?level=state`. States are United States
        only.

        Location ids are unique only within a level, so these must be state ids.


        Selecting a state also matches mentions that resolved to anything
        beneath it — its

        counties and cities — so there is no need to enumerate children.
        Multiple values

        are combined with OR logic, and all six `locations.*` parameters are
        OR'd together

        as a single group, which is then combined with your other filters using
        AND logic.
      example: '[6, 33]'
    LocationsCounty:
      name: locations.county
      in: query
      required: false
      schema:
        type: array
        items:
          type: integer
      description: >
        Filter to mentions that resolved to the provided counties, identified by
        the

        numeric `id` returned by `GET /locations?level=county`. Counties are
        United States

        only. Location ids are unique only within a level, so these must be
        county ids.


        Selecting a county also matches mentions that resolved to any of its
        cities, so

        there is no need to enumerate children. Multiple values are combined
        with OR

        logic, and all six `locations.*` parameters are OR'd together as a
        single group,

        which is then combined with your other filters using AND logic.
      example: '[413, 1044]'
    LocationsCity:
      name: locations.city
      in: query
      required: false
      schema:
        type: array
        items:
          type: integer
      description: >
        Filter to mentions that resolved to the provided cities, identified by
        the numeric

        `id` returned by `GET /locations?level=city`. City is the finest level
        of the

        taxonomy, so it has no descendants. Location ids are unique only within
        a level,

        so these must be city ids.


        Multiple values are combined with OR logic, and all six `locations.*`
        parameters

        are OR'd together as a single group, which is then combined with your
        other

        filters using AND logic.
      example: '[512, 4409]'
    PublisherGeographySourceCountry:
      name: publisher_geography.source_country
      in: query
      required: false
      deprecated: true
      schema:
        type: array
        items:
          type: string
      description: >
        **Deprecated — removed on December 1, 2026.** Use the
        `locations.country` filter

        instead, which resolves on mentions across every channel rather than
        news

        only. Look ids up with `GET /locations?level=country`.


        Filter by the publisher's country of origin. Primarily applicable to

        news mentions. Country names should match the values returned by

        `GET /workspaces/{workspaceId}/available-filters`. Multiple values are
        combined with OR logic.
      example: '[''United States'', ''United Kingdom'']'
    PublisherGeographySourceRegion:
      name: publisher_geography.source_region
      in: query
      required: false
      deprecated: true
      schema:
        type: array
        items:
          type: string
          enum:
            - Africa
            - Americas
            - Asia
            - Europe
            - Oceania
      description: >
        **Deprecated — removed on December 1, 2026.** Use the `locations.region`
        filter

        instead, which resolves on mentions across every channel rather than
        news

        only. Look ids up with `GET /locations?level=region`.


        Filter by the publisher's geographic region. Primarily applicable to

        news mentions. Multiple values are combined with OR logic.
      example: '[''Americas'', ''Europe'']'
    PublisherGeographySourceSubRegion:
      name: publisher_geography.source_sub_region
      in: query
      required: false
      deprecated: true
      schema:
        type: array
        items:
          type: string
          enum:
            - Australia and New Zealand
            - Caribbean
            - Central America
            - Central Asia
            - Eastern Africa
            - Eastern Asia
            - Eastern Europe
            - Melanesia
            - Micronesia
            - Middle Africa
            - Northern Africa
            - Northern America
            - Northern Europe
            - Polynesia
            - South America
            - South-Eastern Asia
            - Southern Africa
            - Southern Asia
            - Southern Europe
            - Western Africa
            - Western Asia
            - Western Europe
      description: >
        **Deprecated — removed on December 1, 2026.** Use the
        `locations.subregion` filter

        instead, which resolves on mentions across every channel rather than
        news

        only. Look ids up with `GET /locations?level=subregion`.


        Filter by the publisher's geographic subregion. Primarily applicable to

        news mentions. Multiple values are combined with OR logic.
      example: '[''Northern America'', ''Northern Europe'']'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.