Generator

Menu

AI GeneratorImages, video, audio and 3D

Browse categories

Docs menu
Downloads

API reference

Downloads

Files and signed links, counted under fair use only when delivered; the download history.

View as Markdown
For your agent https://imgsearch.com/llms.txt
On this page
GET /assets/{type}/{id}/file

Download one file #

  • assets.file
  • download

Fetches, verifies and returns the file, and records the download only after that, under the website's fair use; a file already downloaded is free again. Photos come at the account's size (1600×900 on a free account). Videos, sound packs and 3D kits answer 302 to a short-lived signed CDN URL: follow redirects. A video counts when its link is handed out, and a retry of the same video is free. Pack and kit ZIPs never count. Only GET fetches; HEAD answers 405 and counts nothing.

Parameters

NameInTypeDescription
typerequired path string One of: photo, video, svg, svg_pack, brand, sound_effect, sfx_pack, 3d_model, 3d_kit
idrequired path string A photo's slug, an SFX pack's slug, or any other item's uid, as the search card gives it.
background query string SVGs, brands and SVG packs only. Defaults to the item's own. One of: original, transparent

Responses

  • 200 The file, as an attachment: a photo (JPEG or PNG), an SVG, a sound (WAV), or a ZIP (brands, SVG packs, 3D models).
  • 302 A video, sound pack or 3D kit, at a signed CDN URL.
  • Error Error envelope (error codes)

Examples

curl
# Downloads the file under fair use. Videos, sound packs and 3D kits redirect to a signed CDN address.
# Needs IMGSEARCH_API_KEY, ASSET_TYPE and ASSET_ID.
curl -sS -L -OJ \
  "${IMGSEARCH_API_BASE:-https://imgsearch.com/api/v2}/assets/$ASSET_TYPE/$ASSET_ID/file" \
  -H "Authorization: Bearer $IMGSEARCH_API_KEY"
Python
# Downloads the file under fair use. Videos, sound packs and 3D kits redirect to a signed CDN address.
# Needs IMGSEARCH_API_KEY, ASSET_TYPE and ASSET_ID.
import os
import re

import httpx

base = os.environ.get("IMGSEARCH_API_BASE", "https://imgsearch.com/api/v2")
headers = {"Authorization": f"Bearer {os.environ['IMGSEARCH_API_KEY']}"}

r = httpx.get(
    f"{base}/assets/{os.environ['ASSET_TYPE']}/{os.environ['ASSET_ID']}/file",
    headers=headers,
    follow_redirects=True,
    timeout=60,
)
match = re.search(r'filename="?([^";]+)', r.headers.get("content-disposition", ""))
name = match.group(1) if match else os.environ["ASSET_ID"]
if r.status_code == 200:
    open(name, "wb").write(r.content)
print(r.status_code, r.headers.get("content-type"), len(r.content), "bytes", name if r.status_code == 200 else r.text)
JavaScript
// Downloads the file under fair use. Videos, sound packs and 3D kits redirect to a signed CDN address.
// Needs IMGSEARCH_API_KEY, ASSET_TYPE and ASSET_ID.
import { writeFile } from "node:fs/promises";

const base = process.env.IMGSEARCH_API_BASE ?? "https://imgsearch.com/api/v2";

const r = await fetch(`${base}/assets/${process.env.ASSET_TYPE}/${process.env.ASSET_ID}/file`, {
  headers: { Authorization: `Bearer ${process.env.IMGSEARCH_API_KEY}` },
});
const match = /filename="?([^";]+)/.exec(r.headers.get("content-disposition") ?? "");
const name = match ? match[1] : process.env.ASSET_ID;
const bytes = Buffer.from(await r.arrayBuffer());
if (r.status === 200) await writeFile(name, bytes);
console.log(r.status, r.headers.get("content-type"), bytes.length, "bytes", r.status === 200 ? name : bytes.toString());
Try it

The try-it panel needs JavaScript.

POST /downloads

Signed download links for up to 20 items #

  • downloads.store
  • download

A 10-minute link per item, for a person or a batch. No fair use is counted until a link is fetched; fetching it works like the file route. Each item found counts as one result card, as GET /assets/{type}/{id} does. One item that cannot be downloaded is refused on its own, and the others still get their links.

Request body

application/json

FieldTypeDescription
itemsrequired array of object At least 1 items, At most 20 items.

Responses

  • 200 One link or refusal per item, in order. (List)
  • Error Error envelope (error codes)

Examples

curl
# A 10-minute download link per item; nothing counts until a link is fetched.
# Needs IMGSEARCH_API_KEY, ASSET_TYPE and ASSET_ID.
curl -sS -X POST \
  "${IMGSEARCH_API_BASE:-https://imgsearch.com/api/v2}/downloads" \
  -H "Authorization: Bearer $IMGSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<EOF
{
  "items": [
    {
      "type": "$ASSET_TYPE",
      "id": "$ASSET_ID"
    }
  ]
}
EOF
Python
# A 10-minute download link per item; nothing counts until a link is fetched.
# Needs IMGSEARCH_API_KEY, ASSET_TYPE and ASSET_ID.
import json
import os

import httpx

base = os.environ.get("IMGSEARCH_API_BASE", "https://imgsearch.com/api/v2")
headers = {"Authorization": f"Bearer {os.environ['IMGSEARCH_API_KEY']}"}

r = httpx.post(
    f"{base}/downloads",
    headers=headers,
    json={"items": [{"type": os.environ["ASSET_TYPE"], "id": os.environ["ASSET_ID"]}]},
    timeout=60,
)
print(r.status_code)
print(json.dumps(r.json(), indent=2))
JavaScript
// A 10-minute download link per item; nothing counts until a link is fetched.
// Needs IMGSEARCH_API_KEY, ASSET_TYPE and ASSET_ID.
const base = process.env.IMGSEARCH_API_BASE ?? "https://imgsearch.com/api/v2";

