Abstract Screenshot API Response Formats: PNG, JPEG, and PDF Compared
Abstract documents PNG, JPEG, and GIF responses; PDF support is unconfirmed. Learn what the docs establish and how to handle the returned bytes.
Short answer: Abstract’s Website Screenshot API documentation lists JPEG, PNG, and GIF as image formats. It does not document PDF as a supported response format, so treat direct PDF output as unconfirmed until you verify it in the current API reference. Abstract’s Python tutorial saves the response body to a .jpg file, but that example alone does not establish that every response is JPEG or explain response headers.
This guide separates documented facts from unanswered questions, shows how to save the response bytes without assuming a format, and explains what to check before choosing an output. The reviewed Abstract sources are its official Website Screenshot API page and its Python screenshot tutorial.
What formats does Abstract document?
| Format | What the reviewed documentation establishes | Practical next step |
|---|---|---|
| PNG | Listed by Abstract among its screenshot image formats. | Confirm the current API parameter or default used to request it, then inspect the returned response and save it with a matching extension. |
| JPEG | Listed by Abstract. Its Python tutorial writes response bytes to a file named stripe_home.jpg. |
Do not assume the tutorial filename proves the endpoint always returns JPEG. Check the current reference and response headers. |
| GIF | Also listed on Abstract’s product page, though it is not part of this title’s PNG/JPEG/PDF comparison. | Check the current API reference for how it is requested and whether it fits your downstream workflow. |
| Not listed as an output format in the reviewed product page or tutorial. No PDF parameter, MIME type, or PDF page configuration is established by those sources. | Consider direct PDF support unconfirmed. Verify it in current technical documentation before building around it. |
Abstract describes an API that accepts a URL or raw HTML and renders a screenshot. Its product page also lists controls such as viewport dimensions, custom CSS, and capture timing. Those controls affect the rendered capture; the reviewed sources do not establish format-specific quality, file-size, transparency, or PDF behavior.
How to handle the response safely
The key implementation detail is that the tutorial consumes the HTTP response body as bytes and writes those bytes to a file. A filename extension is only a name; it does not verify the bytes’ actual format. Before using an output in production, confirm the request’s format option in Abstract’s current API reference and inspect the response status and headers.
Python: save response bytes
Abstract’s tutorial demonstrates a GET to https://screenshot.abstractapi.com/v1/ and writes response.content to a JPG-named file. Supply your API key and URL as documented by Abstract, and confirm the current request parameters in its API reference. The example below shows the byte-saving pattern; it deliberately does not claim a PDF mode or infer the response format from the filename.
import requests
api_key = "YOUR_API_KEY"
page_url = "https://example.com"
response = requests.get(
"https://screenshot.abstractapi.com/v1/",
params={"api_key": api_key, "url": page_url},
timeout=60,
)
response.raise_for_status()
# Choose the extension only after confirming the requested/returned format.
with open("screenshot.bin", "wb") as output:
output.write(response.content)
print("Content-Type:", response.headers.get("Content-Type", "not provided"))
The endpoint and byte-writing pattern follow Abstract’s published tutorial. The tutorial example writes to stripe_home.jpg; the generic parameter names above illustrate a common request shape and are not a substitute for checking the current API reference. If the documented parameter names differ, use the names in that reference.
cURL: inspect headers and save the body
Use the current documented query parameters for your account and requested format. This command shows how to save the body and headers separately; replace the parameter names if Abstract’s current API reference specifies different ones.
curl --fail --show-error --silent \
--dump-header response-headers.txt \
--output screenshot.bin \
--get "https://screenshot.abstractapi.com/v1/" \
--data-urlencode "api_key=YOUR_API_KEY" \
--data-urlencode "url=https://example.com"
cat response-headers.txt
Once the request succeeds, inspect the response headers and verify the file with the tools in your own pipeline. Do not rename an unverified response to .pdf and assume it is a PDF.
Node.js: retain the binary response
The following uses the same endpoint and illustrative parameter names. Confirm the current request parameters and output selection in Abstract’s documentation. It checks the HTTP status, keeps the body as binary data, and logs the returned content type when present.
const endpoint = new URL("https://screenshot.abstractapi.com/v1/");
endpoint.searchParams.set("api_key", "YOUR_API_KEY");
endpoint.searchParams.set("url", "https://example.com");
const response = await fetch(endpoint);
if (!response.ok) {
throw new Error(`Screenshot request failed: ${response.status} ${response.statusText}`);
}
const contentType = response.headers.get("content-type");
const bytes = Buffer.from(await response.arrayBuffer());
console.log("Content-Type:", contentType ?? "not provided");
// Save `bytes` using your application's file or object-storage API.
// Select a filename extension only after verifying the returned format.
Choosing a format for your workflow
Start from the output your next system actually accepts, then verify that Abstract documents a way to request it. The available evidence supports format names, not a quality or performance ranking.
- Check the downstream requirement. Identify the file type expected by the browser, archive, report pipeline, or other consumer.
- Confirm the supported output in current API documentation. The reviewed Abstract page lists JPEG, PNG, and GIF. It does not confirm PDF.
- Check how the response is delivered. Abstract’s tutorial handles the response body as bytes. The reviewed sources do not fully specify content negotiation or all response-header behavior.
- Match the extension to verified bytes. Use the documented output selection and response metadata where available; do not use the filename as evidence of format.
- Check capture settings separately. Abstract lists viewport/dimension controls, custom CSS, and capture timing. Ensure these suit the page and task, regardless of file format.
- If PDF is mandatory, verify before integrating. Look for an explicit PDF output parameter and documentation for its response type and page settings. The reviewed sources do not supply those details.
What the available sources do not establish
- Whether Abstract currently offers a direct PDF response mode.
- Which exact parameter selects PNG, JPEG, or GIF in every API version.
- Whether the response is always raw image bytes or can be a URL or structured response.
- Specific MIME types, content-negotiation rules, or guarantees that the response header is present.
- Format-specific image quality, compression, transparency, dimensions, or file-size comparisons.
- Any PDF page size, orientation, margins, pagination, or page-range behavior.
Abstract describes use cases including multi-device QA, recurring snapshots, embedded previews, monitoring, and security preview flows. These are vendor-described use cases, not independent performance findings. The product page also lists a free tier and paid plans, but prices, limits, and service terms can change; check the live page before budgeting.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| The saved file will not open as the chosen format. | The extension was guessed, or the request did not produce the expected image. | Check the HTTP status and response headers, confirm the requested format in current docs, and validate the bytes before assigning an extension. |
A file named .jpg contains something unexpected. |
The tutorial’s example filename was treated as a universal response guarantee. | The tutorial only demonstrates one byte-saving example. Confirm the actual output selection and inspect the response. |
| The client saves an error response as an image. | The code wrote the body without checking the HTTP status. | Check status before writing; in Python use raise_for_status(), in Node check response.ok, and in cURL use --fail. |
| The API rejects the request. | Credentials, parameter names, or required values may not match the current API contract. | Compare the request with Abstract’s current API reference and confirm the URL and credential are valid. |
| The result is incomplete or visually unexpected. | Capture dimensions, custom CSS, or timing may not fit the target page’s rendering behavior. | Review the viewport, dimensions, CSS, and capture timing options documented by Abstract; reproduce the request with a stable target page. |
| A workflow requiring PDF cannot consume the result. | PDF output was assumed without documentation confirming it. | Verify direct PDF support and its settings in current docs. If absent, choose a separately verified conversion workflow or an API that documents PDF output. |
Performance, reliability, and cost considerations
The reviewed sources do not provide comparative benchmarks for PNG, JPEG, GIF, or PDF, so there is no supported basis here for claiming one is faster, smaller, or more reliable through this API. In practice, measure the complete workflow that matters to you: request latency, response size, retries, storage, and downstream processing. Use a timeout, check status codes, and avoid treating transient failures as valid image files.
For reliability, log the requested URL, status, content type when present, and a request identifier if the API provides one. Keep format selection explicit, validate the body before handing it to another system, and test pages with the rendering conditions your application depends on. The sources reviewed do not establish Abstract-specific retry guarantees or uptime beyond the vendor’s published terms; consult its current service documentation for those commitments.
For cost, check Abstract’s current pricing page for request limits and rates before estimating volume. The reviewed product page lists a free tier of 100 requests and 1 request per second, a Standard plan of 60,000 requests per month and 3 requests per second, and enterprise custom pricing. Treat these as the page’s published listing, which can change, rather than a durable quote. The page also states an enterprise 99.99% uptime SLA; this is a vendor-published SLA statement, not independently measured uptime.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. It returns PNG, JPEG, WebP, or PDF from one GET request. For an image response, a request can look like this:
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 for request options and output configuration. It can accept cookie and consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up free for 1,000 screenshots a month, with no card required.
FAQ
Does Abstract return a PDF if I use a .pdf filename?
A filename does not select or prove a response format. The reviewed Abstract sources do not document PDF output; confirm support in current technical documentation.
Does Abstract support GIF?
Yes, GIF is named alongside JPEG and PNG on the reviewed official product page. Check the current API reference for the request details.
Is the Python tutorial proof that Abstract always returns JPEG?
No. It shows response bytes being written to a file named stripe_home.jpg. That example does not establish behavior for every request or document the response headers.
Can I send HTML instead of a public URL?
Abstract’s product page says the API accepts a URL or raw HTML, including for cases where a target site is not publicly accessible. Check its current reference for the exact request format.
