# Google API for agents

> API for Agents · https://apiforagents.dev/platforms/google · HTML twin: https://apiforagents.dev/platforms/google

Web search, news, images, shopping and Play Store reviews from Google.

Endpoint: `POST https://apiforagents.dev/v1/google`. One op per call. Quote first with `"estimateOnly": true`.

## Prices (USD per record, pay as you go)

| Record | Per record |
|---|---|
| play reviews | $0.00009 |
| images | $0.0009 |
| search | $0.0009 |
| news | $0.0018 |
| shopping | $0.0027 |

## Operations

### search

Google web results. Organic links with titles, snippets and rank; supports operators (site:, intitle:, OR). Billed per page of about ten results.

| Field | Required | Type | Meaning |
|---|---|---|---|
| query | yes | string (≤300 chars) |  |
| pages | no | integer (1-5) | Billed per page of ~10 results. The one op counted in pages. |
| country | no | string (ISO alpha-2) | Country to search from. |
| language | no | string (BCP-47) |  |
| site | no | string (≤120 chars) | Only results from this domain ("linkedin.com/in", "reddit.com"). The same as writing site: in the query. |
| relatedToSite | no | string (≤120 chars) | Sites Google considers similar to this domain, instead of the query's own matches. |
| since | no | string (YYYY-MM-DD) |  |
| until | no | string (YYYY-MM-DD) |  |
| fileTypes | no | list of string (each ≤8 chars) | Only documents of these types, as extensions ("pdf", "xlsx", "ppt"). Empty = any page. |

Response fields (each row of data; every field present, null when the source had nothing):

| Field | Type |
|---|---|
| link | string |
| title | string |
| snippet | string |
| domain | string |
| source | string |
| publishedDate | string |
| rank | integer |
| relatedQuestions | any |
| relatedSearches | any |
| aiAnswer | string |
| aiAnswerSources | any |
| details | object |

`details` is always the last field: everything else the source sent for that row, under our own field names. Its keys depend on the source that answered, so read them defensively; it is `{}` when there is nothing more.

Example request:

```bash
curl -X POST https://apiforagents.dev/v1/google \
  -H "Authorization: Bearer $AFA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"op":"search","query":"best CRM for startups","pages":1,"country":"US","language":"en"}'
```

Example response rows (made-up names, real field names; a live row carries every field above):

```json
[
  {
    "rank": 1,
    "title": "How to price a B2B SaaS product (2026 guide)",
    "domain": "northfold.example",
    "snippet": "A step-by-step way to set your first price, with worked examples.",
    "publishedDate": "2026-08-12",
    "link": "https://www.google.com/how-to-price-a-b2b-saas-product-2026-gui-1000",
    "details": {}
  },
  {
    "rank": 2,
    "title": "SaaS pricing models compared",
    "domain": "ledgerly.example",
    "snippet": "Per seat, usage-based and flat fees, side by side.",
    "publishedDate": "2026-06-30",
    "link": "https://www.google.com/saas-pricing-models-compared-1001",
    "details": {}
  }
]
```

Try it in the playground: https://apiforagents.dev/dashboard/run?platform=google&op=search (sign in first).

### news

Google News articles for a query. Headline, publisher, date, link.

| Field | Required | Type | Meaning |
|---|---|---|---|
| query | yes | string (≤300 chars) |  |
| postedWithin | no | enum |  Values: 1h, 1d, 7d, 1y, any. |
| country | no | string (ISO alpha-2) | The Google News market and its language. |
| language | no | string (BCP-47) |  |
| limit | no | integer (1-100) |  |

Response fields (each row of data; every field present, null when the source had nothing):

| Field | Type |
|---|---|
| articleUrl | string |
| title | string |
| source | string |
| publishedAt | string |
| publishedTimestamp | integer |
| imageUrl | string |
| details | object |

`details` is always the last field: everything else the source sent for that row, under our own field names. Its keys depend on the source that answered, so read them defensively; it is `{}` when there is nothing more.

Example request:

```bash
curl -X POST https://apiforagents.dev/v1/google \
  -H "Authorization: Bearer $AFA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"op":"news","query":"electric vehicles","postedWithin":"7d","country":"US","language":"en","limit":20}'
```

