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

> ## Agent Instructions
> Every page is listed in https://docs.keenable.ai/llms.txt. To pick a product for a job, read https://docs.keenable.ai/choose.md
> Setup steps for agents, covering the SDKs, the MCP server and the CLI: https://docs.keenable.ai/skill.md
> Keenable search and fetch work without an API key. To add them to code, use the official SDK for the project's language: https://docs.keenable.ai/sdks.md
> Without a key, call POST https://api.keenable.ai/v1/search/public or GET https://api.keenable.ai/v1/fetch/public with an X-Keenable-Title header that names your app.
> With a key, send it in the X-API-Key header and read it from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat. Every access method: https://docs.keenable.ai/auth.md
> To get an API key without the console, use device login: https://docs.keenable.ai/authentication.md#device-login
> MCP server: https://api.keenable.ai/mcp (no key, or X-API-Key; keyless Codex uses https://api.keenable.ai/mcp-public), or https://api.keenable.ai/mcp-oauth for OAuth sign-in. These docs are an MCP server at https://docs.keenable.ai/mcp and the OpenAPI spec is at https://docs.keenable.ai/api-reference/openapi.json
> Keenable searches and fetches public web pages. If a question needs no web information, skip the call.
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On 429, wait the number of seconds in Retry-After, then retry. Before you ship, follow https://docs.keenable.ai/production.md
> Every error, with its cause and fix, is in https://docs.keenable.ai/errors.md and moving from another search API is covered in https://docs.keenable.ai/migrate.md
> Before you compare Keenable with another search API, read https://docs.keenable.ai/guides/evaluate-search-apis.md

# List versions

> List a page monitor's versions with GET /v1/monitors/{id}/versions, newest first, each with its source, whether it was notified and its diff.

