> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Search and AI answers

> Search Google, Google News, Images, Videos, Scholar and Patents, ask Google AI Mode a question, and read what people search for. Get results and cited sources as JSON.

Search Google, Google News, Images, Videos, Scholar and Patents, ask Google AI Mode a question, and read what people search for. Get results and cited sources as JSON. See every field in the [Search and AI answers reference](/api-reference/endpoint/google-search), or try it in the [playground](https://stophy.dev/playground).

## Search Google and get results, the AI Overview, the knowledge panel and related questions

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.google.search({ query: "best project management software" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.google.search(query="best project management software")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/google/search \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"query":"best project management software"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy google search "best project management software"
  ```
</CodeGroup>

The response:

```json theme={null}
{
  "success": true,
  "data": {
    "results": [
      {
        "url": "https://bun.com/",
        "title": "Bun — A fast all-in-one JavaScript runtime",
        "description": "Bun is a fast JavaScript runtime & toolkit. All in one. Runtime, package manager, test runner and bundler in a single binary. Use bun install or bun test in an ...",
        "position": 1
      },
      {
        "url": "https://github.com/oven-sh/bun",
        "title": "oven-sh/bun: Incredibly fast JavaScript runtime, bundler ...",
        "description": "At its core is the Bun runtime, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It's written in Rust and powered by JavaScriptCore ...",
        "position": 2
      }
    ]
  },
  "creditsUsed": 0,
  "requestId": "44eea069-e571-4dd8-95b4-cd56e641701a"
}
```

## Endpoints

| Endpoint | Cost |
| - | - |
| [Search Google and get results, the AI Overview, the knowledge panel and related questions](/api-reference/endpoint/google-search) | 1 credit (no key needed) |
| [Search Google News by keyword, date, site and country, or read headlines by topic](/api-reference/endpoint/google-news) | 1 credit (no key needed) |
| [Search Google Images and get each full-size image with the page it comes from](/api-reference/endpoint/google-images) | From 1 credit |
| [Search Google's Videos tab for videos from every site, with duration and channel](/api-reference/endpoint/google-videos) | 1 credit |
| [Search Google Scholar for papers, books and case law, with citations](/api-reference/endpoint/google-scholar) | 1 credit |
| [Search Google Patents by words, inventor, assignee, office, dates and status](/api-reference/endpoint/google-patents) | 1 credit |
| [Ask Google AI Mode a question and get its answer with the sources it cites](/api-reference/endpoint/google-aiMode) | 2 credits |
| [Get Google search suggestions for a keyword](/api-reference/endpoint/google-suggest) | 1 credit |
| [Get related searches for a keyword](/api-reference/endpoint/google-trends-related) | 1 credit |
| [Get what is trending on Google now](/api-reference/endpoint/google-trends-trending) | 1 credit |
| [Get Google Trends search interest over time, newest first, with one value per query](/api-reference/endpoint/google-trends-interest) | 1 credit |
| [Get Google Trends search interest by region](/api-reference/endpoint/google-trends-regions) | 1 credit |

## More ways to call it

### Search Google News by keyword, date, site and country, or read headlines by topic

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.google.news({ query: "nvidia" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.google.news(query="nvidia")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/google/news \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"query":"nvidia"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy google news nvidia
  ```
</CodeGroup>

### Search Google Scholar for papers, books and case law, with citations

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.google.scholar({ query: "malaria vaccine efficacy" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.google.scholar(query="malaria vaccine efficacy")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/google/scholar \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"query":"malaria vaccine efficacy"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy google scholar "malaria vaccine efficacy"
  ```
</CodeGroup>

<Tip>Google search and Google News work without a key, with no paging. Google AI Mode costs 2 credits, Google Images costs 1 credit per 10 images, and every other endpoint costs 1 credit.</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.