Example response rows (made-up names, real field names; a live row carries every field above):

```json
[
  {
    "title": "Kitebank opens its first branch in Europe",
    "source": "Daily Ledger",
    "publishedAt": "2026-10-15T08:00:00Z",
    "articleUrl": "https://www.google.com/kitebank-opens-its-first-branch-in-europ-1000",
    "imageUrl": "https://img.google.com/kitebank-opens-its-first-branch-in-europ.jpg",
    "details": {}
  },
  {
    "title": "Northfold raises $40M to automate finance teams",
    "source": "Tech Wire",
    "publishedAt": "2026-10-13T14:30:00Z",
    "articleUrl": "https://www.google.com/northfold-raises-40m-to-automate-finance-1001",
    "imageUrl": "https://img.google.com/northfold-raises-40m-to-automate-finance.jpg",
    "details": {}
  }
]
```

Try it in the playground: https://apiforagents.dev/dashboard/run?platform=google&op=news (sign in first).

### images

Google Images for a query. URL, source page, dimensions, thumbnail.

| Field | Required | Type | Meaning |
|---|---|---|---|
| query | yes | string (≤300 chars) |  |
| limit | no | integer (1-100) |  |

Response fields (each row of data; every field present, null when the source had nothing):

| Field | Type |
|---|---|
| imageUrl | string |
| title | string |
| sourceDomain | string |
| sourcePageUrl | string |
| thumbnailUrl | string |
| imageType | string |
| imageWidth | integer |
| imageHeight | integer |
| megapixels | number |
| orientation | string |
| details | object |

`details` is always the last field: everything else the source sent for that row, under our own field names. Its keys depend on the source that answered, so read them defensively; it is `{}` when there is nothing more.

Example request:

```bash
curl -X POST https://apiforagents.dev/v1/google \
  -H "Authorization: Bearer $AFA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"op":"images","query":"Eiffel Tower at night","limit":20}'
```

Example response rows (made-up names, real field names; a live row carries every field above):

```json
[
  {
    "title": "Minimal home office setup",
    "sourceDomain": "northfold.example",
    "imageType": "photo",
    "imageWidth": 1600,
    "imageHeight": 1067,
    "megapixels": 1.7,
    "orientation": "landscape",
    "imageUrl": "https://img.google.com/minimal-home-office-setup.jpg",
    "sourcePageUrl": "https://www.google.com/minimal-home-office-setup-1000",
    "thumbnailUrl": "https://img.google.com/minimal-home-office-setup.jpg",
    "details": {}
  },
  {
    "title": "Home office with plants",
    "sourceDomain": "interiors.example",
    "imageType": "photo",
    "imageWidth": 1080,
    "imageHeight": 1350,
    "megapixels": 1.5,
    "orientation": "portrait",
    "imageUrl": "https://img.google.com/home-office-with-plants.jpg",
    "sourcePageUrl": "https://www.google.com/home-office-with-plants-1001",
    "thumbnailUrl": "https://img.google.com/home-office-with-plants.jpg",
    "details": {}
  }
]
```

Try it in the playground: https://apiforagents.dev/dashboard/run?platform=google&op=images (sign in first).

### shopping

Google Shopping offers for a query. Title, merchant, price, rating.

| Field | Required | Type | Meaning |
|---|---|---|---|
| query | yes | string (≤300 chars) |  |
| country | no | string (ISO alpha-2) |  |
| language | no | string (BCP-47) |  |
| postedWithin | no | enum |  Values: 1h, 1d, 7d, 30d, any. |
| limit | no | integer (1-100) |  |

Response fields (each row of data; every field present, null when the source had nothing):

| Field | Type |
|---|---|
| productId | string |
| productUrl | string |
| title | string |
| merchant | string |
| price | string |
| priceValue | number |
| rating | number |
| reviewCount | integer |
| position | integer |
| image | string |
| details | object |

`details` is always the last field: everything else the source sent for that row, under our own field names. Its keys depend on the source that answered, so read them defensively; it is `{}` when there is nothing more.

Example request:

