# Serper

> Run Google searches from a workflow and get the results as data: web results, images, news, videos, places, shopping, Scholar papers, and search suggestions.

App · Web Search · 8 actions. Web page: https://docs.lodol.com/docs/integrations/serper

## Actions

### Get search suggestions

Get the search suggestions Google would offer for a partial query, the way its search box does. Useful for keyword research and for expanding a topic into the phrasing people actually search for.

**Inputs**

- Search query (`query`, text, required): The partial query to get suggestions for, such as 'best coffee grinder for'.
- Country (`country`, text): Search as if from this country, as a two-letter country code. Defaults to the United States.
- Language (`language`, text): Return results in this language, as a two-letter language code. Defaults to English.

**Outputs**

- `credits_used` (number): How many Serper credits this search spent.
- `suggestion_count` (number): How many suggestions were returned.
- `suggestions` (list): The suggested searches, most likely first.

**Example output**

```json
{
  "credits_used": 1,
  "suggestion_count": 2,
  "suggestions": [
    "best coffee grinder for espresso",
    "best coffee grinder for french press"
  ]
}
```

### Search Google

Run a Google search and get the organic results back as data, along with the knowledge panel, answer box, 'People also ask' questions, and related searches when Google shows them.

**Inputs**

- Search query (`query`, text, required): What to search for. Google's own operators work here, such as site:example.com or "an exact phrase".
- Number of results (`num_results`, number): How many results to ask for, from 1 to 100. Defaults to 10. Google returns results in pages of ten, so the count you get back can be a little under what you ask for. From 1 to 100. Default: `10`.
- Page (`page`, number): Which page of results to return. 1 (the default) is the first page. At least 1. Default: `1`.
- Country (`country`, text): Search as if from this country, as a two-letter country code. Defaults to the United States.
- Language (`language`, text): Return results in this language, as a two-letter language code. Defaults to English.
- Location (`location`, text): Search from a specific place, which changes the local results Google shows. Write it the way Google does, most specific part first.
- Published within (`date_range`, text): Only return results published recently. Leave blank for any time. One of: `qdr:h` (Past hour), `qdr:d` (Past 24 hours), `qdr:w` (Past week), `qdr:m` (Past month), `qdr:y` (Past year).
- Correct spelling (`autocorrect`, true/false): Let Google fix an apparent typo in the query. Turn this off when the query is a product code, a surname, or anything else Google would 'correct' into the wrong thing. Default: `true`.

**Outputs**

- `answer_box` (object): The direct answer Google showed above the results, or null if there was none.
- `credits_used` (number): How many Serper credits this search spent.
- `knowledge_graph` (object): The knowledge panel Google showed beside the results, or null if there was none.
- `people_also_ask` (list): The 'People also ask' questions and their snippets.
- `related_searches` (list): Related searches Google suggested.
- `result_count` (number): How many organic results were returned.
- `results` (list): The organic results, each with its position, title, link, snippet, date, and sitelinks.

**Example output**

```json
{
  "answer_box": null,
  "credits_used": 1,
  "knowledge_graph": {
    "attributes": null,
    "description": "Coffee is a beverage brewed from roasted coffee beans.",
    "description_link": "https://en.wikipedia.org/wiki/Coffee",
    "description_source": "Wikipedia",
    "image_url": null,
    "title": "Coffee",
    "type": "Beverage",
    "website": null
  },
  "people_also_ask": [
    {
      "link": "https://example.com/coffee-health",
      "question": "Is coffee good for you?",
      "snippet": "In moderation, coffee is fine for most adults.",
      "title": "Coffee and health"
    }
  ],
  "related_searches": [
    "coffee beans",
    "types of coffee"
  ],
  "result_count": 1,
  "results": [
    {
      "attributes": null,
      "date": null,
      "link": "https://en.wikipedia.org/wiki/Coffee",
      "position": 1,
      "sitelinks": [],
      "snippet": "Coffee is a beverage brewed from roasted coffee beans.",
      "title": "Coffee - Wikipedia"
    }
  ]
}
```

### Search Google Images

Search Google Images and get each picture's full-size and thumbnail address, its dimensions, and the page it came from.

**Inputs**

