> ## 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.

# Fetch live widget data

> Fetch live data for one or more widgets in a report. Pass an optional list of widget_ids to fetch a subset; leave widget_ids empty to fetch data for every widget in the report. An optional date range override (date_start / date_end) takes precedence over the report's configured date range for this request only. The response is a dict keyed by widget UUID string, where each value is the resolved data payload for that widget.



## OpenAPI

````yaml https://api.surnex.io/openapi.json post /v1/projects/{project_id}/reports/{report_id}/data
openapi: 3.1.0
info:
  title: Surnex API
  description: |-
    Surnex SEO Platform API — api.surnex.io

    Provides the complete backend for the Surnex SEO dashboard including:
    - Multi-tenant organization management
    - Project tracking (domains)
    - Keyword rank tracking (Phase 1+)
    - Backlink analysis (Phase 3+)
    - Site auditing (Phase 4+)
    - Stripe billing integration
    - MCP endpoint for AI agents at /mcp
  version: 0.1.0
servers: []
security: []
paths:
  /v1/projects/{project_id}/reports/{report_id}/data:
    post:
      tags:
        - Reports
      summary: Fetch live widget data
      description: >-
        Fetch live data for one or more widgets in a report. Pass an optional
        list of widget_ids to fetch a subset; leave widget_ids empty to fetch
        data for every widget in the report. An optional date range override
        (date_start / date_end) takes precedence over the report's configured
        date range for this request only. The response is a dict keyed by widget
        UUID string, where each value is the resolved data payload for that
        widget.
      operationId: fetch_widget_data_v1_projects__project_id__reports__report_id__data_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: report_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Report Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WidgetDataRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_dict_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WidgetDataRequest:
      properties:
        widget_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Widget Ids
          description: >-
            UUIDs of the widgets to fetch data for. If empty, data is fetched
            for all widgets on the page.
        date_start:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date Start
          description: >-
            Override start date for data fetching. Falls back to the report's
            configured date range when null.
        date_end:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date End
          description: >-
            Override end date for data fetching. Falls back to the report's
            configured date range when null.
        widgets:
          items:
            $ref: '#/components/schemas/InlineWidget'
          type: array
          title: Widgets
          description: >-
            When provided, the API uses these widget definitions directly
            instead of loading from the database. This allows fetching data for
            unsaved widgets in the editor.
      type: object
      title: WidgetDataRequest
      description: Request body for fetching live data for one or more widgets.
    APIResponse_dict_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Data
      type: object
      title: APIResponse[dict]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InlineWidget:
      properties:
        id:
          type: string
          title: Id
        widget_type:
          type: string
          title: Widget Type
        data_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Source
        config:
          additionalProperties: true
          type: object
          title: Config
      type: object
      required:
        - id
        - widget_type
      title: InlineWidget
      description: Lightweight widget definition sent from the frontend editor.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````