• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
paulkinlan

paulkinlan

screenshot

Public
Like
screenshot
Home
Code
2
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://paulkinlan--4f8bcf1c9f7511f0b5cf0224a6c84d84.web.val.run
README.md

Website Screenshot Service

A simple HTTP service that uses Puppeteer to capture screenshots of websites and return them as binary PNG data.

Setup

  1. Set the browserless environment variable with your Browserless.io token
  2. The service will be available as an HTTP endpoint

Usage

Make a GET request to the service with a url parameter:

GET /?url=https://example.com

Parameters

  • url (required): The URL of the website to screenshot

Response

  • Success: Returns a PNG image as binary data with Content-Type: image/png
  • Error: Returns error message as plain text with appropriate HTTP status code

Examples

# Take a screenshot of Wikipedia curl "https://your-val-url.web.val.run/?url=https://en.wikipedia.org/wiki/OpenAI" -o screenshot.png # Take a screenshot of Google curl "https://your-val-url.web.val.run/?url=https://google.com" -o google.png

Features

  • Validates URL format before processing
  • Sets consistent viewport size (1280x720) for screenshots
  • Waits for network to be idle before taking screenshot
  • Returns proper error messages for invalid requests
  • Includes timeout protection (30 seconds)

Error Handling

The service handles various error cases:

  • Missing URL parameter (400)
  • Invalid URL format (400)
  • Missing browserless token (500)
  • Screenshot capture errors (500)

Configuration

  • Viewport: 1280x720 pixels
  • Screenshot type: PNG
  • Full page: Disabled (captures viewport only)
  • Timeout: 30 seconds
  • Wait condition: Network idle (no requests for 500ms)
HTTP
  • index.ts
    paulkinlan--4f8bcf1c9f7511f0b5cf0224a6c84d84.web.val.run
Code
README.md
H
index.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.