Screenshot API
The Screenshot API is the core of BoltShot. It allows you to capture high-quality screenshots of any website with extensive customization options.
Endpoint
GET /capture
The screenshot API uses GET requests with query parameters for all options.
Authentication
Pass your API key as a query parameter:
GET https://api.boltshot.dev/capture?url=https://example.com&apiKey=your_api_key_here
You can also pass the API key in the X-API-Key header as an alternative. See Authentication for details.
Basic Usage
Simple Request
GET https://api.boltshot.dev/capture?url=https://example.com&apiKey=your_api_key_here
Request Parameters
Required Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | URL input mode: webpage URL to capture |
html | string | HTML input mode: inline HTML markup to render and capture |
apiKey | string | Your API key (can also be passed in X-API-Key header) |
Provide exactly one of url or html per request.
Optional Parameters
Format & Output
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | "png" | Output format: png, webp, jpeg, or pdf |
pdfPageLayout | string | "paginated" | PDF only. paginated — standard multi-page A4 print; single — one continuous page matching document/viewport size (closer to full-page PNG). Ignored when format is not pdf. |
returnFile | boolean | true | If true, returns binary file; if false, returns JSON with base64 data |
imageQuality | number | 90 | Image quality (1-100) for JPEJ/WebP |
scaleFactor | number | 1.0 | Scale factor (0.1-3.0) for image resolution |
PDF capture (automatic): For format=pdf, the API always sets fullPage=true, fullPageScroll=true, and fullPageScrollDuration=1000 before rendering. You do not need to pass fullPage, fullPageScroll, or fullPageScrollDuration; any values you send for those parameters are overridden for PDF output.
Viewport & Device
| Parameter | Type | Default | Description |
|---|---|---|---|
device | string | "desktop" | Device preset ID or category. See Device Presets for all options |
viewportWidth | number | 1920 | Viewport width in pixels |
viewportHeight | number | 1080 | Viewport height in pixels |
theme | string | "auto" | Theme: light, dark, or auto |
Page Capture
| Parameter | Type | Default | Description |
|---|---|---|---|
fullPage | boolean | false | Capture entire page including content below fold. Ignored when format is pdf — PDF always uses full-page capture. |
fullPageScroll | boolean | false | Enable enhanced scrolling for lazy-loaded content. Ignored when format is pdf — always enabled for PDF. |
fullPageScrollDuration | number | 1000 | Scroll duration in milliseconds (enhanced scroll). Ignored when format is pdf — fixed at 1000 ms for PDF. |
clipSelector | string | null | CSS selector to capture only specific element |
Timing & Waiting
| Parameter | Type | Default | Description |
|---|---|---|---|
delay | number | 0 | Delay in milliseconds before taking screenshot |
waitUntil | string | "load" | Wait condition: load, domcontentloaded, networkidle0, networkidle2 |
waitForSelector | string | null | CSS selector to wait for before screenshot |
Content Filtering
| Parameter | Type | Default | Description |
|---|---|---|---|
removeAds | boolean | false | Automatically remove ads |
removeCookieBanners | boolean | false | Automatically remove cookie consent banners |
removeSelectors | string | null | Comma-separated CSS selectors to remove |
blockResources | string | "" | Comma-separated resource types to block: stylesheet, script, image, font, media |
blockUrls | string | "" | Comma-separated URLs or patterns to block (supports wildcards) |
Custom Request
| Parameter | Type | Default | Description |
|---|---|---|---|
userAgent | string | null | Custom user agent string. Overrides the device preset's default user agent when provided |
headers | JSON string | null | Custom HTTP headers as a JSON object (e.g., {"Authorization":"Bearer token"}). Max 20 headers |
OpenAI Analysis (Optional)
| Parameter | Type | Default | Description |
|---|---|---|---|
openaiPrompt | string | null | Prompt used to analyze the generated screenshot image |
openaiApiKey | string | null | Your OpenAI API key (fallback option). Prefer X-OpenAI-Api-Key header for better security |
When using OpenAI analysis:
- Provide both
openaiPromptand an OpenAI key. - Recommended key transport:
X-OpenAI-Api-Keyheader. openaiApiKeyquery parameter fallback is supported for compatibility.- We do not store your OpenAI API key in our database.
Geolocation
| Parameter | Type | Default | Description |
|---|---|---|---|
latitude | number | null | GPS latitude (-90 to 90). Must be provided together with longitude |
longitude | number | null | GPS longitude (-180 to 180). Must be provided together with latitude |
Proxy & Network
| Parameter | Type | Default | Description |
|---|---|---|---|
proxyUrl | string | null | Proxy URL (e.g., http://proxy.example.com:8080) |
proxyUsername | string | null | Proxy username (if required) |
proxyPassword | string | null | Proxy password (if required) |
Caching
| Parameter | Type | Default | Description |
|---|---|---|---|
cacheEnabled | boolean | false | Enable response caching |
cacheTtl | number | 3600 | Cache TTL in seconds |
Storage (Per-Request)
| Parameter | Type | Default | Description |
|---|---|---|---|
requestStorageEnabled | boolean | false | Use per-request storage configuration |
requestStorageEndpoint | string | null | S3-compatible endpoint URL |
requestStorageAccessKeyId | string | null | Storage access key ID |
requestStorageSecretAccessKey | string | null | Storage secret access key |
requestStorageBucket | string | null | Storage bucket name |
requestStorageRegion | string | "us-east-1" | Storage region |
Response Format
Binary Response (returnFile: true)
When returnFile=true (default), the API returns the screenshot as a binary file:
Headers:
Content-Type: image/png (or image/webp or application/pdf)
Content-Disposition: inline; filename="screenshot.png"
Content-Length: <file_size>
X-BoltShot-AI-Result: <analysis text when openaiPrompt is provided>
X-BoltShot-AI-Result-Truncated: true|false
Body: Binary file data
JSON Response (returnFile: false)
When returnFile=false, the API returns JSON in standardized format:
{
"success": true,
"data": {
"requestId": "uuid",
"fileName": "screenshot.png",
"processingTime": 2500,
"fileSize": 1024000,
"url": "https://storage.example.com/screenshots/screenshot.png",
"imageData": "data:image/png;base64,iVBORw0KGgoAAAANS...",
"aiResult": {
"text": "The screenshot shows a product listing page with 24 items and a visible filter sidebar.",
"model": "gpt-4.1-mini"
}
}
}
Response Fields:
success: Alwaystruefor successful requestsdata: Object containing the screenshot information
Data Fields:
requestId: Unique identifier for this requestfileName: Generated filenameprocessingTime: Time taken in millisecondsfileSize: File size in bytesurl: Storage URL (if storage is configured)imageData: Base64-encoded image (for PNG/WebP, not PDF)aiResult: OpenAI analysis output whenopenaiPromptis provided
Examples
Basic Screenshot
GET https://api.boltshot.dev/capture?url=https://example.com&apiKey=your_api_key_here
Inline HTML Screenshot
GET https://api.boltshot.dev/capture?html=%3Chtml%3E%3Cbody%3E%3Ch1%3EHello%20BoltShot%3C%2Fh1%3E%3C%2Fbody%3E%3C%2Fhtml%3E&apiKey=your_api_key_here
Full-Page Screenshot
GET https://api.boltshot.dev/capture?url=https://example.com&fullPage=true&format=png&apiKey=your_api_key_here
Mobile Screenshot (iPhone 16)
GET https://api.boltshot.dev/capture?url=https://example.com&device=iphone-16&apiKey=your_api_key_here
Mobile Screenshot (Samsung Galaxy S24)
GET https://api.boltshot.dev/capture?url=https://example.com&device=samsung-galaxy-s24&apiKey=your_api_key_here
Capture Specific Element
GET https://api.boltshot.dev/capture?url=https://example.com&clipSelector=%23main-content&format=png&apiKey=your_api_key_here
Note: URL-encode special characters in selectors (e.g., # becomes %23)
Remove Ads and Cookie Banners
GET https://api.boltshot.dev/capture?url=https://example.com&removeAds=true&removeCookieBanners=true&fullPage=true&apiKey=your_api_key_here
Block Resources
GET https://api.boltshot.dev/capture?url=https://example.com&blockResources=stylesheet,script&format=png&apiKey=your_api_key_here
Wait for Element
GET https://api.boltshot.dev/capture?url=https://example.com&waitForSelector=.content-loaded&delay=2000&waitUntil=networkidle0&apiKey=your_api_key_here
Generate PDF
Paginated (default — normal multi-page PDF):
GET https://api.boltshot.dev/capture?url=https://example.com&format=pdf&pdfPageLayout=paginated&apiKey=your_api_key_here
(pdfPageLayout can be omitted — it defaults to paginated.)
Single long page (closer to a full-page PNG — one continuous page):
GET https://api.boltshot.dev/capture?url=https://example.com&format=pdf&pdfPageLayout=single&apiKey=your_api_key_here
PDFs use Chromium’s print pipeline (not the same as raster screenshots).
- Full page + scroll is applied automatically for every PDF (
fullPage,fullPageScroll, andfullPageScrollDurationare set server-side; see PDF capture (automatic) under optional parameters). pdfPageLayout=paginated(default): A4 pages with margins — typical multi-page PDF.pdfPageLayout=single: one PDF page sized to the full document height (full-page capture is automatic) or viewport height for non–full-page requests. Very large pages may fall back to paginated A4 (engine limits).
High-Quality Screenshot
GET https://api.boltshot.dev/capture?url=https://example.com&format=png&imageQuality=100&scaleFactor=2.0&viewportWidth=3840&viewportHeight=2160&apiKey=your_api_key_here
Dark Mode Screenshot
GET https://api.boltshot.dev/capture?url=https://example.com&theme=dark&fullPage=true&apiKey=your_api_key_here
Geolocation (Location-Specific Content)
GET https://api.boltshot.dev/capture?url=https://example.com/store-locator&latitude=40.7128&longitude=-74.0060&apiKey=your_api_key_here
This emulates GPS coordinates for New York City, useful for capturing location-aware content like maps, store locators, or "near me" search results.
Custom User Agent
GET https://api.boltshot.dev/capture?url=https://example.com&userAgent=MyBot/1.0&apiKey=your_api_key_here
Screenshot with Custom Headers (Authenticated Page)
GET https://api.boltshot.dev/capture?url=https://example.com/dashboard&headers=%7B%22Authorization%22%3A%22Bearer%20eyJhbG...%22%2C%22Accept-Language%22%3A%22fr-FR%22%7D&apiKey=your_api_key_here
The headers parameter accepts a URL-encoded JSON object. The decoded value is:
{"Authorization":"Bearer eyJhbG...","Accept-Language":"fr-FR"}
With Proxy
GET https://api.boltshot.dev/capture?url=https://example.com&proxyUrl=http://proxy.example.com:8080&proxyUsername=user&proxyPassword=pass&apiKey=your_api_key_here
JSON Response with Preview
GET https://api.boltshot.dev/capture?url=https://example.com&returnFile=false&format=png&apiKey=your_api_key_here
URL Encoding
When using query parameters, make sure to URL-encode special characters:
#→%23&→%26=→%3D(space) →%20or+,→%2C
Most HTTP clients (like cURL) handle this automatically, but be aware when constructing URLs manually.
For HTML mode, always URL-encode the html value and keep it reasonably small. GET query strings have practical size limits across browsers/proxies; use compact markup and avoid very large inline assets.
Device Presets
You can pass a specific device ID or a legacy category name (desktop, mobile, tablet) to the device parameter. When using a specific device, the viewport, scale factor, and user agent are all set automatically.
Desktop
| Device ID | Name | Viewport | Scale |
|---|---|---|---|
desktop-1080p | Desktop 1080p | 1920×1080 | 1x |
desktop-1440p | Desktop 1440p | 2560×1440 | 1x |
iPhone
| Device ID | Name | Viewport | Scale |
|---|---|---|---|
iphone-se | iPhone SE | 375×667 | 2x |
iphone-14 | iPhone 14 | 390×844 | 3x |
iphone-14-plus | iPhone 14 Plus | 428×926 | 3x |
iphone-14-pro-max | iPhone 14 Pro Max | 430×932 | 3x |
iphone-15 | iPhone 15 | 393×852 | 3x |
iphone-15-pro-max | iPhone 15 Pro Max | 430×932 | 3x |
iphone-16 | iPhone 16 | 393×852 | 3x |
iphone-16-pro-max | iPhone 16 Pro Max | 440×956 | 3x |
Samsung
| Device ID | Name | Viewport | Scale |
|---|---|---|---|
samsung-galaxy-s24 | Galaxy S24 | 360×780 | 3x |
samsung-galaxy-s24-ultra | Galaxy S24 Ultra | 384×824 | 3.75x |
samsung-galaxy-a54 | Galaxy A54 | 360×800 | 2.625x |
samsung-galaxy-z-fold5 | Galaxy Z Fold 5 | 373×841 | 3x |
Google Pixel
| Device ID | Name | Viewport | Scale |
|---|---|---|---|
google-pixel-8 | Pixel 8 | 412×915 | 2.625x |
google-pixel-8-pro | Pixel 8 Pro | 412×915 | 3.5x |
iPad
| Device ID | Name | Viewport | Scale |
|---|---|---|---|
ipad-mini | iPad Mini | 768×1024 | 2x |
ipad-air | iPad Air | 820×1180 | 2x |
ipad-pro-11 | iPad Pro 11" | 834×1194 | 2x |
ipad-pro-12.9 | iPad Pro 12.9" | 1024×1366 | 2x |
Other Tablets
| Device ID | Name | Viewport | Scale |
|---|---|---|---|
samsung-galaxy-tab-s9 | Galaxy Tab S9 | 800×1280 | 2x |
surface-pro | Surface Pro | 912×1368 | 2x |
Legacy Category Names
For backward compatibility, you can still use desktop, mobile, or tablet as shorthand:
| Category | Maps to |
|---|---|
desktop | desktop-1080p |
mobile | iphone-15 |
tablet | ipad-air |
You can still override viewportWidth and viewportHeight when using a device preset if you need a custom resolution.
Geolocation Emulation
The latitude and longitude parameters let you emulate the browser's GPS coordinates. Websites that use the JavaScript Geolocation API (navigator.geolocation.getCurrentPosition()) will receive the coordinates you specify.
Common use cases:
- Capturing location-specific map views
- Screenshotting store locator pages with nearby results
- Testing geo-targeted landing pages
Both parameters are required together — providing only one will return a validation error.
This is browser-level geolocation emulation (GPS spoofing), not network-level geo-routing. It affects JavaScript-based location detection, not IP-based detection. For IP-based geo-targeting, combine geolocation with the proxyUrl parameter using a geo-targeted proxy.
Custom Headers & User Agent
User Agent
By default, the user agent is determined by the selected device preset (e.g., selecting iphone-16 sends an iPhone 16 Safari user agent). You can override this with the userAgent parameter.
HTTP Headers
Custom HTTP headers allow you to capture screenshots of:
- Authenticated pages using
AuthorizationorCookieheaders - Localized content using
Accept-Language - Pages behind token gating using custom headers
Pass headers as a JSON object via the headers parameter:
headers={"Authorization":"Bearer token","Cookie":"session=abc123"}
The following headers are blocked for security reasons: Host, Content-Length, Transfer-Encoding, Connection, Upgrade, Keep-Alive, TE, Trailer, Proxy-Authorization, Proxy-Connection.
Custom headers are not stored in the database for security. Only the userAgent is saved for logging purposes.
Best Practices
Performance
-
Use appropriate wait conditions
load: Fastest, waits for page loadnetworkidle0: Waits for all network activity to stopnetworkidle2: Waits for max 2 network connections
-
Optimize image quality
- Use
imageQuality=80-90for most cases - Use
scaleFactor=1.0unless you need higher resolution
- Use
-
Enable caching
- Set
cacheEnabled=truefor repeated screenshots - Adjust
cacheTtlbased on content update frequency
- Set
Reliability
-
Use delays for dynamic content
- Add
delayparameter for JavaScript-rendered content - Use
waitForSelectorfor specific elements
- Add
-
Handle errors gracefully
- Check response status codes
- Implement retry logic for transient failures
-
Monitor usage
- Track request IDs for debugging
- Monitor processing times
Error Handling
See Errors for detailed error codes and handling.
Error Response Format
All errors follow this standardized format:
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": "Additional error details (optional)"
}
}
Common Error Codes
-
400 Bad Request:
VALIDATION_ERROR- Validation failedMISSING_REQUIRED_FIELD- Required field missingINVALID_INPUT- Invalid input provided
-
401 Unauthorized:
API_KEY_REQUIRED- API key is requiredINVALID_API_KEY- Invalid API keyAPI_KEY_EXPIRED- API key has expired
-
402 Payment Required:
INSUFFICIENT_CREDITS- Insufficient credits
-
403 Forbidden:
TARGET_PROTECTED- Target page is behind anti-bot verification (CAPTCHA/challenge)
-
429 Too Many Requests:
RATE_LIMIT_EXCEEDED- Rate limit exceeded
-
500 Internal Server Error:
INTERNAL_ERROR- Internal server errorOPERATION_FAILED- Operation failed
Protected Targets (CAPTCHA/Challenge Pages)
If the requested URL resolves to an anti-bot verification interstitial (for example reCAPTCHA, hCaptcha, or Cloudflare challenge pages), the API fails fast with:
- HTTP status:
403 - Error code:
TARGET_PROTECTED - Behavior: No screenshot is returned, and credits are consumed only on successful captures
Example Error Response
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "viewportWidth",
"message": "Must be a number",
"value": "invalid"
}
]
}
}
Next Steps
- Review API Reference for endpoint details
- Learn about Authentication methods
- Check out Integrations for automation tools