{
  "openapi": "3.1.0",
  "info": {
    "title": "Puptra PDF Snapshot",
    "description": "One-call URL-to-PDF and full-page screenshot API with Puppeteer's page.pdf()/page.screenshot() semantics — an alternative to running puppeteer yourself or the Browserless PDF API, without any headless-browser infrastructure.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://puptra-pdf-snapshot.saastemly.com"
    }
  ],
  "paths": {
    "/v1/pdf": {
      "post": {
        "operationId": "pdf",
        "summary": "Render a URL or HTML to PDF with Puppeteer's page.pdf() options (format letter by default, scale, margins, header/footer templates, printBackground, pageRanges).",
        "description": "Render a URL or HTML to PDF with Puppeteer's page.pdf() options (format letter by default, scale, margins, header/footer templates, printBackground, pageRanges).\n\nPrice: $0.005 per call (x402, or prepaid credits with an API key).",
        "x-price-usd": 0.005,
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "example": {
                  "contentType": "application/pdf",
                  "bytes": 18234
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (nothing is charged)"
          },
          "402": {
            "description": "Payment required: the x402 terms are in the PAYMENT-REQUIRED header; or send an API key"
          }
        },
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The page to render (https). Set url or html, not both."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML to render instead of a URL."
                  },
                  "pdfOptions": {
                    "type": "object",
                    "description": "Puppeteer page.pdf() options as documented at pptr.dev/api/puppeteer.pdfoptions.",
                    "properties": {
                      "scale": {
                        "type": "number",
                        "description": "0.1-2, default 1"
                      },
                      "format": {
                        "type": "string",
                        "description": "letter|legal|tabloid|ledger|a0|a1|a2|a3|a4|a5|a6 (default letter)"
                      },
                      "width": {
                        "type": "string",
                        "description": "Paper width, e.g. \"8.5in\""
                      },
                      "height": {
                        "type": "string",
                        "description": "Paper height, e.g. \"11in\""
                      },
                      "landscape": {
                        "type": "boolean"
                      },
                      "printBackground": {
                        "type": "boolean"
                      },
                      "displayHeaderFooter": {
                        "type": "boolean"
                      },
                      "headerTemplate": {
                        "type": "string",
                        "description": "HTML with date/title/url/pageNumber/totalPages classes"
                      },
                      "footerTemplate": {
                        "type": "string"
                      },
                      "margin": {
                        "type": "object",
                        "description": "{top,bottom,left,right}"
                      },
                      "pageRanges": {
                        "type": "string",
                        "description": "e.g. \"1-5, 8, 11-13\""
                      },
                      "preferCSSPageSize": {
                        "type": "boolean"
                      },
                      "omitBackground": {
                        "type": "boolean"
                      },
                      "tagged": {
                        "type": "boolean"
                      },
                      "outline": {
                        "type": "boolean"
                      },
                      "timeout": {
                        "type": "number",
                        "description": "0-60000 ms, default 30000"
                      }
                    }
                  },
                  "viewport": {
                    "type": "object",
                    "description": "{width,height,deviceScaleFactor,isMobile,hasTouch,isLandscape}; default 1920x1080"
                  },
                  "gotoOptions": {
                    "type": "object",
                    "description": "{waitUntil: load|domcontentloaded|networkidle0|networkidle2, timeout}"
                  },
                  "waitForSelector": {
                    "type": "object",
                    "description": "{selector, visible?, hidden?, timeout}"
                  },
                  "waitForTimeout": {
                    "type": "number",
                    "description": "Extra wait in ms (0-120000)"
                  },
                  "addScriptTag": {
                    "type": "array",
                    "description": "[{content|url}]"
                  },
                  "addStyleTag": {
                    "type": "array",
                    "description": "[{content|url}]"
                  },
                  "cookies": {
                    "type": "array",
                    "description": "Cookies to set before loading"
                  },
                  "authenticate": {
                    "type": "object",
                    "description": "{username,password}"
                  },
                  "setExtraHTTPHeaders": {
                    "type": "object",
                    "description": "Extra HTTP headers"
                  },
                  "userAgent": {
                    "type": "string"
                  },
                  "setJavaScriptEnabled": {
                    "type": "boolean"
                  },
                  "emulateMediaType": {
                    "type": "string",
                    "description": "screen|print"
                  },
                  "bestAttempt": {
                    "type": "boolean",
                    "description": "Proceed when awaited events fail or time out"
                  },
                  "rejectResourceTypes": {
                    "type": "array",
                    "description": "e.g. [\"image\"]"
                  },
                  "rejectRequestPattern": {
                    "type": "array"
                  },
                  "allowResourceTypes": {
                    "type": "array"
                  },
                  "allowRequestPattern": {
                    "type": "array"
                  },
                  "deliver": {
                    "type": "object",
                    "description": "{store: \"1d\"|\"7d\"|\"30d\"|\"365d\", name?}: keep the PDF in file storage and answer with metadata instead of bytes"
                  }
                },
                "required": []
              },
              "example": {
                "url": "https://example.com/",
                "pdfOptions": {
                  "format": "a4",
                  "printBackground": true
                },
                "gotoOptions": {
                  "waitUntil": "networkidle0"
                }
              }
            }
          }
        }
      }
    },
    "/v1/screenshot": {
      "post": {
        "operationId": "screenshot",
        "summary": "Capture a PNG, JPEG or WebP screenshot with Puppeteer's page.screenshot() options (fullPage, clip, omitBackground, quality 0-100 for jpeg/webp only).",
        "description": "Capture a PNG, JPEG or WebP screenshot with Puppeteer's page.screenshot() options (fullPage, clip, omitBackground, quality 0-100 for jpeg/webp only).\n\nPrice: $0.005 per call (x402, or prepaid credits with an API key).",
        "x-price-usd": 0.005,
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "example": {
                  "contentType": "image/png",
                  "bytes": 45123
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (nothing is charged)"
          },
          "402": {
            "description": "Payment required: the x402 terms are in the PAYMENT-REQUIRED header; or send an API key"
          }
        },
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The page to capture (https). Set url or html, not both."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML to render instead of a URL."
                  },
                  "screenshotOptions": {
                    "type": "object",
                    "description": "Puppeteer page.screenshot() options as documented at pptr.dev/api/puppeteer.screenshotoptions.",
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "png|jpeg|webp (default png)"
                      },
                      "quality": {
                        "type": "number",
                        "description": "0-100, jpeg/webp only"
                      },
                      "fullPage": {
                        "type": "boolean"
                      },
                      "clip": {
                        "type": "object",
                        "description": "{x,y,width,height,scale?}"
                      },
                      "omitBackground": {
                        "type": "boolean"
                      },
                      "optimizeForSpeed": {
                        "type": "boolean"
                      },
                      "captureBeyondViewport": {
                        "type": "boolean"
                      },
                      "fromSurface": {
                        "type": "boolean"
                      }
                    }
                  },
                  "selector": {
                    "type": "string",
                    "description": "Screenshot this element instead of the page"
                  },
                  "scrollPage": {
                    "type": "boolean",
                    "description": "Scroll the page before capturing (lazy content)"
                  },
                  "viewport": {
                    "type": "object",
                    "description": "{width,height,deviceScaleFactor,...}; default 1920x1080"
                  },
                  "gotoOptions": {
                    "type": "object",
                    "description": "{waitUntil, timeout}"
                  },
                  "waitForSelector": {
                    "type": "object"
                  },
                  "waitForTimeout": {
                    "type": "number"
                  },
                  "addScriptTag": {
                    "type": "array"
                  },
                  "addStyleTag": {
                    "type": "array"
                  },
                  "cookies": {
                    "type": "array"
                  },
                  "authenticate": {
                    "type": "object"
                  },
                  "setExtraHTTPHeaders": {
                    "type": "object"
                  },
                  "userAgent": {
                    "type": "string"
                  },
                  "setJavaScriptEnabled": {
                    "type": "boolean"
                  },
                  "emulateMediaType": {
                    "type": "string"
                  },
                  "bestAttempt": {
                    "type": "boolean"
                  },
                  "rejectResourceTypes": {
                    "type": "array"
                  },
                  "rejectRequestPattern": {
                    "type": "array"
                  },
                  "allowResourceTypes": {
                    "type": "array"
                  },
                  "allowRequestPattern": {
                    "type": "array"
                  },
                  "deliver": {
                    "type": "object",
                    "description": "{store, name?}: keep the image in file storage"
                  }
                },
                "required": []
              },
              "example": {
                "url": "https://example.com/",
                "screenshotOptions": {
                  "fullPage": true,
                  "type": "png"
                }
              }
            }
          }
        }
      }
    },
    "/v1/snapshot": {
      "post": {
        "operationId": "snapshot",
        "summary": "One call, several formats: rendered HTML content and a base64 screenshot (plus optional Markdown and accessibility tree), with the page's status and title.",
        "description": "One call, several formats: rendered HTML content and a base64 screenshot (plus optional Markdown and accessibility tree), with the page's status and title.\n\nPrice: $0.005 per call (x402, or prepaid credits with an API key).",
        "x-price-usd": 0.005,
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "example": {
                  "formats": [
                    "content",
                    "screenshot"
                  ],
                  "content": "<html><body>Hello</body></html>",
                  "screenshot": "iVBORw0KGgo...",
                  "meta": {
                    "status": 200,
                    "title": "Example Domain"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (nothing is charged)"
          },
          "402": {
            "description": "Payment required: the x402 terms are in the PAYMENT-REQUIRED header; or send an API key"
          }
        },
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The page to snapshot (https). Set url or html, not both."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML to render instead of a URL."
                  },
                  "formats": {
                    "type": "array",
                    "description": "At least two of: content, screenshot, markdown, accessibilityTree (default content+screenshot)"
                  },
                  "screenshotOptions": {
                    "type": "object",
                    "description": "Puppeteer screenshot options for the snapshot's screenshot format"
                  },
                  "viewport": {
                    "type": "object"
                  },
                  "gotoOptions": {
                    "type": "object"
                  },
                  "waitForSelector": {
                    "type": "object"
                  },
                  "waitForTimeout": {
                    "type": "number"
                  },
                  "addScriptTag": {
                    "type": "array"
                  },
                  "addStyleTag": {
                    "type": "array"
                  },
                  "cookies": {
                    "type": "array"
                  },
                  "authenticate": {
                    "type": "object"
                  },
                  "setExtraHTTPHeaders": {
                    "type": "object"
                  },
                  "userAgent": {
                    "type": "string"
                  },
                  "setJavaScriptEnabled": {
                    "type": "boolean"
                  },
                  "emulateMediaType": {
                    "type": "string"
                  },
                  "bestAttempt": {
                    "type": "boolean"
                  },
                  "rejectResourceTypes": {
                    "type": "array"
                  },
                  "rejectRequestPattern": {
                    "type": "array"
                  },
                  "allowResourceTypes": {
                    "type": "array"
                  },
                  "allowRequestPattern": {
                    "type": "array"
                  },
                  "deliver": {
                    "type": "object",
                    "description": "{store, name?}: keep the snapshot's screenshot in file storage"
                  }
                },
                "required": []
              },
              "example": {
                "url": "https://example.com/",
                "formats": [
                  "content",
                  "screenshot",
                  "markdown"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/markdown": {
      "post": {
        "operationId": "markdown",
        "summary": "The page's rendered content as Markdown.",
        "description": "The page's rendered content as Markdown.\n\nPrice: $0.005 per call (x402, or prepaid credits with an API key).",
        "x-price-usd": 0.005,
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "example": {
                  "markdown": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission.",
                  "meta": {
                    "status": 200,
                    "title": "Example Domain"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (nothing is charged)"
          },
          "402": {
            "description": "Payment required: the x402 terms are in the PAYMENT-REQUIRED header; or send an API key"
          }
        },
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The page (https). Set url or html, not both."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML to render instead of a URL."
                  },
                  "viewport": {
                    "type": "object"
                  },
                  "gotoOptions": {
                    "type": "object"
                  },
                  "waitForSelector": {
                    "type": "object"
                  },
                  "waitForTimeout": {
                    "type": "number"
                  },
                  "addScriptTag": {
                    "type": "array"
                  },
                  "addStyleTag": {
                    "type": "array"
                  },
                  "cookies": {
                    "type": "array"
                  },
                  "authenticate": {
                    "type": "object"
                  },
                  "setExtraHTTPHeaders": {
                    "type": "object"
                  },
                  "userAgent": {
                    "type": "string"
                  },
                  "setJavaScriptEnabled": {
                    "type": "boolean"
                  },
                  "emulateMediaType": {
                    "type": "string"
                  },
                  "bestAttempt": {
                    "type": "boolean"
                  },
                  "rejectResourceTypes": {
                    "type": "array"
                  },
                  "rejectRequestPattern": {
                    "type": "array"
                  },
                  "allowResourceTypes": {
                    "type": "array"
                  },
                  "allowRequestPattern": {
                    "type": "array"
                  }
                },
                "required": []
              },
              "example": {
                "url": "https://example.com/"
              }
            }
          }
        }
      }
    },
    "/v1/links": {
      "post": {
        "operationId": "links",
        "summary": "Every link on the page as absolute URLs, with optional same-domain-only and visible-only filters.",
        "description": "Every link on the page as absolute URLs, with optional same-domain-only and visible-only filters.\n\nPrice: $0.005 per call (x402, or prepaid credits with an API key).",
        "x-price-usd": 0.005,
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "example": {
                  "links": [
                    "https://www.iana.org/domains/example"
                  ],
                  "count": 1,
                  "meta": {
                    "status": 200,
                    "title": "Example Domain"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (nothing is charged)"
          },
          "402": {
            "description": "Payment required: the x402 terms are in the PAYMENT-REQUIRED header; or send an API key"
          }
        },
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The page (https). Set url or html, not both."
                  },
                  "html": {
                    "type": "string",
                    "description": "HTML to render instead of a URL."
                  },
                  "excludeExternalLinks": {
                    "type": "boolean",
                    "description": "Only same-origin links (default false)"
                  },
                  "visibleLinksOnly": {
                    "type": "boolean",
                    "description": "Only links visible on the page (default false)"
                  },
                  "viewport": {
                    "type": "object"
                  },
                  "gotoOptions": {
                    "type": "object"
                  },
                  "waitForSelector": {
                    "type": "object"
                  },
                  "waitForTimeout": {
                    "type": "number"
                  },
                  "addScriptTag": {
                    "type": "array"
                  },
                  "addStyleTag": {
                    "type": "array"
                  },
                  "cookies": {
                    "type": "array"
                  },
                  "authenticate": {
                    "type": "object"
                  },
                  "setExtraHTTPHeaders": {
                    "type": "object"
                  },
                  "userAgent": {
                    "type": "string"
                  },
                  "setJavaScriptEnabled": {
                    "type": "boolean"
                  },
                  "emulateMediaType": {
                    "type": "string"
                  },
                  "bestAttempt": {
                    "type": "boolean"
                  },
                  "rejectResourceTypes": {
                    "type": "array"
                  },
                  "rejectRequestPattern": {
                    "type": "array"
                  },
                  "allowResourceTypes": {
                    "type": "array"
                  },
                  "allowRequestPattern": {
                    "type": "array"
                  }
                },
                "required": []
              },
              "example": {
                "url": "https://example.com/",
                "excludeExternalLinks": true
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key with prepaid credits, from https://puptra-pdf-snapshot.saastemly.com"
      }
    }
  },
  "x-mcp-server": "https://puptra-pdf-snapshot.saastemly.com/mcp"
}