{
  "openapi": "3.0.3",
  "info": {
    "title": "Screenshot Engine API",
    "description": "Fast & Clean API for capturing website screenshots with customizable options",
    "version": "1.0.0"
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "name": "api_key",
        "in": "query",
        "description": "API key for authentication via query string"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key for authentication via Bearer token"
      }
    },
    "schemas": {}
  },
  "paths": {
    "/v1/screenshot": {
      "get": {
        "summary": "Take a website screenshot",
        "tags": [
          "Screenshot"
        ],
        "description": "Capture a screenshot of a website",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "example": "https://www.google.com",
            "in": "query",
            "name": "url",
            "required": true,
            "description": "The URL of the website to capture"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "image",
                "scrolling_video",
                "pdf"
              ],
              "default": "image"
            },
            "in": "query",
            "name": "output",
            "required": false,
            "description": "Output type"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "png",
                "jpeg",
                "webp"
              ],
              "default": "jpeg"
            },
            "in": "query",
            "name": "format",
            "required": false,
            "description": "Output image format"
          },
          {
            "schema": {
              "type": "string",
              "default": "1280"
            },
            "in": "query",
            "name": "width",
            "required": false,
            "description": "Viewport width in pixels (ignored if viewport_device is set)"
          },
          {
            "schema": {
              "type": "string",
              "default": "720"
            },
            "in": "query",
            "name": "height",
            "required": false,
            "description": "Viewport height in pixels, or \"full\" for full page screenshot (ignored if viewport_device is set)"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "default": "false"
            },
            "in": "query",
            "name": "block_banners",
            "required": false,
            "description": "Block cookie banners and consent dialogs"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "default": "false"
            },
            "in": "query",
            "name": "dark_mode",
            "required": false,
            "description": "Emulate dark color scheme preference"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "desktop-1080p",
                "desktop-720p",
                "desktop-4k",
                "macbook-pro-16",
                "macbook-pro-14",
                "macbook-air-13",
                "iphone-15-pro-max",
                "iphone-15-pro",
                "iphone-15",
                "iphone-14",
                "iphone-se",
                "ipad-pro-12.9",
                "ipad-pro-11",
                "ipad-air",
                "ipad-mini",
                "pixel-8-pro",
                "pixel-8",
                "samsung-galaxy-s24",
                "samsung-galaxy-s24-ultra",
                "samsung-galaxy-tab-s9"
              ]
            },
            "in": "query",
            "name": "viewport_device",
            "required": false,
            "description": "Use a preset device viewport (overrides width/height)"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "selector",
            "required": false,
            "description": "CSS selector to capture specific element"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "wait_for",
            "required": false,
            "description": "Time in milliseconds to wait after page load before capture"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "Letter",
                "Legal",
                "Tabloid",
                "A3",
                "A4",
                "A5"
              ]
            },
            "in": "query",
            "name": "pdf_paper_size",
            "required": false,
            "description": "Paper size for PDF output (only applies when output=pdf)"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "portrait",
                "landscape"
              ]
            },
            "in": "query",
            "name": "pdf_orientation",
            "required": false,
            "description": "Page orientation for PDF output (only applies when output=pdf)"
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Image, PDF, or scrolling WebM video returned as binary file bytes",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing required parameters",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - missing required parameters",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Unauthorized - invalid or missing API key",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit or monthly screenshot quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "API starting up or temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Take a website screenshot with optional watermark",
        "tags": [
          "Screenshot"
        ],
        "description": "Capture a screenshot of a website (POST)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The URL of the website to capture",
                    "example": "https://www.google.com"
                  },
                  "output": {
                    "type": "string",
                    "enum": [
                      "image",
                      "scrolling_video",
                      "pdf"
                    ],
                    "default": "image",
                    "description": "Output type"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "png",
                      "jpeg",
                      "webp"
                    ],
                    "description": "Output image format"
                  },
                  "width": {
                    "type": "number",
                    "description": "Viewport width in pixels (ignored if viewportDevice is set)"
                  },
                  "height": {
                    "oneOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "full"
                        ]
                      }
                    ],
                    "description": "Viewport height in pixels, or \"full\" for full page screenshot (ignored if viewportDevice is set)"
                  },
                  "blockBanners": {
                    "type": "boolean",
                    "description": "Block cookie banners and consent dialogs"
                  },
                  "darkMode": {
                    "type": "boolean",
                    "description": "Emulate dark color scheme preference"
                  },
                  "viewportDevice": {
                    "type": "string",
                    "enum": [
                      "desktop-1080p",
                      "desktop-720p",
                      "desktop-4k",
                      "macbook-pro-16",
                      "macbook-pro-14",
                      "macbook-air-13",
                      "iphone-15-pro-max",
                      "iphone-15-pro",
                      "iphone-15",
                      "iphone-14",
                      "iphone-se",
                      "ipad-pro-12.9",
                      "ipad-pro-11",
                      "ipad-air",
                      "ipad-mini",
                      "pixel-8-pro",
                      "pixel-8",
                      "samsung-galaxy-s24",
                      "samsung-galaxy-s24-ultra",
                      "samsung-galaxy-tab-s9"
                    ],
                    "description": "Use a preset device viewport (overrides width/height)"
                  },
                  "selector": {
                    "type": "string",
                    "description": "CSS selector to capture specific element"
                  },
                  "waitFor": {
                    "type": "number",
                    "description": "Time in milliseconds to wait after page load before capture"
                  },
                  "cachePolicy": {
                    "type": "string",
                    "enum": [
                      "default",
                      "no-cache"
                    ],
                    "default": "default",
                    "description": "Cache behavior: \"default\" uses cache, \"no-cache\" forces fresh capture without reading or writing the cache"
                  },
                  "watermark": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "position": {
                        "type": "string",
                        "enum": [
                          "top-left",
                          "top-middle",
                          "top-right",
                          "middle-left",
                          "center",
                          "middle-right",
                          "bottom-left",
                          "bottom-center",
                          "bottom-right"
                        ]
                      },
                      "textColor": {
                        "type": "string",
                        "enum": [
                          "White",
                          "Black",
                          "Red",
                          "Blue"
                        ]
                      },
                      "backgroundColor": {
                        "type": "string",
                        "enum": [
                          "White",
                          "Black",
                          "Red",
                          "Blue"
                        ]
                      }
                    },
                    "required": [
                      "text"
                    ]
                  },
                  "pdfSettings": {
                    "type": "object",
                    "description": "PDF-specific settings (only applies when output=pdf)",
                    "properties": {
                      "paperSize": {
                        "type": "string",
                        "enum": [
                          "Letter",
                          "Legal",
                          "Tabloid",
                          "A3",
                          "A4",
                          "A5"
                        ],
                        "description": "Paper size for PDF output"
                      },
                      "orientation": {
                        "type": "string",
                        "enum": [
                          "portrait",
                          "landscape"
                        ],
                        "description": "Page orientation for PDF output"
                      }
                    }
                  }
                }
              },
              "example": {
                "url": "https://example.com",
                "format": "png",
                "height": "full"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Image, PDF, or scrolling WebM video returned as binary file bytes",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing required parameters",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - missing required parameters",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Unauthorized - invalid or missing API key",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit or monthly screenshot quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "API starting up or temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.screenshotengine.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Screenshot",
      "description": "Screenshot capture endpoints"
    },
    {
      "name": "Health",
      "description": "Health check endpoints"
    }
  ]
}