Skip to main content

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

ParameterDescriptionExampleRequiredNotes
queryThe search termcaféYesMust be URL encoded
locationGeographic locationParis,Paris,Ile-de-France,FranceYesMust follow format: City,City,Region,Country
google_domainGoogle domain to usegoogle.frNoDomain name without https://www.
glGoogle country codefrNoTwo-letter country code
hlInterface languagefrNoTwo-letter language code
search_typeType of searchimagesYesMust be set to images
deviceDevice typedesktopNoOptions: desktop or mobile
pagePage number1NoRange: 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

FieldTypeDescription
original_image_heightnumberHeight of the original image in pixels
original_image_widthnumberWidth of the original image in pixels
original_image_urlstringDirect URL to the full-size image
referrer_urlstringURL of the webpage containing the image
site_titlestringTitle of the website hosting the image
textstringCaption or title associated with the image
thumbnail_urlstringURL 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 CodeDescription
200Success
400Invalid parameters
401Invalid or missing API key
429Too many concurrent connections
500Server error
caution
  • Image URLs may expire or become invalid
  • Original images might be removed from their source
  • Large images may require significant bandwidth