- Search query (`query`, text, required): What kind of image to search for.
- Number of results (`num_results`, number): How many results to ask for, from 1 to 100. Defaults to 10. Google returns results in pages of ten, so the count you get back can be a little under what you ask for. From 1 to 100. Default: `10`.
- Page (`page`, number): Which page of results to return. 1 (the default) is the first page. At least 1. Default: `1`.
- Country (`country`, text): Search as if from this country, as a two-letter country code. Defaults to the United States.
- Language (`language`, text): Return results in this language, as a two-letter language code. Defaults to English.
- Location (`location`, text): Search from a specific place, which changes the local results Google shows. Write it the way Google does, most specific part first.
- Published within (`date_range`, text): Only return results published recently. Leave blank for any time. One of: `qdr:h` (Past hour), `qdr:d` (Past 24 hours), `qdr:w` (Past week), `qdr:m` (Past month), `qdr:y` (Past year).

**Outputs**

- `credits_used` (number): How many Serper credits this search spent.
- `image_count` (number): How many images were returned.
- `images` (list): The images, each with its title, full-size and thumbnail address, size, source, and page link.

**Example output**

```json
{
  "credits_used": 1,
  "image_count": 1,
  "images": [
    {
      "image_height": 1080,
      "image_url": "https://example.com/coffee.jpg",
      "image_width": 1920,
      "link": "https://example.com/coffee",
      "position": 1,
      "source": "Example",
      "thumbnail_url": "https://example.com/coffee-thumb.jpg",
      "title": "A cup of coffee"
    }
  ]
}
```

### Search Google Maps places

Find local businesses and places on Google Maps, with their address, category, phone number, website, rating, and coordinates.

**Inputs**

- Search query (`query`, text, required): What kind of place to look for, such as 'coffee shop' or 'emergency dentist'.
- Number of results (`num_results`, number): How many results to ask for, from 1 to 100. Defaults to 10. Google returns results in pages of ten, so the count you get back can be a little under what you ask for. From 1 to 100. Default: `10`.
- Page (`page`, number): Which page of results to return. 1 (the default) is the first page. At least 1. Default: `1`.
- Country (`country`, text): Search as if from this country, as a two-letter country code. Defaults to the United States.
- Language (`language`, text): Return results in this language, as a two-letter language code. Defaults to English.
- Location (`location`, text): Search from a specific place, which changes the local results Google shows. Write it the way Google does, most specific part first.

**Outputs**

- `credits_used` (number): How many Serper credits this search spent.
- `place_count` (number): How many places were returned.
- `places` (list): The places, each with its title, address, category, phone number, website, rating, review count, and coordinates.

**Example output**

```json
{
  "credits_used": 1,
  "place_count": 1,
  "places": [
    {
      "address": "401 Congress Ave #100c, Austin, TX 78701",
      "category": "Coffee shop",
      "cid": "11265938073076301333",
      "latitude": 30.266216,
      "longitude": -97.743065,
      "phone_number": "+1 512-394-6051",
      "position": 1,
      "rating": 4.5,
      "rating_count": 1200,
      "title": "Houndstooth Coffee",
      "website": "https://example.com"
    }
  ]
}
```

### Search Google News

Search Google News and get the matching articles with their headline, publisher, publication date, and link.

**Inputs**

- Search query (`query`, text, required): What to look for in the news.
- Number of results (`num_results`, number): How many results to ask for, from 1 to 100. Defaults to 10. Google returns results in pages of ten, so the count you get back can be a little under what you ask for. From 1 to 100. Default: `10`.
- Page (`page`, number): Which page of results to return. 1 (the default) is the first page. At least 1. Default: `1`.
- Country (`country`, text): Search as if from this country, as a two-letter country code. Defaults to the United States.
- Language (`language`, text): Return results in this language, as a two-letter language code. Defaults to English.
- Location (`location`, text): Search from a specific place, which changes the local results Google shows. Write it the way Google does, most specific part first.
- Published within (`date_range`, text): Only return results published recently. Leave blank for any time. One of: `qdr:h` (Past hour), `qdr:d` (Past 24 hours), `qdr:w` (Past week), `qdr:m` (Past month), `qdr:y` (Past year).

**Outputs**

- `article_count` (number): How many articles were returned.
- `articles` (list): The news articles, each with its title, link, snippet, date, source, and image.
- `credits_used` (number): How many Serper credits this search spent.

**Example output**

```json
{
  "article_count": 1,
  "articles": [
    {
      "date": "2 hours ago",
      "image_url": "https://example.com/coffee-news.jpg",
      "link": "https://example.com/coffee-prices",
      "position": 1,
      "snippet": "Arabica futures climbed again this week.",
      "source": "Example News",
      "title": "Coffee prices hit a record high"
    }
  ],
  "credits_used": 1
}
```

### Search Google Scholar

