Skip to main content
GET
/
web
/
scrape
/
images
JavaScript
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>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.context.dev/llms.txt

Use this file to discover all available pages before exploring further.

1 Credit Enriched: 1 Credit / Image

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

url
string<uri>
required

Page URL to inspect. Must include http:// or https://.

maxAgeMs
integer
default:86400000

Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).

Required range: 0 <= x <= 2592000000
enrichment
object

Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true.

Response

Successful response

success
enum<boolean>
required

Always true on success.

Available options:
true
images
object[]
required

Images found on the page.

url
string
required

Page URL that was scraped.