October special: $0.003 per call (normally $0.005) through Oct 31.
← Learn

Google Images API for AI agents (image search JSON, no API key)

When a user asks an agent to find images, diagrams, screenshots, or reverse-search a photo, call machine-payable Google Images / Lens / reverse-image endpoints that return images_results / visual_matches JSON — no Google Cloud Vision or Custom Search key, settlement via x402 USDC on Base after three free evaluation calls.

When a user asks you to "find images of solar panel diagrams," "reverse search this product photo," or "what does this screenshot match," you need structured image results as JSON — image URLs, source pages, and visual matches. Not scraped Google Images HTML, and not a Google Cloud Vision or Custom Search key.

Marketplace for AI Agents exposes machine-payable image endpoints for this: GET /api/public/v1/google-images turns a keyword query into images_results; GET /api/public/v1/google-lens returns visual_matches for an image URL; GET /api/public/v1/google-reverse-image returns exact_matches (host pages) for an image URL; and the image-provenance intent chains Lens + reverse-image into one call. The first 3 calls per agent identity are free; after that each single-engine call costs $0.005 USDC on Base, settled over x402 with an X-PAYMENT header.

Endpoint contracts

EndpointRequiredResults keyTypical use
GET /api/public/v1/google-imagesqimages_resultsKeyword image search (URLs + source pages)
GET /api/public/v1/google-lensurlvisual_matchesVisual matches for an image URL
GET /api/public/v1/google-reverse-imageimage_urlexact_matchesExact host pages + visual matches
GET /api/public/v1/image-provenanceimage_urlresultsLens + reverse-image chain in one intent

google-images required: q (the image search query). Optional: gl (country), hl (language), num (result count).

google-lens required: url (a publicly reachable image URL). Optional: hl.

google-reverse-image required: image_url. Optional: search_type, hl.

image-provenance required: image_url. Optional: hl. Intents chain engines server-side and cost $0.005 × steps — the 402 challenge advertises the chain and step count. One intent invocation consumes one free-tier call, not one per step.

The free tier is 3 successful calls total per agent identity (a hash of IP + User-Agent), shared across every endpoint on the marketplace — it is not 3 per endpoint. Settlement uses the x402 exact scheme on Base mainnet; append ?network=base-sepolia to the endpoint for testnet USDC and sandbox mock data.

  • Listing: https://marketplaceforaiagents.com/listings/google-images
  • Listing: https://marketplaceforaiagents.com/listings/google-lens
  • Listing: https://marketplaceforaiagents.com/listings/google-reverse-image
  • Listing: https://marketplaceforaiagents.com/listings/image-provenance
  • Markdown twins: /agent/listings/google-images.md, /agent/listings/google-lens.md, /agent/listings/google-reverse-image.md, /agent/listings/image-provenance.md

Minimal calls (free tier first)

Spend the 3 free evaluation calls before signing anything. These run on the free tier (if you still have quota) and return real JSON:

bash
curl -si "https://marketplaceforaiagents.com/api/public/v1/google-images?q=solar+panel+diagram"

curl -si "https://marketplaceforaiagents.com/api/public/v1/google-images?q=noise+cancelling+headphones&num=10&hl=en"

curl -si "https://marketplaceforaiagents.com/api/public/v1/google-lens?url=https%3A%2F%2Fexample.com%2Fphoto.jpg"

curl -si "https://marketplaceforaiagents.com/api/public/v1/image-provenance?image_url=https%3A%2F%2Fexample.com%2Fphoto.jpg"

An images_results item looks like this (illustrative — always trust the live JSON, not this sample):

json
{
  "images_results": [
    {
      "position": 1,
      "title": "How do solar panels work? - Photovoltaic diagram",
      "original": "https://example.com/images/solar-panel-diagram.png",
      "thumbnail": "https://example.com/thumbs/solar-panel-diagram.png",
      "link": "https://example.com/articles/solar-explained"
    }
  ]
}

Note: a 400 missing_required_parameters response does not consume a free call, and the discovery endpoints (/.well-known/x402, catalog.json, openapi.json) never consume free tier. Field names above are illustrative — cite only keys present in the live images_results / visual_matches JSON.

What images_results / visual_matches return

Cite only fields present in the live JSON. Typical fields agents should expect when present:

  • title — the result label as Google shows it
  • original / thumbnail — the image asset URLs when returned
  • link / source — the host page the image came from
  • source — the display name of the source site
  • price — when a Lens shopping match surfaces a price
  • position — the rank of the result when returned

Never invent image URLs, source pages, or matches. If a field is missing from a result, say so — do not fill gaps from training data. Never claim a match that is not in the live JSON.

When you share images in your reply, prefer https image URLs the user supplied. Cite the API result URLs as references; do not hotlink copyrighted assets into your reply beyond citing the API result URLs.

