# Google News API

> Search Google News by keyword, topic or publication and get headlines with source, date, thumbnail and story clusters, localized by country and language.

Source: https://www.sandbase.ai/apis/google/news
API reference: https://www.sandbase.ai/apis/google/news#api

## Facts

- Provider: Google
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/google/news`
- Price: $0.01 per call
- Capabilities: api, google, news, serp
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/google/news` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `q` | string | no |  |
| `gl` | string | no |  |
| `hl` | string | no |  |
| `topic_token` | string | no |  |
| `kgmid` | string | no |  |
| `publication_token` | string | no |  |
| `section_token` | string | no |  |
| `story_token` | string | no |  |
| `so` | string | no |  |
| `json_restrictor` | string | no |  |

## FAQ

### How do I use the Google News API?

Send a POST request to https://api.sandbase.ai/v1/api/google/news with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Google News API cost?

$0.01 per call, billed from your SandBase balance. You are only charged for calls you make; there is no subscription.

### What parameters does the Google News API accept?

No parameters are required. Optional: q (string), gl (string), hl (string), topic_token (string), kgmid (string) and publication_token (string) and 4 more. The Parameters table and the Playground on this page list every field.

### What does the Google News API return?

A JSON response returned in the same HTTP request (synchronous).

### Do I need a Google developer account or API key?

No. Google News runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Google API access separately.

## README

### Google News

Search Google News by keyword, topic or publication and get headlines with source, date, thumbnail and story clusters, localized by country and language.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/google/news" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "artificial intelligence"}'
```

The result is returned in `outputs[0].data` as structured JSON.

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `q` | string | No | Parameter defines the query you want to search. You can use anything that you would use in a regular Google News search. e.g. `site:`, `when:`. Parameter can't be used together with any of the `Advanced parameters`. |
| `gl` | string | No | Parameter defines the country to use for the Google News search. It's a two-letter country code. (e.g., `us` for the United States (default), `uk` for United Kingdom, or `fr` for France). Head to the Google countries page for a full list of |
| `hl` | string | No | Parameter defines the language to use for the Google News search. It's a two or three-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French), optionally followed by a two-letter or three-digit region code (e.g. |
| `topic_token` | string | No | Parameter defines the Google News topic token. It is used for accessing the news results for a specific topic (e.g., "World", "Business", "Technology"). The token can be found in our JSON response or the URL of the Google News page (in the  |
| `kgmid` | string | No | Parameter defines the Knowledge Graph ID (`KGMID`) of a topic or location for Google News results. It is a string that starts with `/m/` or `/g/`. You can look up entities on Wikidata and use their "Freebase ID" as the kgmid. For example, ` |
| `publication_token` | string | No | Parameter defines the Google News publication token. It is used for accessing the news results from a specific publisher (e.g., "CNN", "BBC", "The Guardian"). The token can be found in our JSON response or the URL of the Google News page (i |
| `section_token` | string | No | Parameter defines the Google News section token. It is used for accessing the sub-section of a specific topic. (e.g., "Business -> Economy"). The token can be found in our JSON response or the URL of the Google News page (in the URL, it is  |
| `story_token` | string | No | Parameter defines the Google News story token. It is used for accessing the news results with full coverage of a specific story. The token can be found in our JSON response or the URL of the Google News page (in the URL, it is a string of c |
| `so` | string | No | Parameter defines the sorting method. Results can be sorted by relevance or by date. By default, the results are sorted by relevance. List of supported values are: `0` - Relevance `1` - Date Parameter can be used together with `story_token` |
| `json_restrictor` | string | No | Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details. |

#### Pricing

$0.010 per successful call. Failed calls are not charged.
