---
title: "Scrape Images"
method: GET
path: "/web/scrape/images"
tags: ["Web Scraping"]
---

# Scrape Images

`GET /web/scrape/images`

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, or 2 credits with browser actions. When enrichment is enabled, the entire call costs 5 credits, including requests that also use actions.

## Query parameters

- `url` string, uri, required — Page URL to inspect. Must include http:// or https://.
- `maxAgeMs` integer, nullable — Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
- `enrichment` object, nullable — Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true.
  - `resolution` union — Measure image width and height when possible.
    - boolean
    - 'true' | 'false'
  - `hostedUrl` union — Host materializable images on the Brand.dev CDN and return their URL and MIME type.
    - boolean
    - 'true' | 'false'
  - `classification` union — Classify each image by visual asset type.
    - boolean
    - 'true' | 'false'
  - `maxTimePerMs` integer — Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
- `dedupe` union — When true, visually duplicate images are removed: every image is loaded and perceptually hashed, and only the highest-resolution copy of each duplicate group is kept. Images that cannot be downloaded or hashed are kept. Default: false.
  - boolean
  - 'true' | 'false'
- `waitForMs` integer, nullable — Optional browser wait time in milliseconds after initial page load before collecting images. Min: 0. Max: 30000 (30 seconds).
- `actions` WebScrapeAction[], nullable — Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.
  - union — Browser action discriminated by `do`. Each variant exposes only its applicable fields.
    - WebScrapeWaitAction — Pause for a fixed number of milliseconds before continuing to the next action.
      - `do` 'wait', required
      - `timeMs` integer, required
    - WebScrapePerformAction — Resolve and perform one natural-language browser action.
      - `do` 'perform', required
      - `action` string, required
- `headers` object — Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.
- `timeoutMS` integer — Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
- `tags` string[] — Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

## Response `200`

Successful response

- object
  - `success` true, required — Always true on success.
  - `images` object[], required — Images found on the page.
    - `src` string, required — Original image value: URL, inline SVG or HTML, or base64 data URI.
    - `element` 'img' | 'svg' | 'link' | 'source' | 'video' | 'css' | 'object' | 'meta' | 'background', required — Where the image was found.
    - `type` 'url' | 'html' | 'base64', required — Format of src.
    - `alt` string, nullable, required — Image alt text, or null when unavailable.
    - `enrichment` object — Requested metadata for images that could be processed.
      - `width` integer — Image width in pixels, when measured.
      - `height` integer — Image height in pixels, when measured.
      - `mimetype` string — Detected MIME type, when hosted.
      - `url` string, uri — Brand.dev CDN URL, when hosted.
      - `type` 'photography' | 'illustration' | 'logo' | 'wordmark' | 'icon' | 'pattern' | 'graphic' | 'other' — Visual asset category, when classified.
  - `url` string, required — Page URL that was scraped.
  - `key_metadata` KeyMetadata — Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
    - `credits_consumed` integer, required — The number of credits consumed by this request.
    - `credits_remaining` integer, required — The number of credits remaining for your organization after this request.

## Other responses

- `400` — Invalid URL or scrape failed.
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - Insufficient permissions or usage limit exceeded
- `408` — Request timeout
- `429` — Rate limit exceeded
- `500` — Internal server error

---

[API](https://skmtc.net/context/apis/context-dev.md) · [All operations](https://skmtc.net/context/apis/context-dev/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/context/context-dev/versions/182f532c2552/schema)
