import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.web.webScrapeImages({ url: 'https://example.com' });
console.log(response.images);{
"success": true,
"images": [
{
"src": "<string>",
"element": "img",
"type": "url",
"alt": "<string>",
"enrichment": {
"width": 123,
"height": 123,
"mimetype": "<string>",
"url": "<string>",
"type": "photography"
}
}
],
"url": "<string>"
}Extract image assets from a web page, including standard URLs, inline SVGs, data URIs, responsive image sources, metadata, CSS backgrounds, video posters, and embeds. The base request costs 1 credit; enrichment costs 1 credit per returned image.
import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.web.webScrapeImages({ url: 'https://example.com' });
console.log(response.images);{
"success": true,
"images": [
{
"src": "<string>",
"element": "img",
"type": "url",
"alt": "<string>",
"enrichment": {
"width": 123,
"height": 123,
"mimetype": "<string>",
"url": "<string>",
"type": "photography"
}
}
],
"url": "<string>"
}1 Credit Enriched: 1 Credit / ImageDocumentation Index
Fetch the complete documentation index at: https://docs.context.dev/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Page URL to inspect. Must include http:// or https://.
Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
0 <= x <= 2592000000Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true.
Show child attributes
Was this page helpful?