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

# A reporting view's metrics for a period

> One of: rankings, ai-overviews, backlinks, site-audit, web-vitals, ai-visibility, local-seo, domain. For each metric asked for (every one when `metrics` is left out): `value` on the last day with data on or before `date_end`; `previous` on the last day with data before `date_start`, the previous period's close; `change` and `change_percent` between them; and `series`, a point per day with data in the period. Null where there is no data. From stored data only — nothing here calls DataForSEO or spends an allowance, so a read-only key is enough. Works on the sample project.



## OpenAPI

````yaml https://api.surnex.io/docs/openapi.json get /v1/projects/{projectId}/reporting/{view}
openapi: 3.1.0
info:
  title: Surnex API
  version: 1.0.0
  description: >-
    The SEO platform's API.


    **The API is the product.** The dashboard is one client and the MCP server
    at `/mcp` is another. If a number needs deriving, a service derives it —
    never a React component, or the two clients drift.


    **Two kinds of auth.** The dashboard sends a Supabase access token as a
    Bearer JWT. MCP agents send `X-API-Key`, and the organization is resolved
    from the key.


    **Two data modes.** SERP results and Google Trends are fetched live on
    request. Everything else is written by the worker and read from Postgres, so
    a freshly-created project returns empty until its jobs complete.
servers:
  - url: https://api.surnex.io
    description: Surnex API
security: []
paths:
  /v1/projects/{projectId}/reporting/{view}:
    get:
      tags:
        - reporting
      summary: A reporting view's metrics for a period
      description: >-
        One of: rankings, ai-overviews, backlinks, site-audit, web-vitals,
        ai-visibility, local-seo, domain. For each metric asked for (every one
        when `metrics` is left out): `value` on the last day with data on or
        before `date_end`; `previous` on the last day with data before
        `date_start`, the previous period's close; `change` and `change_percent`
        between them; and `series`, a point per day with data in the period.
        Null where there is no data. From stored data only — nothing here calls
        DataForSEO or spends an allowance, so a read-only key is enough. Works
        on the sample project.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: projectId
          in: path
        - schema:
            type: string
            enum:
              - rankings
              - ai-overviews
              - backlinks
              - site-audit
              - web-vitals
              - ai-visibility
              - local-seo
              - domain
          required: true
          name: view
          in: path
        - schema:
            type: string
            format: date
          required: true
          name: date_start
          in: query
        - schema:
            type: string
            format: date
          required: true
          name: date_end
          in: query
        - schema:
            type: string
            maxLength: 500
          required: false
          name: metrics
          in: query
      responses:
        '200':
          description: The view's metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    nullable: true
                    properties:
                      view:
                        type: string
                        enum:
                          - rankings
                          - ai-overviews
                          - backlinks
                          - site-audit
                          - web-vitals
                          - ai-visibility
                          - local-seo
                          - domain
                      label:
                        type: string
                      history:
                        type: boolean
                      date_start:
                        type: string
                        format: date
                      date_end:
                        type: string
                        format: date
                      metrics:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            label:
                              type: string
                            unit:
                              type: string
                              enum:
                                - number
                                - position
                                - percent
                                - score
                                - ms
                                - ratio
                                - currency
                            better:
                              type: string
                              nullable: true
                              enum:
                                - higher
                                - lower
                                - null
                            value:
                              type: number
                              nullable: true
                            value_date:
                              type: string
                              nullable: true
                              format: date
                            previous:
                              type: number
                              nullable: true
                            previous_date:
                              type: string
                              nullable: true
                              format: date
                            change:
                              type: number
                              nullable: true
                            change_percent:
                              type: number
                              nullable: true
                            series:
                              type: array
                              items:
                                type: object
                                properties:
                                  date:
                                    type: string
                                    format: date
                                  value:
                                    type: number
                                    nullable: true
                                required:
                                  - date
                                  - value
                          required:
                            - label
                            - unit
                            - better
                            - value
                            - value_date
                            - previous
                            - previous_date
                            - change
                            - change_percent
                            - series
                    required:
                      - view
                      - label
                      - history
                      - date_start
                      - date_end
                      - metrics
                required:
                  - success
                  - data
        '400':
          description: >-
            An unknown metric, or a period the wrong way round or longer than
            two years
          content:
            application/json:
              schema:
                type: object
                properties: {}

````

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