API Reference

Everything you need to integrate PageBolt into your application.

Authentication

All API requests require an API key. Pass it via the x-api-key header or the api_key query parameter.

Header authentication
curl -H "x-api-key: pf_live_your_key_here" \
  https://api.pagebolt.dev/v1/screenshot
Tip: Get your API key from the Dashboard. The free plan includes 100 requests/month.

Base URL

https://api.pagebolt.dev/v1

Error Responses

All errors return JSON with an error field.

StatusMeaning
400Bad request — check your parameters
401Invalid or missing API key
402Monthly quota exceeded — upgrade plan
429Rate limit exceeded — slow down
500Server error — try again or contact support

Rate Limits

Rate limits are per-user, based on your plan. Check response headers:

HeaderDescription
X-RateLimit-LimitRequests per minute allowed
X-RateLimit-RemainingRequests remaining this window
X-Usage-CurrentRequests used this month
X-Usage-LimitMonthly request limit

POST /v1/screenshot

Capture a screenshot of a URL or HTML content. Returns the image as binary data.

Request Body (JSON)

ParameterTypeDefaultDescription
urlstringURL to capture (required if no html)
htmlstringRaw HTML to render (required if no url)
widthinteger1280Viewport width (max 3840)
heightinteger720Viewport height (max 2160)
formatstringpngpng, jpeg, or webp
qualityinteger80JPEG/WebP quality (1-100)
fullPagebooleanfalseCapture the full scrollable page
selectorstringCSS selector to capture specific element
delayinteger0Wait ms before capture (max 10000)
darkModebooleanfalseEmulate dark color scheme
deviceScaleFactornumber1Device pixel ratio (max 3, use 2 for retina)

Example

cURL
curl -X POST https://api.pagebolt.dev/v1/screenshot \
  -H "x-api-key: pf_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://github.com",
    "width": 1280,
    "height": 720,
    "format": "png",
    "fullPage": false
  }' \
  -o screenshot.png
Response: Binary image data with appropriate Content-Type header. Status 200 on success.

GET /v1/screenshot

Convenience endpoint — pass parameters as query strings. Ideal for embedding in <img> tags.

Browser / img tag
<img src="https://api.pagebolt.dev/v1/screenshot?api_key=pf_live_your_key&url=https://example.com&width=800&format=webp" />

POST /v1/pdf

Generate a PDF from a URL or HTML content. Returns the PDF as binary data.

Request Body (JSON)

ParameterTypeDefaultDescription
urlstringURL to render (required if no html)
htmlstringRaw HTML to render (required if no url)
formatstringA4Paper format: A4, Letter, Legal, Tabloid
landscapebooleanfalseLandscape orientation
printBackgroundbooleantrueInclude CSS backgrounds
marginstringCSS margin for all sides (e.g., "1cm")
marginsobject{ top, right, bottom, left } in CSS units
displayHeaderFooterbooleanfalseShow header and footer
headerTemplatestringHTML template for header
footerTemplatestringHTML template for footer
scalenumber1Rendering scale (0.1 - 2)
pageRangesstringe.g., "1-5, 8"
delayinteger0Wait ms before rendering (max 10000)

Example: Generate an invoice PDF

cURL
curl -X POST https://api.pagebolt.dev/v1/pdf \
  -H "x-api-key: pf_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Invoice #1234</h1><p>Amount: $99.00</p>",
    "format": "A4",
    "margin": "2cm",
    "displayHeaderFooter": true
  }' \
  -o invoice.pdf

POST /v1/og-image

Generate dynamic Open Graph / social card images. Use built-in templates or provide custom HTML.

Request Body (JSON)

ParameterTypeDefaultDescription
templatestringdefaultdefault, minimal, or gradient
htmlstringCustom HTML template (overrides template)
titlestringMain title text
subtitlestringSubtitle text
logostringLogo image URL
bgColorstring#0f172aBackground color (hex)
textColorstring#f8fafcText color (hex)
accentColorstring#6366f1Accent color (hex)
widthinteger1200Image width (max 2400)
heightinteger630Image height (max 1260)
formatstringpngpng, jpeg, or webp

Example

cURL
curl -X POST https://api.pagebolt.dev/v1/og-image \
  -H "x-api-key: pf_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "gradient",
    "title": "How to Build a SaaS in 2026",
    "subtitle": "A practical guide for solo founders",
    "accentColor": "#8b5cf6",
    "bgColor": "#1e1b4b"
  }' \
  -o social-card.png

GET /v1/usage

Check your current usage and plan limits programmatically.

cURL
curl https://api.pagebolt.dev/v1/usage \
  -H "x-api-key: pf_live_your_key"

Response

JSON
{
  "plan": "starter",
  "usage": {
    "current": 1247,
    "limit": 5000,
    "remaining": 3753
  }
}

MCP Server (AI Agent Integration)

PageBolt includes a built-in Model Context Protocol (MCP) server that lets AI coding assistants call the PageBolt API directly. Say "take a screenshot of example.com" in your IDE and get the result inline.

Supported clients: Claude Desktop, Cursor, Windsurf, Cline, and any MCP-compatible agent.

Available Tools

ToolDescription
take_screenshotCapture a screenshot of a URL or HTML. Returns an inline image.
generate_pdfGenerate a PDF from a URL or HTML. Saves to disk and returns the file path.
create_og_imageCreate an OG/social card image from templates or custom HTML.
check_usageCheck your current API usage and plan limits.

Environment Variables

VariableRequiredDefaultDescription
PAGEBOLT_API_KEYYesYour PageBolt API key (from the Dashboard)
PAGEBOLT_BASE_URLNohttp://localhost:3000URL of your PageBolt instance

Setup: Claude Desktop

Add this to your Claude Desktop config file (~/.claude/claude_desktop_config.json):

claude_desktop_config.json
{
  "mcpServers": {
    "pagebolt": {
      "command": "node",
      "args": ["/path/to/pagebolt/src/mcp-server.mjs"],
      "env": {
        "PAGEBOLT_API_KEY": "pf_live_your_key_here",
        "PAGEBOLT_BASE_URL": "https://your-pagebolt-instance.com"
      }
    }
  }
}

Setup: Cursor

Add this to your Cursor MCP settings (.cursor/mcp.json in your project):

.cursor/mcp.json
{
  "mcpServers": {
    "pagebolt": {
      "command": "node",
      "args": ["/path/to/pagebolt/src/mcp-server.mjs"],
      "env": {
        "PAGEBOLT_API_KEY": "pf_live_your_key_here",
        "PAGEBOLT_BASE_URL": "https://your-pagebolt-instance.com"
      }
    }
  }
}

Example Usage

Once configured, you can ask your AI agent things like:

"Take a screenshot of https://github.com in dark mode at 1920x1080"
"Generate a PDF of this invoice HTML and save it to ./invoices/jan-2026.pdf"
"Create an OG image with the title 'How to Build a SaaS' using the gradient template"
"How many API requests do I have left this month?"
Note: All MCP tool calls use your API key and count against your plan's usage quota — same as any API request.

Questions? Email support@pagebolt.dev