> ## 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
> 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
> Read an API key from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat; send them to https://docs.keenable.ai/api-keys.md
> 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.
> Every error, with its cause and fix: https://docs.keenable.ai/errors.md

# List pages

> List every page a monitor accepted with GET /v1/monitors/{id}/hits, newest first, one per story, filtered by importance.

List every page the monitor accepted, newest first, whether or not a run or webhook delivered it. To read a monitor without a webhook or schedule, poll this endpoint and stop at the first `id` you've already seen.


## OpenAPI

````yaml GET /v1/monitors/{id}/hits
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}/hits:
    get:
      tags:
        - Monitors
      summary: List a monitor's pages
      description: >-
        Every page the monitor accepted, newest first, one per story, whether or
        not a run or webhook delivered it. Covers the monitor's last 500 pages.
        To read a monitor without a webhook or schedule, poll this and stop at
        the first `id` you've already seen.
      operationId: monitors.pages
      parameters:
        - $ref: '#/components/parameters/MonitorId'
        - name: min_importance
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 5
          description: >-
            Only pages rated at least this important. `4` keeps the pages a
            reader wouldn't want to miss.
        - $ref: '#/components/parameters/MonitorLimit'
        - $ref: '#/components/parameters/MonitorCursor'
      responses:
        '200':
          description: A page of results
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorPageList'
        '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'
      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 pages = await client.monitors.pages("mon_3kq9z2c8f1a04b7d9e6f5a21", { limit: 10 });
              for (const page of pages.data) {
                console.log(page.importance, page.title, page.url);
              }
            }

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


            # reads KEENABLE_API_KEY from the environment

            client = Keenable()

            pages = client.monitors.pages("mon_3kq9z2c8f1a04b7d9e6f5a21",
            limit=10)

            for page in pages.data:
                print(page.importance, page.title, page.url)
        - 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\tpages, err := client.Monitors.Pages(context.Background(), \"mon_3kq9z2c8f1a04b7d9e6f5a21\", &keenable.MonitorPagesParams{Limit: 10})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfor _, page := range pages.Data {\n\t\timportance, title := 0, \"\"\n\t\tif page.Importance != nil {\n\t\t\timportance = *page.Importance\n\t\t}\n\t\tif page.Title != nil {\n\t\t\ttitle = *page.Title\n\t\t}\n\t\tfmt.Println(importance, title, page.URL)\n\t}\n}\n"
        - lang: rust
          label: Rust
          source: |
            use keenable::{Client, MonitorPagesParams};

            #[tokio::main]
            async fn main() -> Result<(), keenable::Error> {
                // reads KEENABLE_API_KEY from the environment
                let client = Client::new()?;
                let pages = client
                    .monitors()
                    .pages(
                        "mon_3kq9z2c8f1a04b7d9e6f5a21",
                        &MonitorPagesParams { limit: Some(10), ..Default::default() },
                    )
                    .await?;
                for page in pages.data {
                    let importance = page.importance.unwrap_or_default();
                    let title = page.title.unwrap_or_default();
                    println!("{importance} {title} {}", page.url);
                }
                Ok(())
            }
        - lang: bash
          label: curl
          source: >
            curl -G
            https://api.keenable.ai/v1/monitors/mon_3kq9z2c8f1a04b7d9e6f5a21/hits
            \
              -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:
    MonitorPageList:
      type: object
      required:
        - data
        - has_more
        - next_cursor
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MonitorPage'
        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.
    MonitorPage:
      type: object
      required:
        - id
        - url
        - same_story
      properties:
        id:
          type: string
          description: >-
            Identifies this match. Opaque. The last `id` of a page of results is
            its `next_cursor`.
        url:
          type: string
          example: https://huggingface.co/blog/example-model
        title:
          type: string
          nullable: true
        author:
          type: string
          nullable: true
          description: When the page names one. Always `null` in `monitor.hit` events.
        published_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the page was published, as far as Keenable could establish it.
            A monitor doesn't send a page it couldn't date, so this is `null`
            only in rare cases, such as a changed page (one with `change`) that
            declares no date.
        published_at_source:
          type: string
          nullable: true
          description: >-
            Where `published_at` comes from: `declared` (the page's metadata),
            `url` (a date in the URL), `x` (the ID of an X post) or `text` (the
            page text). `url` and `text` dates are known to the day.
        acquired_at:
          type: string
          format: date-time
          nullable: true
          description: When Keenable's crawler fetched this version of the page.
        matched_at:
          type: string
          format: date-time
          nullable: true
          description: When the monitor accepted the page. Sort and deduplicate on it.
        image:
          type: string
          nullable: true
          description: The page's lead image. Always `null` in `monitor.hit` events.
        favicon:
          type: string
          nullable: true
          description: Always `null` for now.
        highlights:
          type: array
          items:
            type: string
          nullable: true
          description: Always `null` for now.
        summary:
          type: string
          nullable: true
          description: One line on what the page reports.
        importance:
          type: integer
          minimum: 1
          maximum: 5
          nullable: true
          description: >-
            How much the page matters for this monitor's topic, from 1 to 5.
            Pages under 3 aren't accepted.
        kind:
          type: string
          nullable: true
          description: >-
            `news`, `new_item` (a new release, listing or filing),
            `social_chatter` or `other`.
        source_type:
          type: string
          nullable: true
          description: >-
            `original` (the source or first-hand reporting) or `rewrite`
            (retells another outlet).
        score:
          type: number
          nullable: true
          description: >-
            A relevance score for ordering one monitor's pages. It isn't a
            probability and isn't capped at 1. Don't compare it across monitors.
        text:
          type: string
          description: The page text, with `search.content.text`. Left out after 3 days.
        change:
          $ref: '#/components/schemas/MonitorChange'
        same_story:
          type: integer
          description: How many more pages reported the same story and were left out.
    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.
    MonitorChange:
      type: object
      description: On a page you already got that changed in substance.
      properties:
        previous_at:
          type: string
          nullable: true
          description: When the earlier version was matched.
        previous_title:
          type: string
          nullable: true
        previous_sent:
          type: boolean
          nullable: true
        ratio:
          type: number
          nullable: true
          description: How much of the text changed.
        added:
          nullable: true
          description: Text the new version added.
        removed:
          nullable: true
          description: Text the new 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; 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.