apyhub
Back
▣ INGESTION KIT · MEDIA KIT

Extract Images from Web Pages API

What it does

Use this extract images from web pages API to pull the images off a page and keep a copy of each. Send page addresses, and the API finds the images, saves every file and returns a download link. Each row also gives the size, width, height, format and a SHA-256 hash.

Send page addresses in pageUrls (up to 100). The API collects images from <img> tags, lazy data-src values, the largest srcset size, og:image, twitter:image and links to image files. You can also send direct image links in urls (up to 100). Set maxFiles (1 to 100, default 50) to cap the files stored per call. To change the files, set outputFormat to jpg, webp or png, and quality (30 to 100, default 85) for JPG and WebP. maxWidth scales wider images down. minWidth and minHeight (default 50 px) skip icons and tracking pixels. With dedupeByContent on, the same picture found under different URLs is stored once. Each file link stays valid for at least 7 days.

Teams use the extract images from web pages API to copy product photos from a shop page, build image catalogs, archive media from partner pages and prepare images for upload. It cannot fetch private or internal network addresses.

After extraction, use the Resize Image API for exact sizes, the Compress Images API to cut file size, or the Convert JPEG to WebP API and Convert PNG to WebP API for web-ready images.

POST
Bulk Image Downloader - Image URLs & Web Pages to Files
https://api.eu.apyhub.com/martin10291/bulk-image-downloader/bulk-image-downloader

QUICKSTART

GUIDE

Quickstart

Download one image from a direct link and get back its stored file details.

curl -X POST "https://api.eu.apyhub.com/martin10291/bulk-image-downloader/bulk-image-downloader" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://www.gstatic.com/webp/gallery/1.jpg"
    ]
  }'

To collect the images on a web page instead, send "pageUrls": ["https://books.toscrape.com/"] and set maxFiles to limit how many are stored.

What you'll get back

Returns a JSON object with a count and an items array. Each item has the download link in fileUrl, plus size, dimensions, format and hash.

{
  "count": 1,
  "items": [
    {
      "bytes": 44891,
      "contentType": "image/jpeg",
      "downloadedAt": "2026-12-04T08:32:16Z",
      "fileName": "1.jpg",
      "fileUrl": "https://api.eu.apyhub.com/martin10291/bulk-image-downloader<signature>",
      "format": "jpg",
      "found": true,
      "foundOn": "input",
      "height": 368,
      "key": "1.jpg",
      "name": null,
      "originalBytes": 44891,
      "position": 1,
      "sha256": "ddbdb9cdb5f109c567d2aafd076288cd57187e7a97d94898c72591dbfe28235c",
      "sourceUrl": "https://www.gstatic.com/webp/gallery/1.jpg",
      "width": 550
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
urls
Direct image or file links. Max 100 items. Send urls, pageUrls, or both. Direct links run first, in input order, and each one returns a row.
Quality for converted JPG and WebP images (30 to 100).
Max files stored per call (1 to 100). Links over the limit return a row with found set to false. Each fileUrl stays valid for at least 7 days.

About this endpoint

What it does

Downloads images or other files from direct links and web pages, stores each file, and returns a JSON object with one row per file and a public download link. It can also resize, convert and deduplicate the images.

Request Body

ParameterTypeDescription
urlsString ArrayDirect image or file links. Max 100 items. Send urls, pageUrls, or both. Direct links run first, in input order, and each one returns a row.
pageUrlsString ArrayWeb pages to scan for images: <img> src, lazy data-src, the largest srcset size, og:image, twitter:image and links to image files. Max 100 items. Page images are stored only while room remains under maxFiles.
fileTypesENUMAllowed values: images, all. Default: images. images rejects links that are not real images. all stores any file type.
outputFormatENUMAllowed values: original, jpg, webp, png. Default: original. original keeps the file as it is. The other values convert every image. Transparent images get a white background in JPG. SVG and HEIC files stay as they are.
qualityIntegerQuality for converted JPG and WebP images. Range: 30 to 100. Default: 85.
maxWidthIntegerImages wider than this are scaled down, keeping the aspect ratio. 0 means no resize. Range: 0 to 10000. Default: 0.
minWidthIntegerRaster images narrower than this are skipped. The check uses the source image, before any resize. Minimum: 0. Default: 50. SVG files ignore it.
minHeightIntegerRaster images shorter than this are skipped. The check uses the source image, before any resize. Minimum: 0. Default: 50. SVG files ignore it.
maxFileMbIntegerFiles bigger than this many megabytes are skipped. Range: 1 to 200. Default: 25.
maxFilesIntegerMax files stored per call. Range: 1 to 100. Default: 50. Links over the limit return a row with found set to false.
dedupeByContentBooleanWhen true, the same picture under different URLs is stored once, detected by the SHA-256 of the content. The first URL in input order is kept. Default: true.

Response

Returns a JSON object with a count and an items array. Each item describes one input link or one image found on a page.

ParameterTypeDescription
countIntegerNumber of rows in items.
items[].foundBooleantrue when the file was stored. false when it was skipped or failed. See reason.
items[].reasonStringWhy the row was not stored, for example HTTP 404, image too small (550x368 < 5000x50) or duplicate content (dedupeByContent:true). Only on rows where found is false.
items[].keyStringFile key.
items[].nameStringAlways null.
items[].sourceUrlStringThe link the file came from.
items[].foundOnStringinput for a link from urls, or the page address for an image found on a page.
items[].positionIntegerPosition of the link in urls, starting at 1. null for images found on pages.
items[].fileUrlStringPublic download link for the stored file. Valid for at least 7 days.
items[].fileNameStringName of the stored file.
items[].formatStringFile format, for example jpg, png, webp, gif or svg.
items[].contentTypeStringMIME type of the stored file.
items[].bytesIntegerSize of the stored file in bytes.
items[].originalBytesIntegerSize of the source file in bytes.
items[].widthIntegerWidth in pixels. null for files without pixel size, such as SVG or JSON.
items[].heightIntegerHeight in pixels. null for files without pixel size, such as SVG or JSON.
items[].sha256StringSHA-256 hash of the stored file.
items[].downloadedAtStringUTC time the file was downloaded, in ISO 8601 format.
items[].cachedBooleantrue when the row comes from an earlier identical request. Only present on cached rows.
items[].cacheAgeSecondsIntegerAge of the cached row in seconds. Only present on cached rows.

Notes

  • Send at least one of urls or pageUrls. Otherwise the call returns 400 with invalid_input.
  • Wrong types, unknown fields, null values, empty strings in lists and values outside a range return 400 with invalid_input and a message that names the field.
  • A link that cannot be stored does not fail the call. The call returns 200 and the row has found set to false and a reason. Reasons include source errors (HTTP 404, download failed after retries (503)), not a valid image, image too small, file bigger than maxFileMb, empty file (0 bytes), duplicate content and skipped: maxFiles limit reached.
  • Identical requests can return cached rows (cached is true).
  • Private and internal network addresses are blocked.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.