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>"
}
],
"url": "<string>"
}Scrapes all images from the given URL. Extracts images from img, svg, picture/source, link, and video elements including inline SVGs, base64 data URIs, and standard URLs.
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>"
}
],
"url": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Full URL to scrape images from (must include http:// or https:// protocol)
Was this page helpful?