---
title: "Google People Also Ask API: Related Questions as JSON"
description: "Get Google's People Also Ask questions as JSON from a search or the related-questions endpoint, page with next_page_token, and cost a question tree in credits."
url: https://perceptlayer.com/blog/google-people-also-ask-api
---

[Blog](https://perceptlayer.com/blog) / [API guides](https://perceptlayer.com/blog/category/api-guides)

# Google People Also Ask API: Related Questions as JSON

22 Sept 2026 Perceptlayer 6 min read

Google has no API for People Also Ask. You can get them as JSON two ways: every `GET /v1/google-search/search` response includes a `related_questions` array, and `GET /v1/google-related-questions/related-questions` returns only the questions for a query `q`. Both cost 1 credit per successful call. Each question carries a `next_page_token` you pass back to fetch more.

## Key takeaways

-   A Google search for `best restaurants in Berlin` returned three People Also Ask questions in `related_questions`, next to the organic results, for the same 1 credit.
-   The related-questions endpoint takes `q` (up to 2,048 characters), `hl`, `gl` and `next_page_token`, and returns `query` plus `related_questions`.
-   In both recorded responses, all three questions carry the same `next_page_token`, so the token continues the query's question list. It doesn't open one question.
-   To go deeper on one question, send it as a new `q`. A two-level tree with three questions per level is 1 + 3 = 4 calls, 4 credits, per seed keyword.
-   Failed calls cost nothing, and the 1,000 free monthly credits cover 250 seed keywords at that depth.

## Is there an official People Also Ask API?

No. Google doesn't offer an API for the People Also Ask box. Its general web search API is the Custom Search JSON API, and Google's own overview of it now says it is closed to new customers and that existing customers have until January 1, 2027 to move to an alternative ( [Google for Developers](https://developers.google.com/custom-search/v1/overview), 2026). For searching up to 50 domains, Google points to Vertex AI Search; for full web search it asks you to contact it.

So People Also Ask data comes from the results page itself. The [Google Related Questions API](https://perceptlayer.com/apis/google-related-questions) returns the questions alone, and the [Google Search API](https://perceptlayer.com/apis/google-search) returns them with the rest of the page. Data is collected from publicly available sources and returned as found at the time of the call, and the questions change by query, language, country and day.

## Where do related questions appear in a search response?

In the `related_questions` array of every `GET /v1/google-search/search` response that has a People Also Ask box. It sits next to `organic_results`, `related_searches` and `people_also_search_for`, so if you already run searches for rank tracking, you have the questions at no extra cost. This is the request behind the recorded response:

```bash
curl "https://api.perceptlayer.com/v1/google-search/search?query=best+restaurants+in+Berlin&hl=en&safe=off" \
  -H "X-API-Key: $API_KEY"
```

And the part of the response that matters here, trimmed with `…`:

```json
{
  "search_information": {
    "query_displayed": "best restaurants in Berlin",
    "organic_results_count": 6
  },
  "organic_results": […],
  "related_searches": [
    { "query": "Best restaurants in Berlin for tourists", … },
    { "query": "Best affordable restaurants in Berlin", … }
  ],
  "related_questions": [
    {
      "question": "What is the coolest restaurant in Berlin?",
      "next_page_token": "fc=EqEBCmJBSmlUNHRMWjV0cUtnRWF3THBmd2poWERESG9Zd1NDdjV1eVBaTnlyQUpwWHptbXpvWEl3cEcteUc4clBmTmM2RmVqZ3gxeFBSR2Q2YnhWUXRYTV9fbU9TZ25Oa3RSM2JJQRIXZlBEYWFyWDFHc1RtN…"
    },
    {
      "question": "What is famous to eat in Berlin?",
      "next_page_token": "fc=EqEBCmJBSmlUNHRMWjV0cUtnRWF3THBmd2poWERESG9Zd1NDdjV1eVBaTnlyQUpwWHptbXpvWEl3cEcteUc4clBmTmM2RmVqZ3gxeFBSR2Q2YnhWUXRYTV9fbU9TZ25Oa3RSM2JJQRIXZlBEYWFyWDFHc1RtN…"
    },
    …
  ],
  …
}
```

The third question in the recording is "Where is the best place to eat in Berlin?". Note what's absent: the response holds the questions, not the answers Google shows when you expand one. Google's documentation says featured snippets can appear inside a related questions group, also known as People Also Ask ( [Google Search Central](https://developers.google.com/search/docs/appearance/featured-snippets), 2026). If you need answer text and sources for a question, search the question itself and read its results.

## How do you call the related-questions endpoint?

Send the query as `q` to `GET /v1/google-related-questions/related-questions`, with `hl` for language and `gl` for country. The response is small: the `query` and its `related_questions`, each with `question` and `next_page_token`. Use it when you want only the questions and not a full results page. This is the request behind the second recording:

```bash
curl "https://api.perceptlayer.com/v1/google-related-questions/related-questions?q=how+does+espresso+work&hl=en&gl=us" \
  -H "X-API-Key: $API_KEY"
```

```json
{
  "query": "how does espresso work",
  "related_questions": [
    {
      "question": "Is espresso stronger than regular coffee?",
      "next_page_token": "fc=EqEBCmJBSmlUNHRKd1EwVllFZ2xFZ3loS2xCYmtYVEszbTQ2NEVzcDZvbExoOUltSDNaYkhpdEp5T1EyN3J0Z1pnMVA0STF3YUZ0ODV3LVQxRlBERkZTWFlpRVhSTmJLd2x1YWhvZxIXVHNuYmFxN3JIZGZoN…"
    },
    { "question": "Do you sip or chug an espresso?", "next_page_token": "fc=EqEBCmJBSmlUNHRKd1EwVll…" },
    { "question": "Is an espresso 1 or 2 shots?", "next_page_token": "fc=EqEBCmJBSmlUNHRKd1EwVll…" }
  ]
}
```

All four parameters are optional in the endpoint definition, but you need either `q` or a `next_page_token` for the call to mean anything. Keys go in the `X-API-Key` header; [get a free API key](https://perceptlayer.com/signup) and see the [authentication docs](https://docs.perceptlayer.com/authentication).

| Parameter | Type | Notes |
| --- | --- | --- |
| `q` | string | The query, up to 2,048 characters |
| `next_page_token` | string | From a previous response, up to 8,192 characters |
| `hl` | string | Language, 2 characters, such as `en` |
| `gl` | string | Country, 2 characters, such as `us` |

## What does next\_page\_token actually do?

It continues the question list for the query you asked, not for one question. In both recorded responses, the Berlin search and the espresso call, every question carries an identical `next_page_token`. A token that's the same for all three questions can't point at one of them, so treat it as a page cursor: pass it back to the related-questions endpoint to ask for the next batch of questions for the same query.

```bash
curl -G "https://api.perceptlayer.com/v1/google-related-questions/related-questions" \
  --data-urlencode "next_page_token=$TOKEN" \
  -d hl=en -d gl=us \
  -H "X-API-Key: $API_KEY"
```

Tokens run up to 8,192 characters and contain characters such as `=`, so URL-encode them, as `--data-urlencode` does here. We haven't recorded a token follow-up, so check what comes back in the playground on the [related-questions endpoint page](https://perceptlayer.com/apis/google-related-questions/related-questions) before you build a loop that depends on its shape.

To go deeper on a particular question, which is what most keyword research needs, send that question as a new `q`. Its own related questions are the next level of the tree.

## How do you build a question tree for a keyword?

Start from a seed keyword, collect its questions, then call the endpoint again with each question as `q`, down to a fixed depth. Keep a set of questions you've already seen, because related questions repeat across branches, and a credit cap so the tree can't grow past your budget. This script does a breadth-first walk and stops at either limit:

```python
import os
import requests

URL = "https://api.perceptlayer.com/v1/google-related-questions/related-questions"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}

def question_tree(seed, max_depth=2, max_calls=20):
    seen, edges, calls = {seed.lower()}, [], 0
    level = [seed]
    for depth in range(max_depth):
        next_level = []
        for q in level:
            if calls >= max_calls:
                return edges, calls
            r = requests.get(URL, params={"q": q, "hl": "en", "gl": "us"},
                             headers=HEADERS, timeout=60)
            if r.status_code != 200:
                print("skip", q, r.json()["error"]["code"])
                continue
            calls += int(r.headers.get("X-Credits-Used", "0"))
            for item in r.json().get("related_questions", []):
                text = item["question"]
                if text.lower() not in seen:
                    seen.add(text.lower())
                    edges.append((q, text, depth + 1))
                    next_level.append(text)
        level = next_level
    return edges, calls

edges, credits = question_tree("how does espresso work")
for parent, child, depth in edges:
    print(depth, child, "<-", parent)
print("credits used:", credits)
```

We haven't run this script live for this article. The counter adds `X-Credits-Used` from each response, so a failed call adds 0 and the total matches what your balance shows. The [credits docs](https://docs.perceptlayer.com/credits) explain that header and `X-Credits-Remaining`.

## What does it cost per keyword?

Each successful call to either endpoint is 1 credit, so the cost is the number of calls. If you already search the keyword for rankings, its first level of questions is free. Otherwise it's 1 call. Each question you expand is one more call. With three questions per response, as in both recordings:

| Depth | Calls | Credits per seed | 200 seeds |
| --- | --- | --- | --- |
| Level 1 only | 1 | 1 | 200 |
| Level 1, then expand its 3 questions | 1 + 3 = 4 | 4 | 800 |
| Three levels, 3 questions each | 1 + 3 + 9 = 13 | 13 | 2,600 |

Each level multiplies the calls by the number of questions, so cap the depth or the calls. Two levels for 200 seeds, 800 credits, fits in the 1,000 free credits a month; three levels at 2,600 credits fits in a Starter pack of 10,000. Deduplication only lowers these numbers. The [pricing page](https://perceptlayer.com/pricing) has what packs cost.

For tracking how a keyword's questions change over time alongside rankings, the guide to [SERP data for SEO monitoring](https://perceptlayer.com/blog/search-result-data-seo-monitoring) stores them per day. To try the endpoint, run your own keyword in the playground on the [Google Related Questions API page](https://perceptlayer.com/apis/google-related-questions).

## APIs in this post

-   [Google Related Questions **1 credit per call** · 1 endpoint](https://perceptlayer.com/apis/google-related-questions)
-   [Google Search **1 credit per call** · 7 endpoints](https://perceptlayer.com/apis/google-search)

## Frequently asked questions

### How much does a People Also Ask lookup cost?

One credit per successful call to either endpoint. A seed keyword plus its three questions expanded one level is 4 credits, and the questions inside a search you already run for rankings cost nothing extra. Failed calls cost nothing. Every verified account gets 1,000 free credits a month, and the [pricing page](https://perceptlayer.com/pricing) has what packs cost.

### Does the API return the answers to the questions?

No. The recorded responses contain each `question` and a `next_page_token`, not the answer text or its source link that Google shows when you expand a question. To see what Google returns for a question, search it with `/v1/google-search/search` and read the organic results, which is one more credit.

### Can I get People Also Ask for another country or language?

Yes. Set `gl` to a 2-character country code and `hl` to a 2-character language code, such as `gl=de` and `hl=de` for Germany in German. Questions differ by market, so store the `gl` and `hl` you used with every row, or you won't be able to compare runs later.

### How many questions come back per call?

Both recorded responses have three questions, but nothing in the endpoint definition fixes that number, and it varies with the query. Don't hard-code it; read the length of `related_questions`. Not every query shows a People Also Ask box, so handle an empty or missing array.

### Is it allowed to use People Also Ask data?

The questions are what Google shows publicly on a results page, and most teams use them for content planning and keyword research. Whether a particular use is allowed depends on Google's terms and the law where you operate. Perceptlayer returns the data as found at the time of the call and can't give legal advice.

people also ask google seo keyword research related questions

## More from the blog

1.  [API guides](https://perceptlayer.com/blog/category/api-guides) 13 Oct 2026 Updated 26 Oct 2026 Perceptlayer 6 min read
    
    ## [Google Trends API in Python: Interest Over Time as JSON](https://perceptlayer.com/blog/google-trends-api-python)
    
    Call GET /v1/google-trends/interest from Python with requests and get weekly interest over time as JSON for 1 credit per call, with a recorded response.
    
2.  [API guides](https://perceptlayer.com/blog/category/api-guides) 16 Jul 2026 Perceptlayer 7 min read
    
    ## [Google AI Overview API: Get AI Overviews as JSON](https://perceptlayer.com/blog/google-ai-overview-api)
    
    Google has no AI Overview API. GET /v1/google-search/search-ai-overview takes a query, hl and gl, costs 1 credit, and suits daily keyword tracking.
    
3.  [API guides](https://perceptlayer.com/blog/category/api-guides) 23 Oct 2026 Perceptlayer 7 min read
    
    ## [Cars.com API: Used Car Listings and Price Evaluations](https://perceptlayer.com/blog/cars-com-api-listings-price-evaluation)
    
    Search Cars.com listings with its six required parameters (zip, radius\_miles, stock\_type, sort, page, page\_size), then listing, dealer and price-eval calls.
