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.
curl -H "x-api-key: pf_live_your_key_here" \
https://api.pagebolt.dev/v1/screenshot
Base URL
https://api.pagebolt.dev/v1
Error Responses
All errors return JSON with an error field.
| Status | Meaning |
|---|---|
| 400 | Bad request — check your parameters |
| 401 | Invalid or missing API key |
| 402 | Monthly quota exceeded — upgrade plan |
| 429 | Rate limit exceeded — slow down |
| 500 | Server error — try again or contact support |
Rate Limits
Rate limits are per-user, based on your plan. Check response headers:
| Header | Description |
|---|---|
| X-RateLimit-Limit | Requests per minute allowed |
| X-RateLimit-Remaining | Requests remaining this window |
| X-Usage-Current | Requests used this month |
| X-Usage-Limit | Monthly request limit |
POST /v1/screenshot
Capture a screenshot of a URL or HTML content. Returns the image as binary data.
Request Body (JSON)
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | string | — | URL to capture (required if no html) |
| html | string | — | Raw HTML to render (required if no url) |
| width | integer | 1280 | Viewport width (max 3840) |
| height | integer | 720 | Viewport height (max 2160) |
| format | string | png | png, jpeg, or webp |
| quality | integer | 80 | JPEG/WebP quality (1-100) |
| fullPage | boolean | false | Capture the full scrollable page |
| selector | string | — | CSS selector to capture specific element |
| delay | integer | 0 | Wait ms before capture (max 10000) |
| darkMode | boolean | false | Emulate dark color scheme |
| deviceScaleFactor | number | 1 | Device pixel ratio (max 3, use 2 for retina) |
Example
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
GET /v1/screenshot
Convenience endpoint — pass parameters as query strings. Ideal for embedding in <img> tags.
<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)
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | string | — | URL to render (required if no html) |
| html | string | — | Raw HTML to render (required if no url) |
| format | string | A4 | Paper format: A4, Letter, Legal, Tabloid |
| landscape | boolean | false | Landscape orientation |
| printBackground | boolean | true | Include CSS backgrounds |
| margin | string | — | CSS margin for all sides (e.g., "1cm") |
| margins | object | — | { top, right, bottom, left } in CSS units |
| displayHeaderFooter | boolean | false | Show header and footer |
| headerTemplate | string | — | HTML template for header |
| footerTemplate | string | — | HTML template for footer |
| scale | number | 1 | Rendering scale (0.1 - 2) |
| pageRanges | string | — | e.g., "1-5, 8" |
| delay | integer | 0 | Wait ms before rendering (max 10000) |
Example: Generate an invoice PDF
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)
| Parameter | Type | Default | Description |
|---|---|---|---|
| template | string | default | default, minimal, or gradient |
| html | string | — | Custom HTML template (overrides template) |
| title | string | — | Main title text |
| subtitle | string | — | Subtitle text |
| logo | string | — | Logo image URL |
| bgColor | string | #0f172a | Background color (hex) |
| textColor | string | #f8fafc | Text color (hex) |
| accentColor | string | #6366f1 | Accent color (hex) |
| width | integer | 1200 | Image width (max 2400) |
| height | integer | 630 | Image height (max 1260) |
| format | string | png | png, jpeg, or webp |
Example
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 https://api.pagebolt.dev/v1/usage \
-H "x-api-key: pf_live_your_key"
Response
{
"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.
Available Tools
| Tool | Description |
|---|---|
| take_screenshot | Capture a screenshot of a URL or HTML. Returns an inline image. |
| generate_pdf | Generate a PDF from a URL or HTML. Saves to disk and returns the file path. |
| create_og_image | Create an OG/social card image from templates or custom HTML. |
| check_usage | Check your current API usage and plan limits. |
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
| PAGEBOLT_API_KEY | Yes | — | Your PageBolt API key (from the Dashboard) |
| PAGEBOLT_BASE_URL | No | http://localhost:3000 | URL of your PageBolt instance |
Setup: Claude Desktop
Add this to your Claude Desktop config file (~/.claude/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):
{
"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:
Questions? Email support@pagebolt.dev