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

# Keyword ranking history

> Retrieve the historical daily ranking positions for a single tracked keyword. Used to render position-over-time charts. Returns data from Postgres for the specified date range.



## OpenAPI

````yaml https://api.surnex.io/openapi.json get /v1/projects/{project_id}/tracking/keywords/{keyword_id}/history
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}/tracking/keywords/{keyword_id}/history:
    get:
      tags:
        - Rank Tracking
      summary: Keyword ranking history
      description: >-
        Retrieve the historical daily ranking positions for a single tracked
        keyword. Used to render position-over-time charts. Returns data from
        Postgres for the specified date range.
      operationId: >-
        get_keyword_history_v1_projects__project_id__tracking_keywords__keyword_id__history_get
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: keyword_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Keyword Id
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date
            description: Start of date range (YYYY-MM-DD)
            title: Start Date
          description: Start of date range (YYYY-MM-DD)
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date
            description: End of date range (YYYY-MM-DD)
            title: End Date
          description: End of date range (YYYY-MM-DD)
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_list_RankingHistoryPoint__'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    APIResponse_list_RankingHistoryPoint__:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - items:
                $ref: '#/components/schemas/RankingHistoryPoint'
              type: array
            - type: 'null'
          title: Data
      type: object
      title: APIResponse[list[RankingHistoryPoint]]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RankingHistoryPoint:
      properties:
        tracked_at:
          type: string
          format: date-time
          title: Tracked At
          description: When this position was recorded (UTC).
        rank_position:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rank Position
          description: SERP position at this date. NULL = not in top 100.
        rank_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Rank Url
          description: The URL that ranked at this position.
        serp_features:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Serp Features
          description: SERP features detected for this keyword on this date.
        has_ai_overview:
          type: boolean
          title: Has Ai Overview
          description: Whether an AI Overview was present in the SERP.
          default: false
        ai_overview_domain_cited:
          type: boolean
          title: Ai Overview Domain Cited
          description: Whether the tracked domain was cited in the AI Overview.
          default: false
        serp_snapshot:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Serp Snapshot
          description: >-
            Full top-N SERP snapshot items (title, URL, domain, snippet, type,
            position).
        se_results_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Se Results Count
          description: Total search engine results count for this keyword.
        breadcrumb:
          anyOf:
            - type: string
            - type: 'null'
          title: Breadcrumb
          description: Breadcrumb trail for the tracked domain's result.
      type: object
      required:
        - tracked_at
      title: RankingHistoryPoint
      description: Single data point in a keyword's historical ranking chart.
    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

````