---
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` boolean — Measure image width and height when possible.
  - `hostedUrl` boolean — Host materializable images on the Brand.dev CDN and return their URL and MIME type.
  - `classification` boolean — Classify each image by visual asset type.
  - `maxTimePerMs` integer — Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
- `dedupe` boolean — 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.
- `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
    - WebScrapeScrollAction — Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
      - `do` 'scroll', required
      - `direction` 'up' | 'down' | 'left' | 'right' — Direction to scroll. Defaults to down.
      - `amount` union — Pixels per scroll, one visible viewport, or the current scroll boundary. Defaults to viewport.
        - integer
        - 'viewport' | 'max'
      - `container` string — CSS selector for the first matching scroll container. Defaults to the page.
      - `maxScrolls` integer — Maximum scroll iterations. Stops early when scrolling and scrollable extent stop changing. Defaults to 1.
- `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.
  - `cache_metadata` CacheMetadata, required — Cache outcome for this response. Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.
    - `status` 'hit' | 'miss' | 'zdr', required — Whether the response was served from cache, required fresh work, or honored zero-data-retention cache bypass.
    - `age_ms` integer, required — Age of the cached data in milliseconds. Zero for miss and zdr responses.
  - `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.
  - `actionsApplied` object[] — One verified outcome per requested browser action, in request order.
    - `instruction` string, required
    - `status` 'applied' | 'failed' | 'skipped', required — Applied means the requested page state was visibly verified. Failed means it was not verified. Skipped means it was not attempted.
    - `method` string
    - `targetDescription` string
    - `completionEvidence` string — Visible page evidence used to verify an applied action.
    - `error` string
    - `durationMs` number

## 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

## Changes

> 26 revisions in range; 19 could not be searched.

- **2026-07-26** `35f1d8d4ea26` — 1 info
  - added the new optional `query` request parameter `actions`
- **2026-07-21** `3764d9c86493` — 1 breaking, 7 info
  - for the `query` request parameter `url`, the minLength was increased from `0` to `1`
  - added the new optional `query` request parameter `tags`
  - `query` request parameter `dedupe` list-of-types was widened by adding types `string`
  - for the `query` request parameter `timeoutMS`, the min was decreased from `1000.00` to `1.00`
  - …4 more
- **2026-07-09** `de91b92d5fb7` — 1 info
  - added the new optional `query` request parameter `dedupe`

[Change history](https://skmtc.dev/context/apis/context-dev/changes/web/scrape/images/get.md)

---

[API](https://skmtc.dev/context/apis/context-dev.md) · [All operations](https://skmtc.dev/context/apis/context-dev/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/context/context-dev/revisions/1febe5476266/schema)
