SerpBase

API reference · Search engines

Google Images Search

Google Image Search API: search Google Images by keyword, country and language, and get each image's title, image URL, thumbnail, source page and domain as JSON. Returned links do not grant image usage rights.

POSThttps://api.serpbase.dev/google/image/search
1 creditOpen in Playground

Example

BASH
curl -X POST 'https://api.serpbase.dev/google/image/search' \
  -H "Content-Type: application/json" \
  -H 'X-API-Key: YOUR_API_KEY' \
  --max-time 60 \
  -d '{"query":"red pandas"}'
Response · real, shortened
{
  "status": 0,
  "credits_charged": 1,
  "request_id": "r-4b27fe8a36d9ac303a5da7dd",
  "product_id": "google_images_search",
  "query": "red pandas",
  "images": [
    {
      "display_link": "en.wikipedia.org",
      "display_url": "en.wikipedia.org",
      "domain": "en.wikipedia.org",
      "image_url": "https://upload.wikimedia.org/wikipedia/commons/f/fd/Red_Panda%2C_Gentle_Tree-Dweller_of_the_Himalaya…",
      "link": "https://en.wikipedia.org/wiki/Red_panda",
      "position": 1,
      "rank": 1,
      "source": "Wikipedia",
      "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTNeizrqHVhTRtzGZT4s3Pnmc_FSNTmyKg45Jj_Fn8k8A&s=10",
      "thumbnail_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTNeizrqHVhTRtzGZT4s3Pnmc_FSNTmyKg45Jj_Fn8k8A&s=10",
      "title": "Red panda - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Red_panda"
    },
    {
      "display_link": "kids.nationalgeographic.com",
      "display_url": "kids.nationalgeographic.com",
      "domain": "kids.nationalgeographic.com",
      "image_url": "https://i.natgeofe.com/k/63b1a8a7-0081-493e-8b53-81d01261ab5d/red-panda-full-body_16x9.jpg",
      "link": "https://kids.nationalgeographic.com/animals/mammals/facts/red-panda",
      "position": 2,
      "rank": 2,
      "source": "National Geographic Kids",
      "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSCqYcPPXKAmx1AUafJcJFQ3vJ9RQmG_9xH0vqAXEocBg&s=10",
      "thumbnail_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSCqYcPPXKAmx1AUafJcJFQ3vJ9RQmG_9xH0vqAXEocBg&s=10",
      "title": "Red Panda | National Geographic Kids",
      "url": "https://kids.nationalgeographic.com/animals/mammals/facts/red-panda"
    }
  ],
  "page": 1,
  "search_type": "images"
}

Parameters

qrequired
string
Search query string.
hl
string
Language code.
More

Defaults to en.

gl
string
Country code.
More

Defaults to us.

page
number
1-based page number.
More

Defaults to 1.

format
"json" | "markdown"
json (default) returns the parsed result.
More

markdown returns the same result as Markdown text (text/markdown) for language models: no envelope, no duplicate alias fields, no inline images. Same credits; failures keep the JSON envelope.

timeout
number
How many seconds you will wait, 1 to 30 (decimals allowed).
More

Optional; without it the platform spends up to 30 seconds. With it, retries on other routes start earlier so an answer can still arrive inside your budget, and when the budget runs out the request ends with status 1504 and is not charged, instead of being cut off by your HTTP client. Keep your client's own timeout above this value.

query
string
Example: "red pandas"

Some Google Images payload shapes expose rank/link but not every normalized alias. Treat url, display_url, source_url, position, and thumbnail as optional.

What comes back

Fields that are not on the page for a given request are left out rather than sent empty.

query
required
string

required

Normalized query from the request.

page
required
number

required

Current 1-based page number.

images
optional
ImageResult[]

When image results are parsed.

Google Images results.

ImageResult Result item schema

rank
required
number

required

1-based place of the item within its own module (the 3rd organic result has rank 3).

position
optional
number (integer)

On every item and module of Google web search except the plain-text lists related_searches and people_also_search_for; elsewhere when available.

Where the item's module sits on the results page: its block number from the top (1 = first). Each organic result is one block and every other module one block, so all items of a module share its number. Use rank for the order within a module. On products that show a single list, position equals rank.

title
optional
string

When image title or alt text is parsed.

Result title.

link
required
string

required

Primary link returned by the parser.

url
optional
string

Present for normalized result links.

Canonical target URL, usually the same value as link.

source_url
optional
string

Only when Google redirect/source URL is observed.

Original Google URL kept for debugging and provenance.

display_url
optional
string

When Google display text or a domain can be derived.

Display URL or source domain.

image_url
required
string

required

Full image URL.

thumbnail_url
optional
string

When Google exposes a thumbnail.

Thumbnail URL.

thumbnail
optional
string

Alias for thumbnail_url when available.

Normalized thumbnail alias.

source
optional
string

When source text is parsed.

Image source label.

domain
optional
string

When source page domain can be derived.

Source page domain.

If it fails

A failed request has a non-zero status and an error, and is not charged. The ones you will see here:

1000A parameter is missing or wrongFix the request
1020No credits leftTop up
1029Over your requests per secondWait Retry-After seconds
1502 · 1504The source could not be read this timeRetry
All status codes →