{
  "openapi": "3.1.0",
  "info": {
    "title": "CaptureRecall Website Screenshot API",
    "version": "1.0.0",
    "description": "Public website screenshots for backend integrations. Free: 25 capture attempts/month. Personal: 1,000/month. Team: 1,000/month per paid seat. UTC calendar months, hard quotas, no automatic overage charges. Failed captures and cache hits count. Rate and shared capacity limits apply.",
    "termsOfService": "https://capturerecall.com/terms/"
  },
  "servers": [
    {
      "url": "https://capturerecall.com/api/developer/v1"
    }
  ],
  "security": [
    {
      "developerKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "developerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Create a cr_api_ key in the developer dashboard; keep it in your backend secret manager."
      }
    },
    "schemas": {
      "CaptureRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "Public HTTP(S) URL without credentials or custom ports."
          },
          "width": {
            "type": "integer",
            "minimum": 320,
            "maximum": 1920,
            "default": 1280
          },
          "height": {
            "type": "integer",
            "minimum": 240,
            "maximum": 1080,
            "default": 720
          },
          "fullPage": {
            "type": "boolean",
            "default": false
          },
          "format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ],
            "default": "png"
          },
          "save": {
            "type": "boolean",
            "default": false,
            "description": "Requires PNG and an active hosted plan; stored privately under the existing library quota."
          },
          "metadata": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "maxLength": 240
              },
              "description": {
                "type": "string",
                "maxLength": 2000
              },
              "note": {
                "type": "string",
                "maxLength": 4000
              },
              "tags": {
                "type": "array",
                "maxItems": 32,
                "items": {
                  "type": "string",
                  "maxLength": 60
                }
              },
              "favorite": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/screenshots": {
      "post": {
        "operationId": "captureScreenshot",
        "summary": "Capture a public website as PNG or JPEG",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaptureRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Binary screenshot (maximum 8 MiB)",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "201": {
            "description": "Saved private PNG; JSON includes id, sha256 and authenticated download path"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Hosted plan required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds 8 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Image exceeds 8 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Monthly quota, rate or shared capacity reached; inspect code before retrying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Website capture failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service paused or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Hosted storage is full or a save conflict occurred"
          }
        }
      }
    },
    "/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Current plan, monthly limit, used attempts and UTC period",
        "responses": {
          "200": {
            "description": "Account usage as JSON"
          },
          "401": {
            "description": "Invalid, expired or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/captures/{id}": {
      "get": {
        "operationId": "downloadCapture",
        "summary": "Download a private PNG in the key\u2019s assigned library",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private PNG",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No capture in the assigned library"
          }
        }
      }
    }
  }
}
