---
title: "Harvest a page's images"
method: POST
path: "/v1/web/images"
tags: ["Media"]
---

# Harvest a page's images

`POST /v1/web/images`

## Request

- Base URL: `https://api.hydrafetch.com`
- URL: `https://api.hydrafetch.com/v1/web/images`
- Auth: API key in header `X-API-Key`

Harvest all images from a page with their metadata.

## Request body

- ImagesRequestDto
  - `url` string, required: The URL to harvest images from. Must be http(s).
  - `maxAge` number: Serve from cache if a capture of this URL is younger than this many milliseconds. Omit for the default window; 0 always fetches fresh. Capped at 7 days.

## Response `200`

- ImagesResponseDto
  - `data` WebImagesDataDto, required
    - `url` string, required: The URL you requested.
    - `finalUrl` string, required: The final URL after any redirects.
    - `images` WebImageDto[], required: Every image found on the page, with its metadata.
      - `src` string, required: The image URL, resolved to absolute.
      - `alt` object, nullable, required: The image alt text, if any.
      - `width` object, nullable, required: The image width in pixels, if declared.
      - `height` object, nullable, required: The image height in pixels, if declared.

## Other responses

- `400`: The request body or query failed validation.
- `401`: The X-API-Key header is missing, malformed, or names a key that no longer exists.
- `402`: The workspace has no credits left for this request. Nothing was charged and nothing was fetched.
- `403`: The key is valid but the workspace may not make this request.
- `404`: No such job, or the id belongs to another workspace.
- `422`: The target site did not respond, or we could not read that page. This is a fact about that URL rather than a fault on our side, and retrying it will not change the answer. When details.retryAfterSeconds is present, asking again before then returns this same answer. Nothing was charged.
- `429`: The workspace exceeded its per-minute request limit. Read the RateLimit headers, or Retry-After on this response, and retry after the window resets.
- `500`: Unexpected server error. Nothing was charged.
- `503`: A dependency needed for the requested formats is unavailable. Safe to retry.

---

[API](https://skmtc.dev/hydrafetch/apis/hydrafetch-api.md) · [All operations](https://skmtc.dev/hydrafetch/apis/hydrafetch-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hydrafetch/apis/hydrafetch-api/revisions/b28322984b4b?raw)
