{
  "openapi": "3.1.0",
  "info": {
    "title": "screenshot.com.ar API",
    "version": "1.0.0",
    "summary": "Screenshots and clean markdown from any public web page, rendered in a real Chrome browser.",
    "description": "Send a URL and get a screenshot or the page content as markdown. A remote MCP server is also available at https://screenshot.com.ar/mcp. Free API key: https://screenshot.com.ar/#clave. Docs: https://screenshot.com.ar/docs",
    "contact": {
      "email": "hola@screenshot.com.ar",
      "url": "https://screenshot.com.ar/docs"
    },
    "termsOfService": "https://screenshot.com.ar/terminos"
  },
  "servers": [
    {
      "url": "https://screenshot.com.ar"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "BearerAuth": []
    },
    {
      "ApiKeyQuery": []
    }
  ],
  "paths": {
    "/v1/capture": {
      "get": {
        "operationId": "captureScreenshot",
        "summary": "Take a screenshot of a web page",
        "description": "Opens the page in Chrome and returns the image. Each new capture uses 1 from the monthly quota; cached results are free.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "description": "Public http(s) URL to capture. If the scheme is missing, https:// is assumed.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": true,
            "example": "https://example.com"
          },
          {
            "name": "width",
            "in": "query",
            "description": "Viewport width in pixels.",
            "schema": {
              "type": "integer",
              "minimum": 320,
              "maximum": 1920,
              "default": 1280
            }
          },
          {
            "name": "height",
            "in": "query",
            "description": "Viewport height in pixels.",
            "schema": {
              "type": "integer",
              "minimum": 240,
              "maximum": 1920,
              "default": 800
            }
          },
          {
            "name": "full_page",
            "in": "query",
            "description": "Capture the whole scrollable page (up to 10000 px high).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Image format.",
            "schema": {
              "type": "string",
              "enum": [
                "png",
                "jpeg",
                "webp"
              ],
              "default": "png"
            }
          },
          {
            "name": "quality",
            "in": "query",
            "description": "Image quality (jpeg and webp only).",
            "schema": {
              "type": "integer",
              "minimum": 10,
              "maximum": 100,
              "default": 80
            }
          },
          {
            "name": "delay",
            "in": "query",
            "description": "Milliseconds to wait before capturing.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 5000,
              "default": 0
            }
          },
          {
            "name": "dark",
            "in": "query",
            "description": "Request the page's dark color scheme (prefers-color-scheme: dark).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cache_ttl",
            "in": "query",
            "description": "Seconds to keep the result in cache. 0 disables the cache.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2592000,
              "default": 86400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The screenshot.",
            "headers": {
              "X-Cache": {
                "description": "HIT if served from cache (does not use quota), MISS otherwise.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "HIT",
                    "MISS"
                  ]
                }
              },
              "X-Quota-Remaining": {
                "description": "Captures left this month (only on MISS).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/png"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/jpeg"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/webp"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or URL not allowed (`invalid_params`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (`missing_key`, `invalid_key`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "API key revoked (`key_revoked`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The capture is larger than 10 MB (`too_large`). Use jpeg or webp, or drop full_page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Domain not found, DNS could not be verified, or the page could not be loaded (`host_not_found`, `dns_error`, `render_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Monthly quota exceeded (`quota_exceeded`), free-plan daily browser time used up (`browser_limit`), or too many requests per IP.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily busy (`busy`). Retry after a few seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/read": {
      "get": {
        "operationId": "readPage",
        "summary": "Read a web page as markdown (with optional screenshot)",
        "description": "Opens the page once and returns its main content as clean markdown (no navigation, footers, ads or cookie banners) and, optionally, a base64 screenshot. Uses 1 capture from the monthly quota; cached results are free.",
        "parameters": [
          {
            "name": "screenshot",
            "in": "query",
            "description": "Include a base64 screenshot in the response.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "max_chars",
            "in": "query",
            "description": "Maximum length of the markdown.",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 200000,
              "default": 50000
            }
          },
          {
            "name": "url",
            "in": "query",
            "description": "Public http(s) URL to capture. If the scheme is missing, https:// is assumed.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "required": true,
            "example": "https://example.com"
          },
          {
            "name": "width",
            "in": "query",
            "description": "Viewport width in pixels.",
            "schema": {
              "type": "integer",
              "minimum": 320,
              "maximum": 1920,
              "default": 1280
            }
          },
          {
            "name": "height",
            "in": "query",
            "description": "Viewport height in pixels.",
            "schema": {
              "type": "integer",
              "minimum": 240,
              "maximum": 1920,
              "default": 800
            }
          },
          {
            "name": "full_page",
            "in": "query",
            "description": "Capture the whole scrollable page (up to 10000 px high).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Image format.",
            "schema": {
              "type": "string",
              "enum": [
                "png",
                "jpeg",
                "webp"
              ],
              "default": "png"
            }
          },
          {
            "name": "quality",
            "in": "query",
            "description": "Image quality (jpeg and webp only).",
            "schema": {
              "type": "integer",
              "minimum": 10,
              "maximum": 100,
              "default": 80
            }
          },
          {
            "name": "delay",
            "in": "query",
            "description": "Milliseconds to wait before capturing.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 5000,
              "default": 0
            }
          },
          {
            "name": "dark",
            "in": "query",
            "description": "Request the page's dark color scheme (prefers-color-scheme: dark).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cache_ttl",
            "in": "query",
            "description": "Seconds to keep the result in cache. 0 disables the cache.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2592000,
              "default": 86400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page content.",
            "headers": {
              "X-Cache": {
                "description": "HIT if served from cache (does not use quota), MISS otherwise.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "HIT",
                    "MISS"
                  ]
                }
              },
              "X-Quota-Remaining": {
                "description": "Captures left this month (only on MISS).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or URL not allowed (`invalid_params`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key (`missing_key`, `invalid_key`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "API key revoked (`key_revoked`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The capture is larger than 10 MB (`too_large`). Use jpeg or webp, or drop full_page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Domain not found, DNS could not be verified, or the page could not be loaded (`host_not_found`, `dns_error`, `render_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Monthly quota exceeded (`quota_exceeded`), free-plan daily browser time used up (`browser_limit`), or too many requests per IP.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily busy (`busy`). Retry after a few seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "The API key as a bearer token."
      },
      "ApiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "key",
        "description": "Useful for <img> tags. Keep these URLs private."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Error code.",
            "examples": [
              "quota_exceeded"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable message (Spanish)."
          }
        }
      },
      "ReadResult": {
        "type": "object",
        "required": [
          "url",
          "title",
          "description",
          "markdown",
          "truncated",
          "screenshot",
          "captured_at"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Final URL after redirects."
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "description": "Meta description, if any."
          },
          "markdown": {
            "type": "string",
            "description": "Main content of the page as markdown."
          },
          "truncated": {
            "type": "boolean",
            "description": "true if the markdown was cut at max_chars."
          },
          "screenshot": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "format",
                  "base64"
                ],
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "png",
                      "jpeg",
                      "webp"
                    ]
                  },
                  "base64": {
                    "type": "string",
                    "contentEncoding": "base64"
                  }
                }
              }
            ]
          },
          "captured_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the page was rendered (older on cache hits)."
          }
        }
      }
    }
  }
}