Search academic literature on Google Scholar and get each paper's publication details, citation count, and PDF link where one is available.

**Inputs**

- Search query (`query`, text, required): The topic, paper title, or author to search for.
- Number of results (`num_results`, number): How many results to ask for, from 1 to 100. Defaults to 10. Google returns results in pages of ten, so the count you get back can be a little under what you ask for. From 1 to 100. Default: `10`.
- Page (`page`, number): Which page of results to return. 1 (the default) is the first page. At least 1. Default: `1`.
- Country (`country`, text): Search as if from this country, as a two-letter country code. Defaults to the United States.
- Language (`language`, text): Return results in this language, as a two-letter language code. Defaults to English.

**Outputs**

- `article_count` (number): How many papers were returned.
- `articles` (list): The papers, each with its title, link, snippet, publication details, year, citation count, and PDF link.
- `credits_used` (number): How many Serper credits this search spent.

**Example output**

```json
{
  "article_count": 1,
  "articles": [
    {
      "cited_by": 412,
      "id": "paper-123",
      "link": "https://example.com/paper",
      "pdf_url": "https://example.com/paper.pdf",
      "position": 1,
      "publication_info": "A Researcher, B Researcher - Journal of Examples, 2019",
      "snippet": "We review 42 randomized trials of caffeine.",
      "title": "The effects of caffeine on alertness",
      "year": 2019
    }
  ],
  "credits_used": 1
}
```

### Search Google Shopping

Search Google Shopping and get the matching products with their price, seller, delivery terms, and rating.

**Inputs**

- Search query (`query`, text, required): The product to search for.
- Number of results (`num_results`, number): How many results to ask for, from 1 to 100. Defaults to 10. Google returns results in pages of ten, so the count you get back can be a little under what you ask for. From 1 to 100. Default: `10`.
- Page (`page`, number): Which page of results to return. 1 (the default) is the first page. At least 1. Default: `1`.
- Country (`country`, text): Search as if from this country, as a two-letter country code. Defaults to the United States.
- Language (`language`, text): Return results in this language, as a two-letter language code. Defaults to English.
- Location (`location`, text): Search from a specific place, which changes the local results Google shows. Write it the way Google does, most specific part first.

**Outputs**

- `credits_used` (number): How many Serper credits this search spent.
- `product_count` (number): How many products were returned.
- `products` (list): The products, each with its title, link, seller, price, delivery, image, and rating.

**Example output**

```json
{
  "credits_used": 1,
  "product_count": 1,
  "products": [
    {
      "delivery": "Free delivery",
      "image_url": "https://example.com/product.jpg",
      "link": "https://example.com/product",
      "offers": "12 offers",
      "position": 1,
      "price": "$13.86",
      "product_id": "1234567890",
      "rating": 4.6,
      "rating_count": 16000,
      "source": "Example Store",
      "title": "Folgers Classic Roast Ground Coffee"
    }
  ]
}
```

### Search Google Videos

Search Google Videos and get the matching videos with their title, channel, length, and link.

**Inputs**

- Search query (`query`, text, required): What kind of video to search for.
- Number of results (`num_results`, number): How many results to ask for, from 1 to 100. Defaults to 10. Google returns results in pages of ten, so the count you get back can be a little under what you ask for. From 1 to 100. Default: `10`.
- Page (`page`, number): Which page of results to return. 1 (the default) is the first page. At least 1. Default: `1`.
- Country (`country`, text): Search as if from this country, as a two-letter country code. Defaults to the United States.
- Language (`language`, text): Return results in this language, as a two-letter language code. Defaults to English.
- Published within (`date_range`, text): Only return results published recently. Leave blank for any time. One of: `qdr:h` (Past hour), `qdr:d` (Past 24 hours), `qdr:w` (Past week), `qdr:m` (Past month), `qdr:y` (Past year).

**Outputs**

- `credits_used` (number): How many Serper credits this search spent.
- `video_count` (number): How many videos were returned.
- `videos` (list): The videos, each with its title, link, snippet, thumbnail, duration, source, channel, and date.

**Example output**

```json
{
  "credits_used": 1,
  "video_count": 1,
  "videos": [
    {
      "channel": "Example Channel",
      "date": "1 week ago",
      "duration": "8:12",
      "image_url": "https://example.com/video-thumb.jpg",
      "link": "https://example.com/watch",
      "position": 1,
      "snippet": "A short guide to grind size and water temperature.",
      "source": "Example Video",
      "title": "How to brew better coffee"
    }
  ]
}
```