const r = await fetch(`${base}/downloads`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.IMGSEARCH_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ items: [{ type: process.env.ASSET_TYPE, id: process.env.ASSET_ID }] }),
});
console.log(r.status);
console.log(JSON.stringify(await r.json(), null, 2));
Response 200
{
    "object": "list",
    "has_more": false,
    "next_cursor": null,
    "data": [
        {
            "status": "ready",
            "url": "https://imgsearch.com/api/v2/files/EXAMPLE-SIGNED-LINK",
            "expires_at": "2026-11-26T09:55:42Z",
            "file_name": "majestic-red-fox-in-a-frosty-landscape-141601326.jpg",
            "download": {
                "fair_use_units": 0,
                "free": true,
                "counter": "files"
            },
            "object": "download_link",
            "type": "photo",
            "id": "majestic-red-fox-in-a-frosty-landscape-141601326",
            "error": null
        }
    ]
}
Try it

The try-it panel needs JavaScript.

GET /account/downloads

The account's download history, newest first #

  • account.downloads
  • download

Every surface's downloads (web, api, mcp); rows from before the API have surface null. svg covers brands.

Parameters

NameInTypeDescription
type query string One of: photo, video, svg, sound_effect, 3d_model
limit query integer Items per page.
cursor query string The next_cursor of the previous page, as it came. It works only for the same list, filter and account.

Responses

Examples

curl
# The account's last ten downloads, from every surface.
# Needs IMGSEARCH_API_KEY.
curl -sS \
  "${IMGSEARCH_API_BASE:-https://imgsearch.com/api/v2}/account/downloads?limit=10" \
  -H "Authorization: Bearer $IMGSEARCH_API_KEY"
Python
# The account's last ten downloads, from every surface.
# Needs IMGSEARCH_API_KEY.
import json
import os

import httpx

base = os.environ.get("IMGSEARCH_API_BASE", "https://imgsearch.com/api/v2")
headers = {"Authorization": f"Bearer {os.environ['IMGSEARCH_API_KEY']}"}

r = httpx.get(f"{base}/account/downloads", headers=headers, params={"limit": 10}, timeout=60)
print(r.status_code)
print(json.dumps(r.json(), indent=2))
JavaScript
// The account's last ten downloads, from every surface.
// Needs IMGSEARCH_API_KEY.
const base = process.env.IMGSEARCH_API_BASE ?? "https://imgsearch.com/api/v2";

const r = await fetch(`${base}/account/downloads?limit=10`, {
  headers: { Authorization: `Bearer ${process.env.IMGSEARCH_API_KEY}` },
});
console.log(r.status);
console.log(JSON.stringify(await r.json(), null, 2));
Response 200
{
    "object": "list",
    "data": [
        {
            "object": "download",
            "type": "photo",
            "id": "majestic-red-fox-in-a-frosty-landscape-141601326",
            "title": "Majestic red fox in a frosty landscape",
            "downloaded_at": "2026-11-07T14:59:38Z",
            "charged": true,
            "surface": "api"
        }
    ],
    "has_more": false,
    "next_cursor": null
}
Try it

The try-it panel needs JavaScript.

GET /files/{token}

Fetch a signed download link #

  • files.show
  • No key needed

The link is the credential: it works for 10 minutes, for the account and the key or token that asked for it, and stops when either is revoked. Fetching it downloads and counts exactly as the file route does. Only GET fetches; HEAD answers 405 and counts nothing.

Parameters

NameInTypeDescription
tokenrequired path string

Responses

  • 200 The file, as an attachment: a photo (JPEG or PNG), an SVG, a sound (WAV), or a ZIP (brands, SVG packs, 3D models).
  • 302 A video, sound pack or 3D kit, at a signed CDN URL.
  • Error Error envelope (error codes)

Examples

curl
# Fetches a signed download link (a url from POST /downloads) and saves it under the download's file_name. The link is
# the credential. Videos, sound packs and 3D kits answer 302 to a signed CDN address, which -L follows.
# Needs LINK_URL and FILE_NAME.
name="${FILE_NAME:-download}"
status=$(curl -sS -L -o "$name" -w '%{http_code}' "$LINK_URL")
echo "$status $name"
if [ "$status" != 200 ]; then
  cat "$name"; rm -f "$name"
fi
Python
# Fetches a signed download link (a url from POST /downloads) and saves it under the download's file_name. The link is
# the credential. Videos, sound packs and 3D kits answer 302 to a signed CDN address, which this follows.
# Needs LINK_URL and FILE_NAME.
import os

import httpx

name = os.environ.get("FILE_NAME") or "download"
r = httpx.get(os.environ["LINK_URL"], follow_redirects=True, timeout=60)
if r.status_code == 200:
    open(name, "wb").write(r.content)
print(r.status_code, r.headers.get("content-type"), len(r.content), "bytes", name if r.status_code == 200 else r.text)
JavaScript
// Fetches a signed download link (a url from POST /downloads) and saves it under the download's file_name. The link is
// the credential. Videos, sound packs and 3D kits answer 302 to a signed CDN address, which fetch follows.
// Needs LINK_URL and FILE_NAME.
import { writeFile } from "node:fs/promises";

const name = process.env.FILE_NAME || "download";
const r = await fetch(process.env.LINK_URL);
const bytes = Buffer.from(await r.arrayBuffer());
if (r.status === 200) await writeFile(name, bytes);
console.log(r.status, r.headers.get("content-type"), bytes.length, "bytes", r.status === 200 ? name : bytes.toString());