Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
A screenshot API lets your application send a webpage URL to a remote rendering service and receive an image or PDF. Use a provider’s language SDK when it suits your stack; otherwise, call its REST API with an ordinary HTTP client. This guide uses the documented Screenshot API routes as one concrete example—endpoint paths, authentication, options and response formats vary by provider.
Choose an SDK or call the REST API directly
An SDK wraps HTTP requests in language-specific methods and may provide types or other conveniences. A direct REST call gives you control over the request and response handling and works in languages without a documented package. The available documentation establishes that Screenshot API offers SDK listings and REST access; it does not independently establish SDK quality, maintenance status or feature parity.
| Approach | Useful when | Trade-off |
|---|---|---|
| Language SDK | Your language has a package in the provider’s current SDK documentation and its interface fits your application. | You depend on a provider package; check its current installation instructions and supported options. |
| Direct HTTP | You need a small integration, your language is not listed, or you want explicit control of headers, body and response handling. | You implement request construction, error handling and response processing yourself. |
Screenshot API’s SDK documentation lists packages for Python, JavaScript/Node.js, Java, C#, Go, PHP, Ruby, Rust, C++, Swift, Kotlin, Dart, R, MATLAB, PowerShell and Bash. Package names and installation commands can change, so use the provider’s live SDK documentation rather than relying on a stale install command. The page says, “The Screenshot API is a REST API that works with any programming language.”
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesUnderstand the example provider’s routes and response choices
The Screenshot API reference documents these routes: GET /api/v1/screenshot with query parameters, POST /api/v1/screenshot with a JSON body, and POST /api/v1/screenshot/batch for multiple captures. It documents PNG, JPEG, WebP and PDF output. These are provider-specific details, not conventions shared by all screenshot services. See the provider’s API reference for the current request and response definitions.
#1 Best Overall
- Use GET for query-based captures supported by that route.
- Use POST when sending a JSON request body or advanced options.
- Use the batch route when your task is multiple captures and the provider’s limits and response semantics fit your workload.
- Advanced settings—including CSS or JavaScript injection, hidden selectors, geolocation and PDF options—are documented as POST-only by this reference.
The reference includes JSON response examples and a redirect option. Check the current response schema before deciding whether your application should parse JSON, follow a redirect or consume image data; an API’s output contract is not necessarily the same as another provider’s.
Keep the API key on the server
Store credentials in an environment variable or a secret manager, not in source control or browser-delivered JavaScript. A key embedded in a web page can be copied and reused by anyone who can inspect that page. Make screenshot requests from a server-side route or backend service, and return only the data your client needs.
The Screenshot API reference recommends authentication headers and demonstrates both Bearer and X-API-Key forms. It also shows the key in a query parameter as a convenience. Prefer the documented header form in ordinary integrations; query strings can be recorded in logs and other request metadata. Confirm which authentication form your chosen provider accepts.
Free tools Windows power users keep installed
One-click scans. No signup required.
Direct HTTP examples for Screenshot API
The following examples target Screenshot API’s documented POST screenshot route. They use an Authorization header and JSON body, check for non-success status codes, and save the returned response bytes as a file. The exact response behavior must match the provider’s current reference: if it returns JSON containing a URL rather than image bytes, parse that JSON and retrieve the image according to the documented contract instead.
cURL
export SCREENSHOT_API_KEY="your_api_key"
curl --fail-with-body
-X POST "https://screenshotapi.net/api/v1/screenshot"
-H "Authorization: Bearer $SCREENSHOT_API_KEY"
-H "Content-Type: application/json"
--data '{"url":"https://example.com","output":"png"}'
--output screenshot.png
Use the output-format parameter name and accepted values shown by the current API reference; the JSON field above illustrates the request pattern, not a guarantee that every provider uses the same field name. If the response is JSON or a redirect rather than raw PNG bytes, do not save it with a .png extension—handle it according to the documented response.
Python with requests
import os
import requests
api_key = os.environ["SCREENSHOT_API_KEY"]
endpoint = "https://screenshotapi.net/api/v1/screenshot"
payload = {"url": "https://example.com", "output": "png"}
response = requests.post(
endpoint,
headers={"Authorization": f"Bearer {api_key}"},
json=payload,
timeout=90,
)
response.raise_for_status()
# This writes raw response bytes. First confirm that the provider returns
# image bytes for this request rather than JSON or a redirect.
with open("screenshot.png", "wb") as image_file:
image_file.write(response.content)
Install requests in your project environment if it is not already available. For a JSON response, use response.json() and follow the documented result fields instead of writing JSON bytes to an image file.
Rank #3
Node.js fetch
const apiKey = process.env.SCREENSHOT_API_KEY;
if (!apiKey) throw new Error("Set SCREENSHOT_API_KEY first");
const response = await fetch("https://screenshotapi.net/api/v1/screenshot", {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ url: "https://example.com", output: "png" }),
signal: AbortSignal.timeout(90_000),
});
if (!response.ok) {
throw new Error(`Screenshot API returned ${response.status}: ${await response.text()}`);
}
// Use only if the documented response is image bytes; parse JSON or handle
// redirects as the provider specifies.
const image = Buffer.from(await response.arrayBuffer());
await import("node:fs/promises").then(({ writeFile }) =>
writeFile("screenshot.png", image)
);
The examples show the integration shape, not independently tested behavior. Verify the current URL, accepted body fields, content type and response contract in the provider reference before deploying. Do not assume a successful HTTP status alone means your application has received a valid image; validate the response type and handle provider-level errors.
SDKs and framework-specific guidance
For a documented package, follow its current installation and usage instructions, then confirm that the package supports the options and result handling your application needs. The available SDK listing does not establish how frequently any individual package is maintained. If it does not fit your language or requirements, the documented REST endpoints can be called using that language’s HTTP client.
The provider’s framework guide listings include Next.js, Remix, Nuxt, SvelteKit, VuePress, Salesforce, HubSpot, Gatsby, Webflow, Squarespace, React Native, Flutter, Ionic and Express. Find the relevant current guide through the provider’s integration documentation. Treat a framework guide as an implementation starting point, not a reason to expose a secret: keep authenticated calls in a server-side environment and confirm framework-specific routing and secret-storage practices in that framework’s official documentation.
Rank #4
Options to decide before sending a capture
Keep the request as small as your job allows, then add only provider-supported options. For Screenshot API, the reference identifies these advanced options as POST-only:
- CSS and JavaScript injection: use when a capture needs a page adjustment or a scripted interaction, and account for the possibility that the page may not reach the expected state.
- Hidden selectors: useful when specified elements should not appear in the output; verify selector behavior against the provider’s syntax.
- Geolocation: use only when the target page’s location-dependent behavior matters; do not assume it overrides every location signal the site may use.
- PDF settings: specify the supported print or page options when the deliverable is a PDF, rather than assuming image settings apply.
Use the documented output formats—PNG, JPEG, WebP or PDF—based on the consumer of the result. Image formats and PDFs differ in downstream handling, and the provider’s request schema determines how to select them. Avoid sending undocumented parameter names: a field accepted by a different screenshot service may be ignored or rejected here.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteBatching, response handling and operational design
The POST batch route can reduce the number of separate client requests for a multi-URL task, but the documentation cited here does not establish its maximum batch size, per-item error model, concurrency behavior or performance. Read those limits in the current reference before using it for a large workload. If partial failures matter, design the caller to inspect each item’s result rather than treating the whole batch as one indivisible success.
Best Value
For either single or batch captures, make failure handling explicit:
- Set a finite client timeout appropriate to your application’s latency budget.
- Check HTTP status and content type before treating the body as an image or PDF.
- Record a request identifier or provider error detail if returned, while redacting API keys and sensitive page data from logs.
- Retry only errors that are plausibly transient, with bounded attempts and backoff; avoid blindly repeating costly work.
- Validate saved files where correctness matters, and return a useful application-level error if the capture failed.
The cited documentation does not establish latency, uptime, quotas, maximum output size, pricing or geographic availability. Those values should be checked in the provider’s current service terms before planning capacity or cost; do not infer them from the code examples.
Troubleshooting common integration failures
- 401 or 403 response: verify the key is present, active and sent using an authentication header form accepted by the provider. Check that environment variables are available to the server process.
- 400 response: compare the body and parameter names with the current route schema. Advanced options in this reference require POST rather than GET.
- Successful status but unusable image file: inspect the response content type and body. The result may be JSON or a redirect rather than image bytes; follow the documented response contract.
- Timeout: ensure the client timeout is finite but suitable for the capture, then distinguish a client timeout from a provider-reported failure. The available documentation does not promise a particular render time.
- Capture differs from a browser view: check the target URL, page state and any required provider-supported options. Do not assume a screenshot endpoint executes interactions or waits for a particular page condition unless the provider documents it.
- Secret appears in logs or client code: rotate the exposed key and move calls to a protected server-side component; avoid query-string credentials where header authentication is supported.
Or skip the browser setup
For a direct screenshot request without configuring a browser renderer yourself, ScreenshotNeo provides a screenshot API and MCP server. Its one-call cURL example saves a WebP image:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation. Before capture, it accepts cookie or consent banners and removes 60+ known consent platforms, newsletter popups and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.
Frequently Asked Questions
Can I use a screenshot API without installing an SDK?
Yes. If the provider documents a REST endpoint, call it with an HTTP client in your language and handle its documented authentication and response format.
Do screenshot APIs all return the same kind of response?
No. Check the specific provider’s reference for whether a request returns image bytes, JSON, a redirect or another documented result.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

