No description
  • JavaScript 100%
Find a file
ticusb c501dff34d Add README with API reference and deployment notes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 18:55:00 -07:00
node_modules Prepare for Railway deployment 2026-02-08 12:02:56 -07:00
.gitignore Initial commit: basic screenshot API 2026-02-08 11:35:48 -07:00
lambda.js Prepare for Railway deployment 2026-02-08 12:02:56 -07:00
package-lock.json Prepare for Railway deployment 2026-02-08 12:02:56 -07:00
package.json Prepare for Railway deployment 2026-02-08 12:02:56 -07:00
README.md Add README with API reference and deployment notes 2026-03-01 18:55:00 -07:00
server.js Prepare for Railway deployment 2026-02-08 12:02:56 -07:00

Screenshot API

REST API that captures screenshots of web pages on demand using Puppeteer (headless Chromium). Returns images as base64-encoded PNGs. Deployed on Railway.

Endpoint

POST /screenshot

Request body (JSON):

{
  "url": "https://example.com",
  "fullPage": false,
  "width": 1280,
  "height": 720
}
Parameter Type Required Default Description
url string yes Page to screenshot
fullPage boolean no false Capture full scrollable page
width number no 1280 Viewport width in pixels
height number no 720 Viewport height in pixels

Response:

{
  "success": true,
  "image": "data:image/png;base64,...",
  "url": "https://example.com"
}

Deployment

Two entry points are included:

  • server.js — Standard Express server (Railway, VPS, Docker). Uses bundled Chromium via puppeteer.
  • lambda.js — AWS Lambda handler. Uses puppeteer-core + @sparticuz/chromium for the Lambda runtime.

Development

npm install
npm start    # Starts Express server on PORT (default: 3000)

GET / returns the API reference if you need a quick reminder of the endpoint signature.