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

# Create a monitor

> Create a scheduled check on a page that notifies only when a real change is detected.



## OpenAPI

````yaml post /v1/monitors
openapi: 3.1.0
info:
  title: Scrapio
  version: 1.0.0
  description: >-
    Turn any URL into structured data. Fetch raw HTML, crawl sites, extract
    structured content, interact with dynamic pages, and search the web through
    one API.
  contact:
    name: Scrapio Support
    url: https://scrapio.dev
  license:
    name: Proprietary
servers:
  - url: https://api.scrapio.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: System
  - name: Fetch
  - name: Crawl
  - name: Map
  - name: Interact
  - name: Search
  - name: Google
  - name: Fast Search
  - name: Jobs
  - name: YouTube
  - name: Amazon
  - name: Walmart
  - name: Booking
  - name: Agoda
  - name: Airbnb
  - name: ChatGPT
  - name: Perplexity
  - name: Gemini
  - name: Bing
  - name: Reddit
  - name: TikTok
  - name: Apple App Store
  - name: Target
  - name: Monitors
paths:
  /v1/monitors:
    post:
      tags:
        - Monitors
      summary: Create a monitor
      description: >-
        Creates a scheduled check on a page: `mode: "fields"` (default) diffs
        named extracted fields between runs, `mode: "content"` diffs the whole
        page as markdown. Notifies via `webhook_endpoint_id` (see the Webhooks
        guide) only when a real change is detected.
      operationId: createMonitor
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMonitorRequest'
            examples:
              basic:
                summary: Watch a product's price hourly
                value:
                  name: Widget price watch
                  url: https://example.com/product/widget
                  cron: 0 * * * *
                  extract:
                    price: the current price
                  watch:
                    fields:
                      - price
      responses:
        '201':
          description: Monitor created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorResponse'
        '400':
          description: Invalid monitor parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Plan's active-schedule limit reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl -X POST https://api.scrapio.dev/v1/monitors \
              -H "Authorization: Bearer $SCRAPIO_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{"name":"Widget price watch","url":"https://example.com/product/widget","cron":"0 * * * *","extract":{"price":"the current price"},"watch":{"fields":["price"]}}'
components:
  schemas:
    CreateMonitorRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Human-readable monitor name
        url:
          type: string
          format: uri
          description: Page to check on each run
        mode:
          description: >-
            "fields" diffs named extracted fields (default); "content" diffs the
            whole page as markdown
          type: string
          enum:
            - fields
            - content
        extract:
          description: >-
            Field schema, required for mode "fields" (e.g. {"price": "the
            current price"})
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: string
        cron:
          type: string
          minLength: 1
          description: Cron expression for the check schedule
        watch:
          type: object
          properties:
            fields:
              description: Field names to compare between runs (mode "fields" only)
              type: array
              items:
                type: string
            'on':
              description: >-
                Notify when any watched field changes, or only when all do
                (default: any)
              type: string
              enum:
                - any
                - all
            notify_on_first_run:
              description: 'Whether the very first run counts as a change (default: false)'
              type: boolean
            thresholds:
              description: Per-field minimum-change thresholds before a value change counts
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: object
                properties:
                  abs:
                    description: >-
                      Trigger only if the field moves by at least this absolute
                      amount
                    type: number
                  pct:
                    description: >-
                      Trigger only if the field moves by at least this
                      percentage of its previous value (0-100)
                    type: number
            ignore_patterns:
              description: Regex patterns; a field change matching one is ignored
              type: array
              items:
                type: string
            digest_interval_minutes:
              description: >-
                Batch changes into a periodic digest instead of notifying
                per-run
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
        webhook_endpoint_id:
          description: Webhook endpoint to notify on a detected change
          type: string
      required:
        - name
        - url
        - cron
    MonitorResponse:
      type: object
      properties:
        request_id:
          type: string
        id:
          type: string
        tenant_id:
          type: string
        name:
          type: string
        url:
          type: string
        mode:
          type: string
          enum:
            - fields
            - content
        extract:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties:
                type: string
            - type: 'null'
        cron:
          type: string
        watch:
          type: object
          properties:
            fields:
              type: array
              items:
                type: string
            'on':
              type: string
              enum:
                - any
                - all
            notify_on_first_run:
              type: boolean
            thresholds:
              anyOf:
                - type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: object
                    properties:
                      abs:
                        description: >-
                          Trigger only if the field moves by at least this
                          absolute amount
                        type: number
                      pct:
                        description: >-
                          Trigger only if the field moves by at least this
                          percentage of its previous value (0-100)
                        type: number
                - type: 'null'
            ignore_patterns:
              anyOf:
                - type: array
                  items:
                    type: string
                - type: 'null'
            digest_interval_minutes:
              anyOf:
                - type: number
                - type: 'null'
          required:
            - fields
            - 'on'
            - notify_on_first_run
            - thresholds
            - ignore_patterns
            - digest_interval_minutes
        webhook_endpoint_id:
          anyOf:
            - type: string
            - type: 'null'
        active:
          type: boolean
        last_run_at:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        next_run_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        last_digest_at:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        created_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        updated_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - request_id
        - id
        - tenant_id
        - name
        - url
        - mode
        - extract
        - cron
        - watch
        - webhook_endpoint_id
        - active
        - last_run_at
        - next_run_at
        - last_digest_at
        - created_at
        - updated_at
    ErrorResponse:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
        diagnostics:
          type: object
          properties:
            outcome:
              type: string
              enum:
                - failed
            retryable:
              type: boolean
            blocked:
              type: boolean
            timed_out:
              type: boolean
          required:
            - outcome
            - retryable
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````