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

# Get shop metrics over time

> Returns a metric series bucketed by day, week or month.



## OpenAPI

````yaml /api-reference/openapi.yaml get /shops/{shop_id}/timeseries
openapi: 3.1.0
info:
  title: Unif API
  version: '2026-09-01'
  summary: One schema for commerce data across every channel.
  description: >
    The Unif API returns normalized commerce data — shops, products, creators,
    videos,

    livestreams and categories — through a single schema that does not change
    when the

    underlying data source does.


    Each request runs a cascade across the sources behind a channel, in cost
    order, stopping at

    the first result that verifies. You are charged for the hit, not for the
    attempts. See

    [the waterfall](/docs/concepts/waterfall).


    Every response is denominated in the currency you ask for, scoped to a
    market, and

    measured over a period you control, whichever source answered.


    **Base URL**


    ```

    https://api.unif.dev/v1

    ```


    All requests require a bearer token. See
    [Authentication](/docs/authentication).


    **Conventions**


    - Success and failure are carried by the HTTP status code. There is no
    envelope to unwrap:
      a `200` body is the object itself, and any `4xx` or `5xx` body is an
      [error object](/docs/platform/errors).
    - Lists are cursor-paginated. Read `next_cursor` and stop when `has_more` is
    false.

    - Every response carries `X-Request-Id`. Billable responses also carry
      `X-Unif-Credits-Charged` and `X-Unif-Credits-Remaining`.
    - Monetary fields are converted to the `currency` you request, and every
    object repeats
      the `currency` and `period` it was measured under.
  contact:
    name: Unif Support
    email: support@unif.dev
    url: https://unif.dev/docs
  license:
    name: Proprietary
    url: https://unif.dev/legal/terms
servers:
  - url: https://api.unif.dev/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Meta
    description: Workspace, channel availability and field coverage.
  - name: Shops
    description: Storefronts and sellers.
  - name: Products
    description: Listings, pricing and sales performance.
  - name: Creators
    description: Affiliates and influencers who sell.
  - name: Videos
    description: Short-form video attributed to sales.
  - name: Livestreams
    description: Live selling sessions.
  - name: Categories
    description: The normalized category tree and category-level market data.
  - name: Resolution
    description: Turn a URL, handle or external ID into a Unif entity.
  - name: Jobs
    description: Asynchronous work for large searches, enrichments and exports.
  - name: Lists
    description: Saved sets of entities.
  - name: Trackers
    description: Scheduled re-checks that emit webhook events on change.
  - name: Webhooks
    description: Endpoint registration and delivery settings.
  - name: Usage
    description: Credit balance and per-request consumption.
