How to Screenshot HTML Markup with Abstract Screenshot API
Abstract Screenshot API accepts raw HTML as well as public URLs. Learn what its product page confirms, what to verify in the current API reference, and how to capture markup with ScreenshotNeo.
Abstract says its Website Screenshot API can turn raw HTML into an image, so you can submit markup directly when it is not hosted at a public URL. However, the available official product-page material does not establish the exact raw-HTML field, encoding, authentication placement, or request and response details. Check the current Abstract product page and API reference for those specifics before writing an executable request; guessing them could produce a request that fails or captures the wrong input.
1. Decide whether to send a URL or markup
Use URL capture when the page is already reachable at a public URL and you want the service to render that page. Use raw-HTML capture when your application has the markup directly and the page is not publicly hosted. Abstract’s FAQ says it supports sending raw HTML instead of a public URL. The product page also describes URL capture. Abstract Website Screenshot API
Before choosing the raw-HTML path, consider what the markup depends on. Relative links, external stylesheets, fonts, scripts, and images may require a base URL or publicly reachable resources. The retrieved Abstract materials do not confirm how its renderer resolves those dependencies, so consult the current API reference or test with a small representative document.
2. What the Abstract product page confirms
- Input: a public URL or raw HTML markup. The FAQ confirms the raw-HTML option, but the precise parameter name and encoding are not established in the retrieved material. Product page
- Output: an image. The product page names JPEG, PNG, and GIF formats. Confirm supported values and how to select them in the current API reference.
- Rendering controls: the page describes viewport and dimensions, custom CSS, and delayed capture. Check the current reference for exact parameter names, valid ranges, units, and defaults.
- Geographic rendering: the FAQ says capture from different geographic locations is not currently supported and describes it as a roadmap item. This is a vendor-page statement that can change; verify current availability if location affects your result. Abstract FAQ
3. Build a correct raw-HTML request
The safe implementation sequence is to locate the raw-HTML section in Abstract’s current API reference, then follow its documented request method, field name, encoding, authentication method, and image response format. The supplied source material does not establish those details, so a runnable Abstract request would require inventing API behavior. Do not copy a guessed parameter name or assume that the API accepts markup as a form field, JSON property, or URL parameter.
- Prepare the complete HTML document, including a doctype, character encoding, and viewport metadata if needed.
- Check how the API accepts raw markup and whether it requires a base URL for relative assets.
- Choose a documented output format and any needed viewport, dimensions, CSS override, or capture delay.
- Send the request exactly as the current reference specifies, including its authentication and content encoding requirements.
- Handle the response according to the documented behavior: save image bytes if the response is binary, or follow the documented result URL or job flow if it is asynchronous.
- Inspect the image for missing fonts, images, styles, or late-loading content before relying on it in production.
Abstract’s official page describes these capabilities at a high level but does not confirm the executable request details in the retrieved material. Use the official product and API documentation as the authority for a working Abstract code sample.
4. Prepare HTML that renders predictably
Even when an API accepts markup, a screenshot depends on more than the HTML string. Keep the document self-contained where practical, and make external dependencies explicit.
- Use a full document: include
<!doctype html>,<html>,<head>, and<body>. Set<meta charset="utf-8">to avoid character encoding surprises. - Set the viewport: include a viewport meta tag for responsive layouts, then configure the API viewport using its documented option.
- Resolve assets: inline small critical CSS or use absolute URLs for external resources if the renderer needs to fetch them. Confirm whether relative paths are resolved against a base URL.
- Wait for dynamic content: if scripts populate the page or images load late, use the documented capture delay option and choose a delay appropriate to the page.
- Keep markup within request limits: check current limits for request size and timeouts. If the document is large, reduce unused markup and assets or host the page and use URL capture if that better fits your workflow.
5. Choose format and rendering controls
Abstract’s page lists JPEG, PNG, and GIF and describes viewport and dimensions, custom CSS, and delayed capture. It does not establish exact option names or allowed values in the research material. Verify those details in the live API reference before implementation.
| Need | Decision | What to verify |
|---|---|---|
| Smaller photographic image | Consider JPEG | Whether quality is configurable and the accepted range |
| Sharp text, diagrams, or transparency | Consider PNG | Transparency behavior and output dimensions |
| Animated output | Consider GIF only if the API’s documented capture behavior meets the use case | Whether GIF is a single frame or animation and any frame limits |
| Responsive page | Set the viewport to the target device dimensions | Width, height, device scale, and defaults |
| Late-loading content | Use a documented delay | Units, maximum delay, and whether the delay applies before or after page readiness |
| One-off visual adjustment | Use documented custom CSS if available | How CSS is passed and whether it is applied before capture |
6. Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| The API rejects the request | Wrong raw-HTML parameter, encoding, method, or authentication placement | Compare the request with the current official API reference. These details are not confirmed by the retrieved product-page material. |
| The result is blank or incomplete | Markup was not accepted as raw HTML, scripts did not run, or capture occurred before content appeared | Confirm the documented raw-HTML input path, test a minimal static document, and then use the documented delay control if needed. |
| Images or styles are missing | Relative resource URLs lack a base, or external resources cannot be fetched | Try absolute asset URLs or inline critical CSS, and check the vendor documentation for base-URL and resource-fetch behavior. |
| Layout differs from a browser | Viewport dimensions, responsive breakpoints, fonts, or device scale differ | Set the documented viewport and dimensions explicitly; verify font availability and image loading. |
| Output format is wrong | Format selection or response handling does not match the documented API behavior | Check the exact format option and whether the response is binary or a result reference. |
| Capture misses late content | Asynchronous scripts or assets finish after the capture point | Use the supported delay option and avoid relying on timing defaults. Confirm the delay units and limits. |
| Regional content does not match expectations | The service may not support selecting a geographic capture location | Abstract’s FAQ says geographic capture is not currently supported; verify the live FAQ for changes. |
7. Performance, reliability, and cost
For predictable output, keep the markup and its dependencies small, set the viewport deliberately, and wait only as long as the page needs. A longer delay can help late content render but increases capture time. Test with the largest and most asset-heavy document your application will send, and handle API errors and timeouts using the behavior documented by Abstract.
Abstract’s page displays a Free plan with 100 requests and 1 request per second, and a Standard plan with 60,000 requests and 3 requests per second. These are vendor plan limits, not performance guarantees; the retrieved pricing views do not present the Standard billing period consistently. Check the live plan page before estimating cost or capacity. Abstract plans and product details
8. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. For a public page, one GET request returns an image or PDF. It is especially useful when your goal is a clean capture of a hosted page; it is not presented here as a raw-HTML submission API.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo API documentation for request options and response details. Cookie banners, popups, and chat widgets are removed before the shot. Bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo and start with 1,000 free screenshots a month, no card required.
9. FAQ
Can I use Abstract when my HTML has no public URL?
Yes. Abstract’s FAQ says raw HTML can be sent instead of a public URL. Consult its current API reference for the exact request shape.
Does Abstract return a PDF?
The retrieved product page describes image output and names JPEG, PNG, and GIF. It mentions conversion to an image or other format in its FAQ, but the available material does not confirm PDF support or the request option for it. Check the current API documentation.
Can I choose the country where Abstract renders the markup?
The vendor FAQ says geographic capture is not currently supported and describes it as a roadmap item. Verify the current FAQ before depending on that limitation.
Where can I find current request limits and prices?
Use Abstract’s live product and plan information. Plan limits and prices can change, and the retrieved Standard billing-period information is inconsistent.


