Google Images API
Reverse-image-friendly visual search - query Google Images and receive structured image results.
Endpoint
POST https://serpforai.dev/api/v1/search
GET https://serpforai.dev/api/v1/search
Authentication is a bearer header carrying your API key:
Authorization: Bearer <userKey>
Set t: "google_images". This is one of five Google vertical engines available on this API - see
also Google Shopping, Google Videos,
Google Short Videos and Google News. For
general web search use the SERP API.
Request parameters
POST requests send JSON; GET requests send the same fields as query parameters.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
s | string | yes | - | The search keyword |
t | string | yes | - | Must be google_images |
d | number | no | 5000 | Maximum time the API may spend, in milliseconds |
country | string | no | - | ISO 3166-1 alpha-2 country code (e.g. us) |
html | number | no | 0 | 1 includes the raw result-page HTML alongside data, 0 omits it |
There is no p (page) parameter for this engine.
Response
{
"code": 0,
"msg": "",
"data": {
"id": "q_...",
"images_results": [
{
"position": 1,
"title": "...",
"link": "https://...",
"thumbnail": "https://...",
"source": "...",
"original": "https://...",
"original_width": 1200,
"original_height": 800,
"is_product": false
}
],
"suggestedSearches": [
{ "name": "...", "link": "https://...", "q": "..." }
]
}
}
| Field | Description |
|---|---|
code | 0 means success; anything else is a failure |
msg | Human readable failure reason, empty on success |
data.id | Opaque search-session id |
data.images_results[] | Image rows - position, title, link, thumbnail, source, original, original_width, original_height, is_product |
data.suggestedSearches[] | Related search suggestions - { name, link, q } |
Unlike bing/google, data here is an object, not a bare array - read
data.images_results, not data directly.
Example
curl -X POST https://serpforai.dev/api/v1/search \
-H "Authorization: Bearer $SERPFORAI_KEY" \
-H "Content-Type: application/json" \
-d '{"s":"vintage camera","t":"google_images","country":"us"}'
import httpx
response = httpx.post(
"https://serpforai.dev/api/v1/search",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"s": "vintage camera", "t": "google_images", "country": "us"},
timeout=30,
)
payload = response.json()
for row in payload["data"]["images_results"]:
print(row["title"], row["original"])