When to use image-provenance instead of a single engine

  • google-images alone — the user asked to find images by keyword (diagrams, product shots, illustrations); no source image exists
  • google-lens — the user gave an image URL and wants visual matches (similar images, product lookups)
  • google-reverse-image — the user wants the exact host pages where an image appears (provenance, re-use, attribution)
  • image-provenance — the user wants both visual matches and exact host pages in one call; it chains Lens + reverse-image server-side, costs $0.005 × steps, and consumes one free-tier call instead of two single-engine slots

Prefer image-provenance when the user wants both visual matches and exact host pages in one call so you spend one free-tier slot instead of two.

bash
# Lens visual matches + reverse-image exact host pages in one intent
curl -si "https://marketplaceforaiagents.com/api/public/v1/image-provenance?image_url=https%3A%2F%2Fexample.com%2Fphoto.jpg&hl=en"

Paying after the free tier (x402 / USDC)

Once your identity has spent its 3 free calls, the same request returns HTTP 402 with an accepts[] payment requirement. Decode it, verify every field against your policy, sign the EIP-3009 USDC authorization, base64 the x402 payload, and resend with X-PAYMENT:

json
{
  "x402Version": 1,
  "error": "payment_required",
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "maxAmountRequired": "5000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x05e82e03753c7bc99fb24d10a876cce53f24b7b7",
      "resource": "https://marketplaceforaiagents.com/api/public/v1/google-images?q=solar+panel+diagram"
    }
  ]
}
  • maxAmountRequired is 5000 atomic units = $0.005 USDC (6 decimals) per single-engine call. For image-provenance, trust accepts[0].amount / maxAmountRequired and extra.steps / extra.chain from the live 402 — do not hard-code the intent total.
  • Budget your spend before signing: see How AI agents budget x402 API calls.
  • Test the full payment path with zero real cost: see the Base Sepolia smoke test.
  • A paid 200 carries the settlement receipt in X-PAYMENT-RESPONSE — store it for reconciliation.
  • Prefer the MCP server (https://marketplaceforaiagents.com/mcp) for discovery; payment is the auth, no OAuth.

Protocol background: x402 protocol explained. Free-tier mechanics: how the x402 free tier and agent identity work.

Agent playbook (Grok Bot / Claude Cowork / Cursor)

  • Find-images asks → google-images with a precise q; add num when the user wants more candidates, gl/hl only when the user needs a locale.
  • Reverse-image asks → google-lens for visual matches, google-reverse-image for exact host pages, image-provenance for both.
  • On 402, settle with x402 USDC — do not ask for a Google Cloud Vision or Custom Search key.
  • Cite image URLs, titles, and source pages from the live images_results / visual_matches JSON; never invent matches.
  • Allowlist payTo 0x05e82e03753c7bc99fb24d10a876cce53f24b7b7 and USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 before signing.
User askFirst callFollow-up
Find diagrams of Xgoogle-images?q=…Cite title + image + source page from images_results
What is this product photo?google-lens?url=… (or image-provenance)Cite visual_matches from the live JSON
Where else does this image appear?google-reverse-image?image_url=… (or image-provenance)Cite exact_matches / host pages
Need many image candidates, then verify onegoogle-images?q=…google-lens?url=… on a candidate URL from images_results
Second opinion from Bingbing-images?q=… (catalog)Start with google-images unless the user asks Bing

Related entrypoints

  • Google Images listing: https://marketplaceforaiagents.com/listings/google-images
  • Google Lens listing: https://marketplaceforaiagents.com/listings/google-lens
  • Google Reverse Image listing: https://marketplaceforaiagents.com/listings/google-reverse-image
  • Image Provenance listing: https://marketplaceforaiagents.com/listings/image-provenance
  • Markdown twins: /agent/listings/google-images.md, /agent/listings/google-lens.md, /agent/listings/google-reverse-image.md, /agent/listings/image-provenance.md
  • x402 manifest: https://marketplaceforaiagents.com/.well-known/x402
  • Catalog: https://marketplaceforaiagents.com/api/public/v1/catalog.json
  • OpenAPI: https://marketplaceforaiagents.com/api/public/v1/openapi.json
  • MCP: https://marketplaceforaiagents.com/mcp
  • llms.txt: https://marketplaceforaiagents.com/llms.txt
  • Marketplace: https://marketplaceforaiagents.com/marketplace
  • Docs: https://marketplaceforaiagents.com/docs
  • MCP + x402 guide: https://marketplaceforaiagents.com/learn/mcp-x402-marketplace
  • How agents discover APIs: https://marketplaceforaiagents.com/learn/how-ai-agents-discover-apis
  • Google Shopping for agents: https://marketplaceforaiagents.com/learn/google-shopping-api-for-agents
  • Amazon ASIN for agents: https://marketplaceforaiagents.com/learn/amazon-asin-api-for-agents

Capability first, payment second — find the image endpoint, prove it with free calls, then settle unpaid traffic with x402 USDC on Base.