Skip to content
Search API · Use case

Get full-size image URLs and dimensions from a Google image search API

A Google image search API is what you need when the answer to a query is a picture: each result comes back with the full-resolution image URL, its width and height, a thumbnail, the page it came from, and the creator or credit when Google shows one. Content teams source visuals, catalogs find product shots and dataset builders collect examples by keyword. The Search API returns them as JSON.

The problem

Image results give you thumbnails, not the actual image

Image search is built for browsing. The grid shows thumbnails, the full image sits behind a viewer, and the page that published it is one more click away. For a pipeline that needs the original file at a known size, every one of those hops is work.

Scraping the image grid yourself gets you cached thumbnails and encoded links to the originals, loaded lazily as the page scrolls. Resolving each one to the real file and measuring it means downloading every candidate before you know whether it is big enough to use.

type: images returns each result with image.url, image.width and image.height for the full-resolution file, a thumbnail with its own dimensions, url for the source page, and creator and credit when available. You filter by size and aspect ratio before downloading anything, then read the source page only for the images you keep.

How it works

How to find full-size images with the Google image search API

Search by keyword, keep the images that fit your layout, then check the source before you use one. The images guide documents the result shape.

1 · Search by keyword
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const { results } = await microlink.search('northern lights iceland', {
  type: 'images'
})

const images = results.map(({ title, url, image, thumbnail, creator, credit }) => ({
  title,
  source: url,
  src: image.url,
  width: image.width,
  height: image.height,
  preview: thumbnail.url,
  creator,
  credit
}))

image is the full-resolution file and thumbnail the small preview, each with width and height. url is the page that published the image, where its license terms live.

2 · Keep the ones that fit
const wide = results.filter(
  ({ image }) => image.width >= 1600 && image.width / image.height >= 1.5
)

There is no server-side size filter; the dimensions in each result are the filter. This keeps landscape images at least 1600 pixels wide, before any download.

3 · Read the source page
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const [pick] = wide

const sourcePage = await pick.markdown()

markdown() fetches the page the image came from as Markdown, one request, so you can read the caption, the credit line and the usage terms around it. See content expansion for the HTML variant.

Parameters used
  • type 'images' returns title, url, image and thumbnail, plus optional google, creator and credit.
  • location Two-letter country code that geo-targets the results.
  • limit Maximum number of images per page.
  • page More candidates when too few pass your size filter, one request per page.

The search takes a text query. It does not accept an image as input, so it does no reverse image search and finds no visually similar images. For moving pictures, the videos surface returns duration, channel and publish date with the same client.

Why it works

Why image results with dimensions save a download step

Most image pipelines discard most candidates. Knowing the size up front means the rejected ones are never downloaded.

01 · Size before download
width and height for the image and its thumbnail.
Filter for print widths, square crops for avatars or wide frames for hero banners using numbers already in the result. Only the images that pass reach your downloader.

Need a picture of a web page rather than a picture on it? Capture a mobile screenshot at any viewport with the Screenshot API.

02 · Attribution in the result
creator, credit and the source page.
When Google shows them, creator and credit arrive as fields, and url points to the page that published the image. That is what an editor needs to check the rights and credit the photographer.

Looking for products with prices rather than pictures? Compare prices from Google Shopping, where each listing can carry its product image.

03 · Query in, images out
A keyword and an optional country.
The same microlink.search call as every other surface, with type: 'images'. location geo-targets the results by country and next() fetches more candidates, one request per page.

When not to: a search result is not a license. A found image still belongs to its creator, so check the source page before publishing it. And if you want to search by an image rather than for one, this surface does not do reverse image search.

FAQ

Does the Google image search API return full-size image URLs?

Yes. image.url points to the full-resolution file with image.width and image.height, thumbnail carries the smaller preview with its own dimensions, and url is the page the image was published on.

Can I filter image search results by size?

There is no size parameter. Every result includes its dimensions, so filter in code by minimum width, height or aspect ratio before downloading, and paginate with next() when too few results pass.

Can I do a reverse image search with this API?

No. The images surface takes a text query and returns matching images. It does not accept an image as input and does not find visually similar images.

Can I publish images found through the image search API?

The API returns what Google Images lists, with creator and credit when available and the source page URL. Rights stay with the owner, so check the terms on the source page before you publish an image.

How much does the image search API cost, and is it affiliated with Google?

Each results page is one request. Search has no free tier: it is paid from the first request, and Pro plans start at €39/month for 46,000 requests. Microlink Search is an independent product, not affiliated with or endorsed by Google; Google is a trademark of Google LLC.
Related use cases

Solve the next problem with the same API

Price comparison from Google Shopping

Get every merchant Google Shopping lists for a product, with a numeric price, the merchant name and the rating, per country.

Keyword research with Google Autocomplete

Expand a seed into the queries people type, plus related searches and People Also Ask questions, per country.

Google results page as Markdown or HTML

Start from a query, not a URL: get the structured results plus the Google results page itself as Markdown or HTML.

Brand colors from images

Get the dominant palette and an accessible text and background pair from a site’s logo and preview image.

Fix missing or wrong og:image

Override any normalized field with a rule and chain fallbacks so link previews never render empty.

Dynamic Open Graph images

Point og:image at an API URL and every share shows a current, cached screenshot of the page.

Ready to find full-size images?

Full-resolution image URLs with dimensions and attribution as JSON. Get a Pro key and run your first image search today.