Image Search API
The Google Image Search API returns image results with detailed metadata for each image. Use this endpoint by setting search_type=images
in your request.
Request Format
GET /api/google?search_type=images
Parameters
Parameter | Description | Example | Required | Notes |
---|---|---|---|---|
query | The search term | café | Yes | Must be URL encoded |
location | Geographic location | Paris,Paris,Ile-de-France,France | Yes | Must follow format: City,City,Region,Country |
google_domain | Google domain to use | google.fr | No | Domain name without https://www. |
gl | Google country code | fr | No | Two-letter country code |
hl | Interface language | fr | No | Two-letter language code |
search_type | Type of search | images | Yes | Must be set to images |
device | Device type | desktop | No | Options: desktop or mobile |
page | Page number | 1 | No | Range: 1-100 |
Response Format
{
"images": Array<{
original_image_height: number, // Height of original image
original_image_width: number, // Width of original image
original_image_url: string, // URL of full-size image
referrer_url: string, // Source webpage URL
site_title: string, // Title of source website
text: string, // Image caption or title
thumbnail_url: string // URL of thumbnail image
}>,
"metadata": {
status: string, // Success/failure status
request_id: string, // Unique identifier for request
created_at: string, // Request timestamp
updated_at: string, // Response timestamp
params: { // Echo of request parameters
query: string,
location: string,
google_domain: string,
gl: string,
hl: string,
search_type: string,
page: string | null,
device: string
}
}
}
Example Request
curl -X 'GET' \
'https://app.serpextractor.com/api/google?query=café&location=Paris%2CParis%2CIle-de-France%2CFrance&google_domain=google.fr&gl=fr&hl=fr&search_type=images&device=desktop' \
-H 'accept: */*' \
-H 'X-API-Key: YOUR_API_KEY'
Response Fields
Image Result Object
Field | Type | Description |
---|---|---|
original_image_height | number | Height of the original image in pixels |
original_image_width | number | Width of the original image in pixels |
original_image_url | string | Direct URL to the full-size image |
referrer_url | string | URL of the webpage containing the image |
site_title | string | Title of the website hosting the image |
text | string | Caption or title associated with the image |
thumbnail_url | string | URL of the thumbnail version of the image |
Pagination
The image search supports pagination similar to regular search results:
- Default page size is typically 10 images
- Page parameter accepts values from 1-100
- Empty results indicate end of available pages
Error Handling
Status Code | Description |
---|---|
200 | Success |
400 | Invalid parameters |
401 | Invalid or missing API key |
429 | Too many concurrent connections |
500 | Server error |
caution
- Image URLs may expire or become invalid
- Original images might be removed from their source
- Large images may require significant bandwidth