{
  "openapi": "3.1.0",
  "info": {
    "title": "Richscripts Shots API",
    "version": "0.1.0",
    "description": "Public HTTP(S) URLs, standard ports only. One concurrent capture per account, 20 requests/minute. Full-page limit: 12000 pixels high and 24 million pixels. Images are not retained."
  },
  "servers": [
    {
      "url": "/",
      "description": "Current service origin"
    }
  ],
  "paths": {
    "/v1/screenshot": {
      "post": {
        "summary": "Capture a public webpage",
        "operationId": "captureScreenshot",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 320,
                    "maximum": 2560,
                    "default": 1440
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 240,
                    "maximum": 2560,
                    "default": 900
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "png",
                      "jpeg",
                      "webp",
                      "pdf"
                    ],
                    "default": "png"
                  },
                  "fullPage": {
                    "type": "boolean",
                    "default": false
                  },
                  "delay": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3000,
                    "default": 500
                  },
                  "cleanPage": {
                    "type": "boolean",
                    "default": false,
                    "description": "Best-effort hiding of common cookie and chat widgets; not universal ad blocking."
                  },
                  "mobile": {
                    "type": "boolean",
                    "default": false,
                    "description": "Enable Chromium mobile layout and touch emulation."
                  },
                  "blockAds": {
                    "type": "boolean",
                    "default": false,
                    "description": "Best-effort common-provider blocking; coverage is not universal."
                  },
                  "blockCookieBanners": {
                    "type": "boolean",
                    "default": false,
                    "description": "Best-effort common-provider blocking; coverage is not universal."
                  },
                  "blockChats": {
                    "type": "boolean",
                    "default": false,
                    "description": "Best-effort common-provider blocking; coverage is not universal."
                  },
                  "quality": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 85,
                    "description": "JPEG and WebP only."
                  },
                  "deviceScaleFactor": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3,
                    "default": 1
                  },
                  "selector": {
                    "type": "string",
                    "maxLength": 300,
                    "description": "Capture the first matching element."
                  },
                  "clipX": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 12000
                  },
                  "clipY": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 12000
                  },
                  "clipWidth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2560
                  },
                  "clipHeight": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12000
                  },
                  "waitUntil": {
                    "type": "string",
                    "enum": [
                      "domcontentloaded",
                      "load",
                      "networkidle"
                    ],
                    "default": "domcontentloaded"
                  },
                  "waitForSelector": {
                    "type": "string",
                    "maxLength": 300,
                    "description": "Wait up to 10 seconds for this element to be visible."
                  },
                  "hideSelectors": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  },
                  "styles": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "Custom CSS; @import and url() are rejected."
                  },
                  "darkMode": {
                    "type": "boolean",
                    "default": false
                  },
                  "landscape": {
                    "type": "boolean",
                    "default": false
                  },
                  "timezone": {
                    "type": "string",
                    "example": "America/New_York"
                  },
                  "locale": {
                    "type": "string",
                    "example": "en-US"
                  },
                  "html": {
                    "type": "string",
                    "maxLength": 200000,
                    "description": "HTML to render instead of url. POST /v1/screenshot only."
                  }
                },
                "oneOf": [
                  {
                    "required": [
                      "url"
                    ]
                  },
                  {
                    "required": [
                      "html"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screenshot or PDF bytes. One credit charged.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "X-Credits-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or blocked destination",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "No credits remaining",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Capture failed; credit refunded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited or busy; Retry-After: 5 when capacity is busy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "Capture timed out; credit refunded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/take": {
      "get": {
        "summary": "Capture via Bearer header or a single-use signed token",
        "security": [
          {
            "apiKey": []
          },
          {
            "captureToken": []
          }
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uri",
              "maxLength": 2048
            }
          },
          {
            "name": "width",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 320,
              "maximum": 2560,
              "default": 1440
            }
          },
          {
            "name": "height",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 240,
              "maximum": 2560,
              "default": 900
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "png",
                "jpeg",
                "webp",
                "pdf"
              ],
              "default": "png"
            }
          },
          {
            "name": "fullPage",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "delay",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 3000,
              "default": 500
            }
          },
          {
            "name": "cleanPage",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "Best-effort hiding of common cookie and chat widgets; not universal ad blocking."
            }
          },
          {
            "name": "mobile",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "Enable Chromium mobile layout and touch emulation."
            }
          },
          {
            "name": "blockAds",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "Best-effort common-provider blocking; coverage is not universal."
            }
          },
          {
            "name": "blockCookieBanners",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "Best-effort common-provider blocking; coverage is not universal."
            }
          },
          {
            "name": "blockChats",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "Best-effort common-provider blocking; coverage is not universal."
            }
          },
          {
            "name": "quality",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 85,
              "description": "JPEG and WebP only."
            }
          },
          {
            "name": "deviceScaleFactor",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3,
              "default": 1
            }
          },
          {
            "name": "selector",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 300,
              "description": "Capture the first matching element."
            }
          },
          {
            "name": "clipX",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 12000
            }
          },
          {
            "name": "clipY",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 12000
            }
          },
          {
            "name": "clipWidth",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2560
            }
          },
          {
            "name": "clipHeight",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12000
            }
          },
          {
            "name": "waitUntil",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "domcontentloaded",
                "load",
                "networkidle"
              ],
              "default": "domcontentloaded"
            }
          },
          {
            "name": "waitForSelector",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 300,
              "description": "Wait up to 10 seconds for this element to be visible."
            }
          },
          {
            "name": "hideSelectors",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Comma-separated CSS selectors."
            }
          },
          {
            "name": "styles",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 5000,
              "description": "Custom CSS; @import and url() are rejected."
            }
          },
          {
            "name": "darkMode",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "landscape",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "America/New_York"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "en-US"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Screenshot bytes. One credit charged. JPEG quality 85.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "X-Credits-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or blocked destination",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "No credits remaining",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Capture failed; credit refunded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited or busy; Retry-After: 5 when capacity is busy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "Capture timed out; credit refunded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/capture-links": {
      "post": {
        "summary": "Create a signed single-use capture URL valid for ten minutes",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 320,
                    "maximum": 2560,
                    "default": 1440
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 240,
                    "maximum": 2560,
                    "default": 900
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "png",
                      "jpeg",
                      "pdf"
                    ],
                    "default": "png"
                  },
                  "fullPage": {
                    "type": "boolean",
                    "default": false
                  },
                  "delay": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3000,
                    "default": 500
                  },
                  "cleanPage": {
                    "type": "boolean",
                    "default": false,
                    "description": "Best-effort hiding of common cookie and chat widgets; not universal ad blocking."
                  },
                  "mobile": {
                    "type": "boolean",
                    "default": false,
                    "description": "Enable Chromium mobile layout and touch emulation."
                  },
                  "blockAds": {
                    "type": "boolean",
                    "default": false,
                    "description": "Best-effort common-provider blocking; coverage is not universal."
                  },
                  "blockCookieBanners": {
                    "type": "boolean",
                    "default": false,
                    "description": "Best-effort common-provider blocking; coverage is not universal."
                  },
                  "blockChats": {
                    "type": "boolean",
                    "default": false,
                    "description": "Best-effort common-provider blocking; coverage is not universal."
                  },
                  "quality": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 85,
                    "description": "JPEG only."
                  },
                  "deviceScaleFactor": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3,
                    "default": 1
                  },
                  "selector": {
                    "type": "string",
                    "maxLength": 300,
                    "description": "Capture the first matching element."
                  },
                  "clipX": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 12000
                  },
                  "clipY": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 12000
                  },
                  "clipWidth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2560
                  },
                  "clipHeight": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12000
                  },
                  "waitUntil": {
                    "type": "string",
                    "enum": [
                      "domcontentloaded",
                      "load",
                      "networkidle"
                    ],
                    "default": "domcontentloaded"
                  },
                  "waitForSelector": {
                    "type": "string",
                    "maxLength": 300,
                    "description": "Wait up to 10 seconds for this element to be visible."
                  },
                  "hideSelectors": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  },
                  "styles": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "Custom CSS; @import and url() are rejected."
                  },
                  "darkMode": {
                    "type": "boolean",
                    "default": false
                  },
                  "landscape": {
                    "type": "boolean",
                    "default": false
                  },
                  "timezone": {
                    "type": "string",
                    "example": "America/New_York"
                  },
                  "locale": {
                    "type": "string",
                    "example": "en-US"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Capture URL with expiresAt and singleUse; creating the link uses no credit."
          },
          "401": {
            "description": "Invalid authentication"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Create a key in the dashboard. Never put it in client-side code or a URL."
      },
      "captureToken": {
        "type": "apiKey",
        "in": "query",
        "name": "token",
        "description": "Signed, single-use capability from POST /api/capture-links. Expires in ten minutes."
      }
    }
  }
}