Extract everything from a URL in one call
Capture a screenshot, the page markdown, and structured JSON from a single request — then hand the bundle to an LLM
Extract everything from a URL in one call
A common workflow looks like this: load the page in a browser to grab a screenshot, fetch the HTML separately to parse meta tags, run the body through a Markdown converter for an LLM, and then call an LLM to fill in the parts selectors can't reach. Four round trips, two browsers, inconsistent page state.
With the outputs array, one request to POST /v1/screenshots returns all of those formats from a single page load — and counts as one screenshot against your quota regardless of how many output types you ask for.
What you'll build
By the end of this guide, one request returns a payload like:
{
"url": "https://linear.app",
"outputs": {
"screenshot": { "type": "screenshot", "contentType": "image/png", "encoding": "base64", "data": "iVBORw0KGgo...", "size": 19520 },
"markdown": { "type": "markdown", "contentType": "text/markdown; charset=utf-8", "data": "# Linear\n\n...", "size": 15276 },
"json": {
"type": "json",
"mode": "selector",
"data": {
"title": "Linear – The system for product development",
"description": "Purpose-built for planning and building products with AI agents.",
"ogImage": "https://linear.app/static/og/homepage.jpg",
"themeColor": "#08090a",
"favicon": "https://linear.app/favicon.ico",
"appleIcon": "https://linear.app/static/apple-touch-icon.png",
"twitterSite": "@linear"
}
}
},
"renderTimeMs": 2267
}Each output also has a resultUrl you can download it from later (with your API key) for 7 days.
![]()
See all five outputs of one real page, and try them interactively, on the Multi-output feature page.
That's enough to power a brand-profile auto-fill, a link-preview card, a CRM enrichment row, or a competitor snapshot — all from one call.
Why one call
- One billing unit. A request with five outputs still counts as one screenshot. See multi-output extraction.
- One page load. Screenshots, HTML, markdown, and JSON come from the same page. No drift between what you captured and what you scraped.
If you're new to the outputs array, the API reference is the canonical source for option lists and response shapes. This guide focuses on stitching the outputs into a working pipeline.
Implementation
Make a single request with the outputs you need
Ask for the three signals that cover most onboarding, enrichment, and preview workflows: a screenshot, the main content as markdown, and structured JSON for meta tags.
curl -X POST 'https://api.allscreenshots.com/v1/screenshots' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://linear.app",
"blockCookieBanners": true,
"outputs": [
{ "type": "screenshot", "format": "png" },
{ "type": "markdown" },
{ "type": "json", "schema": {
"title": { "selector": "title", "type": "text" },
"description": { "selector": "meta[name=description]", "type": "attribute", "attribute": "content" },
"ogTitle": { "selector": "meta[property=\"og:title\"]", "type": "attribute", "attribute": "content" },
"ogDescription": { "selector": "meta[property=\"og:description\"]", "type": "attribute", "attribute": "content" },
"ogImage": { "selector": "meta[property=\"og:image\"]", "type": "attribute", "attribute": "content" },
"ogSiteName": { "selector": "meta[property=\"og:site_name\"]", "type": "attribute", "attribute": "content" },
"twitterSite": { "selector": "meta[name=\"twitter:site\"]", "type": "attribute", "attribute": "content" },
"themeColor": { "selector": "meta[name=theme-color]", "type": "attribute", "attribute": "content" },
"favicon": { "selector": "link[rel~=icon]", "type": "attribute", "attribute": "href" },
"appleIcon": { "selector": "link[rel=\"apple-touch-icon\"]", "type": "attribute", "attribute": "href" },
"manifest": { "selector": "link[rel=manifest]", "type": "attribute", "attribute": "href" }
}}
]
}'The response carries every output inline: the screenshot as base64, Markdown as a string, and JSON as an object. With "responseType": "url" it carries no data, and you download each output from its resultUrl with your API key instead.
If you only need the page's title, description, OpenGraph tags and JSON-LD, a JSON output without a schema returns them with no selectors at all (auto mode). The schema below picks a few extra tags such as the theme color and icons.
Build a reusable page schema
The schema in Step 1 is the canonical "page + brand signals" snippet. Drop it into a helper so every workflow shares the same source of truth:
// extract.ts
export const pageSchema = {
title: { selector: 'title', type: 'text' as const },
description: { selector: 'meta[name=description]', type: 'attribute' as const, attribute: 'content' },
ogTitle: { selector: 'meta[property="og:title"]', type: 'attribute' as const, attribute: 'content' },
ogDescription: { selector: 'meta[property="og:description"]', type: 'attribute' as const, attribute: 'content' },
ogImage: { selector: 'meta[property="og:image"]', type: 'attribute' as const, attribute: 'content' },
ogSiteName: { selector: 'meta[property="og:site_name"]', type: 'attribute' as const, attribute: 'content' },
twitterSite: { selector: 'meta[name="twitter:site"]', type: 'attribute' as const, attribute: 'content' },
themeColor: { selector: 'meta[name=theme-color]', type: 'attribute' as const, attribute: 'content' },
favicon: { selector: 'link[rel~=icon]', type: 'attribute' as const, attribute: 'href' },
appleIcon: { selector: 'link[rel="apple-touch-icon"]', type: 'attribute' as const, attribute: 'href' },
manifest: { selector: 'link[rel=manifest]', type: 'attribute' as const, attribute: 'href' },
};
export async function extractPage(url: string) {
const res = await fetch('https://api.allscreenshots.com/v1/screenshots', {
method: 'POST',
headers: {
'X-API-Key': process.env.ALLSCREENSHOTS_API_KEY!,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url,
blockCookieBanners: true,
outputs: [
{ type: 'screenshot', format: 'png' },
{ type: 'markdown' },
{ type: 'json', schema: pageSchema },
],
}),
});
if (!res.ok) throw new Error(`Extract failed: ${res.status}`);
return res.json();
}href and src attributes come back as full URLs, so favicon, manifest and appleIcon are ready to store or display even when the page writes them as /favicon.ico. Other attributes, such as content, are returned as written.
Feed the screenshot and markdown to an LLM
Deterministic selectors give you names, descriptions, and visual assets. For the parts that don't sit in a tag — industry, tone, what the company actually does — pass the screenshot and the trimmed markdown to an LLM.
If what you need is structured fields from the page itself (prices, authors, table rows), an AI extraction output returns them as JSON matching your schema in the same request, without selectors or a separate model call.
Claude (Anthropic SDK):
import Anthropic from '@anthropic-ai/sdk';
const anthropic = new Anthropic();
async function classify(extract: Awaited<ReturnType<typeof extractPage>>) {
const screenshot = extract.outputs.screenshot.data; // base64 PNG
const markdown: string = extract.outputs.markdown.data;
const message = await anthropic.messages.create({
model: 'claude-sonnet-5-5',
max_tokens: 512,
messages: [
{
role: 'user',
content: [
{ type: 'image', source: { type: 'base64', media_type: 'image/png', data: screenshot } },
{
type: 'text',
text: `Classify this company from its homepage screenshot and main content.\n\nReturn JSON: { industry, oneLineDescription, audience }.\n\nMain content:\n${markdown.slice(0, 8000)}`,
},
],
},
],
});
return JSON.parse(message.content[0].type === 'text' ? message.content[0].text : '{}');
}OpenAI SDK:
import OpenAI from 'openai';
const openai = new OpenAI();
async function classify(extract: Awaited<ReturnType<typeof extractPage>>) {
const screenshotUrl = `data:image/png;base64,${extract.outputs.screenshot.data}`;
const markdown: string = extract.outputs.markdown.data;
const response = await openai.chat.completions.create({
model: 'gpt-4.1',
response_format: { type: 'json_object' },
messages: [
{
role: 'user',
content: [
{ type: 'image_url', image_url: { url: screenshotUrl } },
{
type: 'text',
text: `Classify this company from its homepage screenshot and main content.\n\nReturn JSON: { industry, oneLineDescription, audience }.\n\nMain content:\n${markdown.slice(0, 8000)}`,
},
],
},
],
});
return JSON.parse(response.choices[0].message.content ?? '{}');
}Pass the screenshot and the markdown. The screenshot captures the visual brand and any text rendered after hydration; the markdown gives the LLM enough textual context to classify without you paying for image-only inference on long pages.
Batch with async + webhook (optional)
For ingestion at scale — backfilling a list of prospect URLs, regenerating brand profiles nightly, processing every signup in a queue — switch the same payload to the async endpoint and receive a webhook when the job completes.
curl -X POST 'https://api.allscreenshots.com/v1/screenshots/async' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://acme.com",
"webhookUrl": "https://your-server.com/webhooks/extract",
"outputs": [
{ "type": "screenshot", "format": "png" },
{ "type": "markdown" },
{ "type": "json", "schema": { /* pageSchema */ } }
]
}'For thousands of URLs at once, see bulk processing.
Schema cookbook
The page schema above is the most general. Tune it to the workflow:
Link preview card
Minimal — title, description, the OG image, and a favicon.
{
"type": "json",
"schema": {
"title": { "selector": "meta[property=\"og:title\"]", "type": "attribute", "attribute": "content" },
"description": { "selector": "meta[property=\"og:description\"]", "type": "attribute", "attribute": "content" },
"image": { "selector": "meta[property=\"og:image\"]", "type": "attribute", "attribute": "content" },
"favicon": { "selector": "link[rel~=icon]", "type": "attribute", "attribute": "href" },
"siteName": { "selector": "meta[property=\"og:site_name\"]", "type": "attribute", "attribute": "content" }
}
}Product page
Listing data for ecommerce scrapes. The outputs.mdx reference has the canonical product extraction example:
{
"title": { "selector": "h1", "type": "text" },
"price": { "selector": ".price", "type": "text" },
"images": { "selector": "img.product", "type": "attribute", "attribute": "src", "multiple": true },
"description": { "selector": ".description", "type": "html" }
}Competitor / SEO audit
Pull titles, meta descriptions, headings, and the canonical link in one pass.
{
"title": { "selector": "title", "type": "text" },
"metaDesc": { "selector": "meta[name=description]", "type": "attribute", "attribute": "content" },
"canonical": { "selector": "link[rel=canonical]", "type": "attribute", "attribute": "href" },
"h1": { "selector": "h1", "type": "text", "multiple": true },
"h2": { "selector": "h2", "type": "text", "multiple": true },
"robotsMeta": { "selector": "meta[name=robots]", "type": "attribute", "attribute": "content" }
}Gotchas
Text values are the text a visitor sees. Sites that render several copies of a heading for desktop, tablet and mobile, and hide all but one, return only the visible copy. If a selector still matches more than you want, target a more specific element, or use multiple: true and pick on your side.
hrefandsrccome back as full URLs.favicon,manifest, andappleIconare resolved against the page, so/favicon.icoarrives ashttps://linear.app/favicon.ico. Other attributes, such as a meta tag'scontent, are returned as written.- Missing fields are
null, not errors. A site without OG tags returnsogImage: nullrather than failing the request. Plan your fallbacks (e.g. use the screenshot output whenogImageis null). - Twitter site handles include the
@. Twitter cards historically writetwitter:siteas@handle. Strip the prefix before linking out tohttps://twitter.com/....
Next steps
- Multi-output — the five outputs of one real page, an interactive explorer, and how the three JSON modes compare.
outputsAPI reference — full option list, output IDs, async response shape.- Async jobs and bulk processing — for processing many URLs without holding HTTP connections open.
- Webhooks — to receive multi-output results when async jobs finish.
- Structured extraction use case — the same workflow framed by scenario rather than steps.