# Example Requests

### Basic Google News Search

In this example, we send a simple Google News request searching for articles about AI.

The request specifies:

* search query (`q`)
* language and country targeting (`hl`, `gl`)

**Request**

```bash
curl -X GET "https://serp-api.netnut.io/search?engine=google_news&q=ai&hl=en&gl=us" \
  -U "username:password"
```

**Example Response**

Example shape — your actual `jobId`, timestamps, and article data will vary.

```json
{
  "url": "https://www.google.com/search?gl=US&hl=en&q=ai&tbm=nws",
  "general": {
    "searchEngine": "google_news",
    "resultsCount": 13600000,
    "searchTime": 0.76,
    "language": "en",
    "device": "desktop",
    "searchType": "text",
    "pageTitle": "ai - Google Search",
    "timestamp": "2026-04-19T14:13:12.868546494Z",
    "render": false
  },
  "input": {
    "originalUrl": "https://www.google.com/search?gl=US&hl=en&q=ai&tbm=nws",
    "jobId": "36344139-9f78-44f3-8d0c-f0d9f7e2d8ea"
  },
  "newsResults": [
    {
      "title": "Should you really trust health advice from an AI chatbot?",
      "source": "BBC",
      "timeSince": "15 hours ago",
      "link": "https://www.bbc.com/news/articles/clyepyy82kxo",
      "image": "data:image/jpeg;base64,...",
      "description": "So should we trust the likes of ChatGPT, Gemini and Grok? Is using them any different to an old-fashioned internet search?",
      "rank": 1
    },
    {
      "title": "There's an 'art' to writing AI prompts for personal finance, MIT professor says",
      "source": "CNBC",
      "timeSince": "24 hours ago",
      "link": "https://www.cnbc.com/2026/04/18/ai-prompts-personal-finance-advice.html",
      "image": "data:image/jpeg;base64,...",
      "description": "Many people are turning to artificial intelligence for personal finance advice.",
      "rank": 2
    }
  ],
  "pagination": {
    "nextPageLink": "https://www.google.com/search?q=ai&tbm=nws&start=10",
    "nextPageStart": 10,
    "currentPage": 1,
    "nextPage": 2,
    "otherPages": {
      "2": "https://www.google.com/search?q=ai&tbm=nws&start=10",
      "3": "https://www.google.com/search?q=ai&tbm=nws&start=20"
    }
  },
  "pagesProcessed": 1
}
```

In this response:

* `url` is the final Google News search URL used to retrieve the results.
* `general` contains metadata about the request, such as language, device, page title, and timestamp.
* `input` contains the original request URL and the internal `jobId`.
* `newsResults` contains the parsed news article results.
* each article object includes fields such as `title`, `source`, `timeSince`, `link`, `image`, `description`, and `rank`.

***

### Paginated Request

In this example, we retrieve the second page of results by setting `start=10`.

This is useful for collecting more than the default 10 results returned per page.

**Request**

```bash
curl -X GET "https://serp-api.netnut.io/search?engine=google_news&q=ai&hl=en&gl=us&start=10" \
  -U "username:password"
```

**Example Response**

Example shape — shortened for readability.

