SDKs & Libraries
Official ScreenshotAPI SDKs for JavaScript, Python, Go, Ruby, and PHP — plus a CLI and copy-paste HTTP examples for every other language.
ScreenshotAPI ships official, typed SDKs for five languages. Each one wraps the REST API with the same ergonomic surface: a screenshot() method for raw bytes, a save() helper that writes a file, typed errors, and every screenshot option as a first-class argument.
Official SDKs
| Language | Package | Install |
|---|---|---|
| JavaScript / TypeScript | screenshotapi-to (npm) | npm install screenshotapi-to |
| Python | screenshotapi-to (PyPI) | pip install screenshotapi-to |
| Go | screenshotapi-go | go get github.com/miketromba/screenshotapi-go |
| Ruby | screenshotapi_to (RubyGems) | gem install screenshotapi_to |
| PHP | screenshotapi/sdk (Packagist) | composer require screenshotapi/sdk |
JavaScript / TypeScript
Node.js, Next.js, Vercel, Bun, Deno, and Cloudflare Workers. Zero dependencies.
Python
Sync and async clients with full type hints. Works with FastAPI, Django, and Flask.
Go
Typed, context-aware, standard-library client with functional options.
Ruby
Zero-dependency net/http client. Drops straight into Rails.
PHP
Guzzle-powered client for Laravel, Symfony, and plain PHP.
Each successful screenshot consumes 1 credit, and every account includes 200 free screenshots per month. See Credits for details.
Command line
CLI
Capture screenshots, render HTML, and generate PDFs from your terminal, scripts, CI jobs, and AI agents.
cURL
The raw HTTP recipe — perfect for the shell, quick tests, and pipelines.
Other languages
There isn't an official native package for these yet, but the API is a single HTTP call. These guides have copy-paste, idiomatic examples using each language's standard HTTP client.
Java
Built-in HttpClient (Java 11+), no dependencies.
C# / .NET
Built-in HttpClient (.NET 6+).
Rust
reqwest, async and blocking.
Elixir
The Req HTTP client.
Working in something else entirely? Any language that can make an HTTP request works — see the Screenshot API reference for the full endpoint contract.
What every SDK gives you
screenshot()— capture a URL (or rendered HTML) and get back the raw image/PDF bytes plus metadata (creditsRemaining,screenshotId,durationMs).save()— capture and write the file to disk in one call.- Typed errors — distinct types for authentication, invalid keys, insufficient credits, and capture failures, so you can handle each case precisely.
- Every option — full-page captures, dark mode, ad/cookie-banner removal, device mockups, geolocation, caching, HTML rendering, PDF export, and more. See each SDK's options table or the API reference.