List the versions of the page a [page monitor](https://docs.keenable.ai/products/monitors#create-a-page-monitor) watches, newest first. A run stores a version each time the page's text changed, and version 1 is the baseline. Each version says whether `monitor.page.changed` was sent for it, with the `summary` and `items` of a change that was judged, and its `diff` against the version before it from the same `source`, whether or not you were notified about either. A run's `changes.diff` can differ: for a larger change it goes back to the last version you were notified about. The list covers the monitor's last 500 versions. A search monitor has no versions and returns an empty list.


## OpenAPI

````yaml GET /v1/monitors/{id}/versions
openapi: 3.0.3
info:
  title: Keenable API
  version: 1.0.0
  description: Web search, page fetching and monitors API.
servers:
  - url: https://api.keenable.ai
    description: Production
security:
  - apiKey: []
  - bearerAuth: []
paths:
  /v1/monitors/{id}/versions:
    get:
      tags:
        - Monitors
      summary: List a page monitor's versions
      description: >-
        The watched page's history, newest first: one version each time its text
        changed, with what changed and whether it was notified. A search monitor
        has no versions and returns an empty list.
      operationId: monitors.versions
      parameters:
        - $ref: '#/components/parameters/MonitorId'
        - $ref: '#/components/parameters/MonitorLimit'
        - $ref: '#/components/parameters/MonitorCursor'
      responses:
        '200':
          description: A page of versions
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorVersionList'
        '400':
          $ref: '#/components/responses/MonitorBadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/MonitorForbidden'
        '404':
          $ref: '#/components/responses/MonitorNotFound'
        '429':
          $ref: '#/components/responses/MonitorRateLimited'
        '503':
          $ref: '#/components/responses/MonitorsUnavailable'
      security:
        - apiKey: []
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript
          source: |
            import { Keenable } from "keenable";

            async function main() {
              // reads KEENABLE_API_KEY from the environment
              const client = new Keenable();
              const versions = await client.monitors.versions("mon_7d9e6f5a213kq9z2c8f1a04b", { limit: 10 });
              for (const version of versions.data) {
                console.log(version.version, version.notified, version.summary);
              }
            }

            main();
        - lang: python
          label: Python
          source: >
            from keenable import Keenable


            # reads KEENABLE_API_KEY from the environment

            client = Keenable()

            versions = client.monitors.versions("mon_7d9e6f5a213kq9z2c8f1a04b",
            limit=10)

            for version in versions.data:
                print(version.version, version.notified, version.summary)
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/keenableai/keenable-sdk/go\"\n)\n\nfunc main() {\n\t// reads KEENABLE_API_KEY from the environment\n\tclient, err := keenable.New(nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer client.Close()\n\n\tversions, err := client.Monitors.Versions(context.Background(), \"mon_7d9e6f5a213kq9z2c8f1a04b\", &keenable.MonitorVersionsParams{Limit: 10})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfor _, version := range versions.Data {\n\t\tsummary := \"\"\n\t\tif version.Summary != nil {\n\t\t\tsummary = *version.Summary\n\t\t}\n\t\tfmt.Println(version.Version, version.Notified, summary)\n\t}\n}\n"
        - lang: rust
          label: Rust
          source: |
            use keenable::{Client, MonitorVersionsParams};

            #[tokio::main]
            async fn main() -> Result<(), keenable::Error> {
                // reads KEENABLE_API_KEY from the environment
                let client = Client::new()?;
                let versions = client
                    .monitors()
                    .versions(
                        "mon_7d9e6f5a213kq9z2c8f1a04b",
                        &MonitorVersionsParams { limit: Some(10), ..Default::default() },
                    )
                    .await?;
                for version in versions.data {
                    let summary = version.summary.unwrap_or_default();
                    println!("{} {} {summary}", version.version, version.notified);
                }
                Ok(())
            }
        - lang: bash
          label: curl
          source: >
            curl -G
            https://api.keenable.ai/v1/monitors/mon_7d9e6f5a213kq9z2c8f1a04b/versions
            \
              -H "X-API-Key: $KEENABLE_API_KEY" \
              --data-urlencode "limit=10"
components:
  parameters:
    MonitorId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: The monitor's ID, such as `mon_3kq9z2c8f1a04b7d9e6f5a21`.
      example: mon_3kq9z2c8f1a04b7d9e6f5a21
    MonitorLimit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 50
      description: Items per page, 1 to 100. Any other value returns `400`.
    MonitorCursor:
      name: cursor
      in: query
      required: false
      schema:
        type: string
      description: >-
        The `next_cursor` of the previous page. A cursor that isn't in the list
        returns `400`.
  headers:
    XRequestId:
      description: ID of this request. Include it when you report a problem.
      schema:
        type: string
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
      example: 1
  schemas:
    MonitorVersionList:
      type: object
      required:
        - data
        - has_more
        - next_cursor
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MonitorVersion'
        has_more:
          type: boolean
          description: '`true` if there are more items after this page.'
        next_cursor:
          type: string
          nullable: true
          description: Pass it as `cursor` to get the next page. `null` on the last page.
    MonitorVersion:
      type: object
      required:
        - id
        - object
        - version
        - fetched_at
        - source
        - notified
        - items
        - diff
      description: >-
        One stored version of the watched page. A version is stored whenever the
        text changed.
      properties:
        id:
          type: string
          description: >-
            Opaque. A list's `next_cursor` is the `id` of its last version: pass
            it as `cursor` to get the next versions.
          example: ver_3
        object:
          type: string
          enum:
            - page_version
        version:
          type: integer
          description: Counts up from 1, the baseline.
        fetched_at:
          type: string
          format: date-time
          description: When this version was read.
        title:
          type: string
          nullable: true
          description: The page's title in this version.
        source:
          type: string
          enum:
            - stream
            - live
          description: >-
            `stream`: Keenable's crawler's copy of the page. `live`: read from
            the site for the run.
        notified:
          type: boolean
          description: '`monitor.page.changed` was sent for this version.'
        summary:
          type: string
          nullable: true
          description: One line on what changed.
        items:
          type: array
          items:
            type: string
          description: The changes worth telling, one per item.
        diff:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MonitorPageDiff'
          description: >-
            Against the version before it from the same source, whether or not
            you were notified about either. `null` on a first version.
          properties:
            previous_at:
              type: string
              format: date-time
              nullable: true
              description: When the version compared with was read.
            ratio:
              type: number
              nullable: true
              description: How much of the text changed, from 0 to 1.
            added:
              type: array
              items:
                type: string
              description: Text the newer version added.
            removed:
              type: array
              items:
                type: string
              description: Text the newer version removed.
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Short error title, such as `Invalid parameter` or `Not found`.
          example: Invalid parameter
        message:
          type: string
          description: What went wrong and what to change. Sometimes absent.
          example: '"max_results": must be an integer between 1 and 50'
        details:
          description: Structured details, when the error has any.
        retryAfter:
          type: integer
          description: >-
            Seconds to wait before retrying. Present on `429` responses from
            Keenable's own rate limits, matching the `Retry-After` header.
    MonitorPageDiff:
      type: object
      description: >-
        Text added and removed between two versions of the page from the same
        source. Which versions depends on where the diff is: see
        `MonitorVersion.diff` and `MonitorPageChanges.diff`.
      properties:
        previous_at:
          type: string
          format: date-time
          nullable: true
          description: When the version compared with was read.
        ratio:
          type: number
          nullable: true
          description: How much of the text changed, from 0 to 1.
        added:
          type: array
          items:
            type: string
          description: Text the newer version added.
        removed:
          type: array
          items:
            type: string
          description: Text the newer version removed.
  responses:
    MonitorBadRequest:
      description: >-
        The request is invalid. `code` is `invalid_request` for a missing or
        wrong field or a schedule that breaks a rule, and
        `monitor_option_not_supported` for a field Monitors doesn't have or
        doesn't offer yet. `message` names the field. Correct the request;
        retrying unchanged returns the same error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: >-
        No key was sent (`Missing authentication`), or the key is malformed,
        unknown or has the wrong prefix (`Authentication failed`, with
        `Malformed API key` or `Invalid API key` in `message`). Send a valid key
        in `X-API-Key` or `Authorization: Bearer`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    MonitorForbidden:
      description: >-
        Your key is valid but can't do this. `monitors_not_enabled`: Monitors is
        turned off for your organization; contact support@keenable.ai.
        `monitor_limit_reached`: your organization already has 100 active
        monitors (search and page monitors count together); pause or delete one,
        then retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    MonitorNotFound:
      description: >-
        No monitor or run with this ID belongs to your organization
        (`not_found`). Check the ID.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    MonitorRateLimited:
      description: >-
        Your organization sent more than 120 Monitors requests, or more than 10
        creates, in the last minute (`rate_limited`). Wait, then retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
    MonitorsUnavailable:
      description: >-
        The Monitors service didn't answer (`monitors_unavailable`). The request
        may not have been applied. Retry after a few seconds; retry a create
        with the same `Idempotency-Key`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your API key, such as `keen_...`. Create one in the Keenable console. If
        you send both this header and `Authorization`, the API uses this one.
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key sent as `Authorization: Bearer keen_...`, for clients that
        only support bearer tokens.

````

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