```json
{
  "url": "https://www.google.com/search?gl=US&hl=en&q=ai&tbm=nws&start=10",
  "general": {
    "searchEngine": "google_news",
    "resultsCount": 13600000,
    "searchTime": 0.61,
    "language": "en",
    "device": "desktop",
    "searchType": "text",
    "pageTitle": "ai - Google Search",
    "timestamp": "2026-04-19T14:15:00.123456789Z",
    "render": false
  },
  "input": {
    "originalUrl": "https://www.google.com/search?gl=US&hl=en&q=ai&tbm=nws&start=10",
    "jobId": "a1b2c3d4-0000-4444-8888-111122223333"
  },
  "newsResults": [
    {
      "title": "AI sets sights on touchy new frontier: Taste",
      "source": "Axios",
      "timeSince": "2 hours ago",
      "link": "https://www.axios.com/2026/04/19/ai-taste-anthropic-claude-opus",
      "image": "data:image/jpeg;base64,...",
      "description": "AI makers say the newest models are smart, funny, empathetic, self-reflective and now also tasteful.",
      "rank": 1
    }
  ],
  "pagination": {
    "prevPageLink": "https://www.google.com/search?q=ai&tbm=nws&start=0",
    "nextPageLink": "https://www.google.com/search?q=ai&tbm=nws&start=20",
    "prevPageStart": 0,
    "nextPageStart": 20,
    "prevPage": 1,
    "currentPage": 2,
    "nextPage": 3,
    "otherPages": {
      "1": "https://www.google.com/search?q=ai&tbm=nws&start=0",
      "3": "https://www.google.com/search?q=ai&tbm=nws&start=20"
    }
  },
  "pagesProcessed": 1
}
```

In this response:

* `start=10` retrieves the second page of results.
* `pagination` now includes both `prevPageLink` and `nextPageLink` since the response is not on the first page.

***

### Request with rawHtml=1

In this example, we request the normal parsed JSON response and the raw HTML returned from Google News.

This mode is useful when you want the structured article data while also keeping access to the original page source for debugging, validation, or custom parsing.

**Request**

```bash
curl -X GET "https://serp-api.netnut.io/search?engine=google_news&q=ai&hl=en&gl=us&rawHtml=1" \
  -U "username:password"
```

**Example Response**

Example shape — shortened for readability. Your actual response may include more article results and a much longer HTML string.

```json
{
  "url": "https://www.google.com/search?gl=US&hl=en&q=ai&tbm=nws",
  "general": {
    "searchEngine": "google_news",
    "resultsCount": 13600000,
    "searchTime": 0.76,
    "language": "en",
    "device": "desktop",
    "searchType": "text",
    "pageTitle": "ai - Google Search",
    "timestamp": "2026-04-19T14:13:12.868546494Z",
    "render": false
  },
  "input": {
    "originalUrl": "https://www.google.com/search?gl=US&hl=en&q=ai&tbm=nws",
    "jobId": "36344139-9f78-44f3-8d0c-f0d9f7e2d8ea"
  },
  "newsResults": [
    {
      "title": "Should you really trust health advice from an AI chatbot?",
      "source": "BBC",
      "timeSince": "15 hours ago",
      "link": "https://www.bbc.com/news/articles/clyepyy82kxo",
      "image": "data:image/jpeg;base64,...",
      "description": "So should we trust the likes of ChatGPT, Gemini and Grok?",
      "rank": 1
    }
  ],
  "pagination": {
    "nextPageLink": "https://www.google.com/search?q=ai&tbm=nws&start=10",
    "nextPageStart": 10,
    "currentPage": 1,
    "nextPage": 2
  },
  "pagesProcessed": 1,
  "html": "<!doctype html><html lang/>..."
}
```

In this response, the response includes the regular parsed JSON fields:

* `url`
* `general`
* `input`
* `newsResults`
* `pagination`

In addition, it includes:

* `html` — the raw HTML source of the Google News results page

This mode is useful for:

* validating parsed results against the original source
* storing both parsed data and page source
* custom downstream extraction workflows

***

### Request with rawHtml=2

In this example, we request only the raw HTML of the Google News results page.

This mode is useful when you do not need the parsed JSON response and only want the page source.

**Request**

```bash
curl -X GET "https://serp-api.netnut.io/search?engine=google_news&q=ai&hl=en&gl=us&rawHtml=2" \
  -U "username:password"
```

**Example Response**

```
<!doctype html><html lang/>...
```

In this response:

* the API returns only the raw HTML.
* no parsed JSON fields such as `general`, `input`, or `newsResults` are returned.

This mode is useful for:

* custom parsers
* raw source collection
* debugging page output without parsed normalization


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/google-scraper/google-news/example-requests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