paths:
  /shops/{shop_id}/timeseries:
    get:
      tags:
        - Shops
      summary: Get shop metrics over time
      description: Returns a metric series bucketed by day, week or month.
      operationId: getShopTimeseries
      parameters:
        - $ref: '#/components/parameters/ShopId'
        - $ref: '#/components/parameters/MetricsQuery'
        - $ref: '#/components/parameters/GranularityQuery'
        - $ref: '#/components/parameters/PeriodPresetQuery'
        - $ref: '#/components/parameters/PeriodStartQuery'
        - $ref: '#/components/parameters/PeriodEndQuery'
        - $ref: '#/components/parameters/CurrencyQuery'
      responses:
        '200':
          description: The metric series.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Timeseries'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    ShopId:
      name: shop_id
      in: path
      required: true
      description: The Unif ID of the shop, for example `shp_01k3m9x7v2q8r4t6y0b1n5d7fa`.
      schema:
        type: string
    MetricsQuery:
      name: metrics
      in: query
      description: >-
        Comma-separated metric names to return, for example
        `revenue,units_sold`.
      schema:
        type: string
        examples:
          - revenue,units_sold
    GranularityQuery:
      name: granularity
      in: query
      description: Bucket size for the series.
      schema:
        type: string
        enum:
          - day
          - week
          - month
        default: day
    PeriodPresetQuery:
      name: period
      in: query
      description: A named period. Mutually exclusive with `period_start` and `period_end`.
      schema:
        $ref: '#/components/schemas/PeriodPreset'
    PeriodStartQuery:
      name: period_start
      in: query
      description: First day of a custom period, inclusive.
      schema:
        type: string
        format: date
    PeriodEndQuery:
      name: period_end
      in: query
      description: Last day of a custom period, inclusive.
      schema:
        type: string
        format: date
    CurrencyQuery:
      name: currency
      in: query
      description: Convert every monetary field to this ISO 4217 currency.
      schema:
        type: string
        default: USD
        examples:
          - USD
          - GBP
          - IDR
  schemas:
    Timeseries:
      type: object
      properties:
        object:
          type: string
          const: timeseries
        entity_id:
          type: string
        entity_type:
          $ref: '#/components/schemas/EntityType'
        granularity:
          type: string
          enum:
            - day
            - week
            - month
        currency:
          type: string
        period:
          $ref: '#/components/schemas/ResolvedPeriod'
        data:
          type: array
          items:
            $ref: '#/components/schemas/TimeseriesPoint'
        meta:
          $ref: '#/components/schemas/DataMeta'
    PeriodPreset:
      type: string
      enum:
        - last_7d
        - last_30d
        - last_90d
        - last_180d
        - month_to_date
        - previous_month
      default: last_30d
    EntityType:
      type: string
      enum:
        - shop
        - product
        - creator
        - video
        - livestream
        - category
    ResolvedPeriod:
      type: object
      description: >
        The concrete window a request was measured over, after any preset was
        expanded and any

        channel-specific snapping was applied. Always read this rather than
        assuming you got

        back exactly the dates you asked for.
      required:
        - start
        - end
      properties:
        start:
          type: string
          format: date
        end:
          type: string
          format: date
        granularity:
          type: string
          enum:
            - day
            - week
            - month
          description: The smallest bucket the channel reports for this market.
        adjusted:
          type: boolean
          description: >
            True when the requested dates were snapped to the nearest boundary
            the channel

            supports. See [Periods and currency](/docs/concepts/periods).
    TimeseriesPoint:
      type: object
      properties:
        date:
          type: string
          format: date
          description: First day of the bucket.
        values:
          type: object
          additionalProperties:
            type: number
          examples:
            - revenue: 48210.5
              units_sold: 1804
    DataMeta:
      type: object
      description: How current and how complete this record is.
      properties:
        refreshed_at:
          type: string
          format: date-time
          description: When Unif last refreshed this record.
        completeness:
          type: number
          minimum: 0
          maximum: 1
          description: Share of the requested fields that were populated.
        missing_fields:
          type: array
          items:
            type: string
          description: Fields that are not covered for this channel and market.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
    Error:
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - not_found_error
            - rate_limit_error
            - billing_error
            - coverage_error
            - api_error
        code:
          type: string
          examples:
            - parameter_invalid
        message:
          type: string
        param:
          type:
            - string
            - 'null'
          description: The offending field
          as a dot-path.: null
        doc_url:
          type: string
          format: uri
        request_id:
          type: string
  responses:
    BadRequest:
      description: The request was malformed or a parameter was invalid.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: invalid_request_error
              code: parameter_invalid
              message: filters.revenue.gte must be a non-negative number.
              param: filters.revenue.gte
              doc_url: https://unif.dev/docs/platform/errors#parameter_invalid
              request_id: req_01k3m9x7v2q8r4t6y0b1n5d7fa
    NotFound:
      description: No such object, or it belongs to another workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  headers:
    RequestId:
      description: Unique ID for this request. Include it in support conversations.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Send your workspace API key as a bearer token:


        ```

        Authorization: Bearer unif_sk_live_...

        ```


        Keys are scoped to a single workspace. See
        [Authentication](/docs/authentication).

````