fulcrum: "1.0"
name: screenshot_url
description: >
  Capture a screenshot of any URL as a PNG image. Returns base64-encoded image
  data suitable for display or analysis. Uses screenshotapi.net free tier.

schema:
  input:
    type: object
    properties:
      url:
        type: string
        description: Full URL to screenshot (must include https://)
        examples:
          - "https://example.com"
      width:
        type: integer
        description: Viewport width in pixels
        default: 1920
        minimum: 320
        maximum: 3840
      height:
        type: integer
        description: Viewport height in pixels
        default: 1080
        minimum: 240
        maximum: 2160
      full_page:
        type: boolean
        description: Capture full scrollable page (not just viewport)
        default: false
      delay:
        type: integer
        description: Delay in milliseconds before screenshot (useful for JS-heavy pages)
        default: 0
        minimum: 0
        maximum: 10000
    required:
      - url
  output:
    type: object
    properties:
      data:
        type: string
        description: Base64-encoded PNG image data
      mime_type:
        type: string
        description: Always "image/png"
      size:
        type: integer
        description: Image size in bytes

providers:
  primary:
    service: rest
    cost_per_call: 0
    timeout: 30
    config:
      base_url: https://shot.screenshotapi.net
      path: /screenshot
      method: GET
      response_format: binary
      params:
        token: "{env.SCREENSHOT_API_KEY}"
        url: "{url}"
        width: "{width}"
        height: "{height}"
        full_page: "{full_page}"
        delay: "{delay}"
        output: image
        file_type: png

auth:
  required: true
  type: api_key
  key: "env:SCREENSHOT_API_KEY"
  description: >
    Get a free API key at https://screenshotapi.net (1000 screenshots/month free).
    Set SCREENSHOT_API_KEY environment variable.
  param: token

cache:
  strategy: exact
  ttl: 300

metadata:
  category: media
  tags:
    - screenshot
    - image
    - web
    - capture
    - visual
  cost_category: free
  execution_time: medium
  read_only: true
  produces:
    - imageData
  docs: https://screenshotapi.net/documentation