```bash
curl -X POST https://apiforagents.dev/v1/google \
  -H "Authorization: Bearer $AFA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"op":"shopping","query":"Sony WH-1000XM5","country":"US","language":"en","limit":20}'
```

Example response rows (made-up names, real field names; a live row carries every field above):

```json
[
  {
    "title": "Sonora Buds Pro, Noise Cancelling",
    "merchant": "Sonora Store",
    "price": "$79.00",
    "priceValue": 79,
    "rating": 4.4,
    "reviewCount": 2310,
    "position": 1,
    "productId": "1059897925",
    "productUrl": "https://www.google.com/sonora-buds-pro-noise-cancelling-1000",
    "details": {}
  },
  {
    "title": "Sonora Buds Pro, Noise Cancelling",
    "merchant": "GadgetHub",
    "price": "$84.99",
    "priceValue": 84.99,
    "rating": 4.4,
    "reviewCount": 2310,
    "position": 2,
    "productId": "2615731860",
    "productUrl": "https://www.google.com/sonora-buds-pro-noise-cancelling-1001",
    "details": {}
  }
]
```

Try it in the playground: https://apiforagents.dev/dashboard/run?platform=google&op=shopping (sign in first).

### playReviews

Play Store reviews for up to five apps, by package id or store URL.

| Field | Required | Type | Meaning |
|---|---|---|---|
| subjects | yes | list of string (1-5 items) | Package ids or Play Store URLs. |
| country | no | string (ISO alpha-2) |  |
| language | no | string (BCP-47) |  |
| sort | no | enum |  Values: newest, rating_high, helpful. |
| limit | no | integer (1-100) |  |

Response fields (each row of data; every field present, null when the source had nothing):

| Field | Type |
|---|---|
| reviewId | string |
| reviewUrl | string |
| reviewer | string |
| reviewerPhoto | string |
| rating | number |
| reviewText | string |
| posted | string |
| appVersion | string |
| helpfulVotes | integer |
| developerReply | string |
| replyDate | string |
| subratings | any |
| details | object |

`details` is always the last field: everything else the source sent for that row, under our own field names. Its keys depend on the source that answered, so read them defensively; it is `{}` when there is nothing more.

Example request:

```bash
curl -X POST https://apiforagents.dev/v1/google \
  -H "Authorization: Bearer $AFA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"op":"playReviews","subjects":["com.spotify.music"],"country":"US","language":"en","sort":"newest","limit":50}'
```

Example response rows (made-up names, real field names; a live row carries every field above):

```json
[
  {
    "reviewer": "Ravi K.",
    "rating": 5,
    "reviewText": "Fast and simple. Exactly what I needed.",
    "appVersion": "4.12.0",
    "helpfulVotes": 38,
    "posted": "2026-10-14",
    "developerReply": "Thanks Ravi!",
    "reviewId": "4228410525",
    "reviewUrl": "https://www.google.com/ravi-k-1000",
    "replyDate": "2026-10-02",
    "details": {}
  },
  {
    "reviewer": "Lena M.",
    "rating": 2,
    "reviewText": "Keeps logging me out after the update.",
    "appVersion": "4.12.0",
    "helpfulVotes": 104,
    "posted": "2026-10-13",
    "developerReply": "Sorry! A fix ships in 4.12.1.",
    "reviewId": "2870120323",
    "reviewUrl": "https://www.google.com/lena-m-1001",
    "replyDate": "2026-10-07",
    "details": {}
  }
]
```

Try it in the playground: https://apiforagents.dev/dashboard/run?platform=google&op=playReviews (sign in first).

## Notes for the agent

Measured Google data, one operation per call. Five surfaces. ops: search (web results for a query: link, title, snippet, domain, rank, related questions and searches; supports site:, intitle:, OR; country/language/site/since/until filters; billed per page of ~10), news (Google News articles: headline, publisher, date, link; postedWithin, country and language), images (Google Images: URL, source page, dimensions), shopping (Shopping offers: title, merchant, price, rating, review count; country, language, postedWithin), playReviews (Play Store reviews for up to five apps by package id or URL. Text, rating, date, app version, developer reply, sub-ratings; country, language, sort). Ops are independent. Issue several as PARALLEL tool calls. Fresh fetches are charged per record; your own answer is free while fresh.
