// api reference
Capture any web page as a PNG. Run real browser automation first. Click cookie banners, fill logins, wait for content, scroll. Then crop to the exact area you need.
Base URL
https://e.customjs.io/screenshotGet your API key from app.customjs.space, 600 free requests every month, no credit card.
Pass your API key in the x-api-key header. The response is the raw PNG binary, so pipe it to a file.
curl -X POST https://e.customjs.io/screenshot \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{ "input": { "url": "https://example.com" } }' \
> output.pngEvery response includes your current usage in the rate-limit headers.
| Response Header | Description |
|---|---|
| x-ratelimit-limit | Maximum requests allowed in the current window |
| x-ratelimit-used | Requests used in the current window |
| x-ratelimit-remaining | Requests remaining in the current window |
/screenshotSend a URL, get a PNG. The page is rendered in a real Chromium instance. JavaScript, web fonts, and lazy-loaded content all render before capture.
| Field | Type | Description |
|---|---|---|
| input.url | string | Required. The URL of the page to capture |
| input.commands | array | Automation commands to run before capture (see Automation) |
| input.box | object | Bounding box for a partial screenshot (see Cropping) |
curl -X POST https://e.customjs.io/screenshot \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"input": {
"url": "https://example.com",
"commands": []
}
}' \
> output.pngPass an array of commands to interact with the page before the shot is taken. They run in order. Dismiss a cookie banner, log in, wait for content, then capture.
| Action | Fields | Description |
|---|---|---|
| click | selector | Click an element (CSS selector or visible text) |
| type | selector, value | Type text into an input. E.g. login fields |
| wait | value | Wait the given number of milliseconds |
| scroll | value | Scroll down by the given number of pixels |
curl -X POST https://e.customjs.io/screenshot \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"input": {
"url": "https://example.com",
"commands": [
{ "action": "click", "selector": "#accept-cookies" },
{ "action": "type", "selector": "#email", "value": "[email protected]" },
{ "action": "click", "selector": "button[type=submit]" },
{ "action": "wait", "value": 1000 },
{ "action": "scroll", "value": 500 }
]
}
}' \
> output.pngAdd a box to capture only part of the page. Perfect for charts, product cards, or social previews. The box is applied only when width and height are greater than 0.
| Field | Type | Description |
|---|---|---|
| box.x | number | X-coordinate of the top-left corner |
| box.y | number | Y-coordinate of the top-left corner |
| box.width | number | Width of the capture area in pixels |
| box.height | number | Height of the capture area in pixels |
curl -X POST https://e.customjs.io/screenshot \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"input": {
"url": "https://example.com",
"box": { "x": 0, "y": 0, "width": 1200, "height": 800 }
}
}' \
> output.pngOn success the API responds with Content-Type: image/png and the raw PNG bytes in the body. Pipe it to a file or stream it to your storage.
HTTP/1.1 200 OK
Content-Type: image/png
x-ratelimit-limit: 500
x-ratelimit-used: 12
x-ratelimit-remaining: 488
[binary PNG data]| Header | Description |
|---|---|
| Content-Type | image/png on success |
| x-ratelimit-limit | Maximum requests per window |
| x-ratelimit-used | Requests used in the current window |
| x-ratelimit-remaining | Requests remaining in the current window |
| Code | Meaning |
|---|---|
| 200 | Success. Body contains the PNG binary |
| 400 | Bad request. Missing or invalid input.url |
| 401 | Unauthorized. Missing or invalid API key |
| 500 | Internal error. Capture failed |
// try it first
Open the interactive playground on the product page. Load any URL, point-and-click your automation steps, draw a crop box, and copy the generated curl or SDK snippet straight into your stack.
curl -X POST https://e.customjs.io/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"input": {
"url": "https://stripe.com",
"commands": [
{ "action": "click", "selector": "Accept all" }
]
}
}' > shot.png600 free requests / month ยท no credit card