---
name: collect-ai-answers
description: "Ask ChatGPT, Gemini, Perplexity, Microsoft Copilot, Google AI Overviews, Google AI Mode, Naver AI Brief or Naver AI Tab a question from a chosen country or neighborhood and get the answer people see, with its cited sources, as JSON. Use it to check what AI answers say about a brand, product or topic, or to collect answers in bulk. 1.25-1 credits per answer."
---

# Collect AI answers with querying.ai

querying.ai asks the consumer AI products your question and returns the answer people see on screen: the text, the pages it cites and fields such as the web searches it ran and the product cards it showed.

Send `Authorization: Bearer $QUERYING_API_KEY` on every request to https://api.querying.ai. Getting a key, and the 500 credits a new account starts with: https://querying.ai/auth.md

## 1. Pick the engine

| `taskType` | Product | Payload field | Credits |
| --- | --- | --- | --- |
| `CHATGPT` | ChatGPT | `prompt` | 1 |
| `GEMINI` | Gemini | `prompt` | 1.25 |
| `PERPLEXITY` | Perplexity | `prompt` | 1 |
| `BING_COPILOT` | Microsoft Copilot | `prompt` | 1 |
| `META_AI` | Meta AI | `prompt` | 1 |
| `QWEN` | Qwen (千问, China) | `prompt` | 1.25 |
| `DOUBAO` | Doubao (豆包, China) | `prompt` | 1.25 |
| `GOOGLE` | Google AI Overviews | `query` | 1.25 |
| `AIMODE` | Google AI Mode | `query` | 1.25 |
| `NAVER_AI_BRIEF` | Naver AI Brief | `query` | 1.25 |
| `NAVER_AI_TAB` | Naver AI Tab | `query` | 1.25 |

## 2. Submit

```bash
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"taskType": "CHATGPT", "payload": {"prompt": "best running shoes for flat feet", "country": "US"}}'
```

- `payload.country`: two-letter code, default `US`. The engine answers from inside that country.
- `payload.location`: the point to ask from, inside the country, in decimal degrees (`{"latitude": 37.4979, "longitude": 127.0276}`) on `CHATGPT`, `GEMINI`, `GOOGLE` and `AIMODE`. The answer is the one a person standing there gets.
- `payload.include`: ChatGPT returns `markdown`, `searchQueries` and `shoppingCards` on every answer. Perplexity adds `searchQueries` with `"include": {"searchQueries": true}`, and Perplexity and Gemini add `markdown` with `"markdown": true`.

## 3. Read the result

Tasks run asynchronously. The POST returns `task.id` with `status` `QUEUED`. Poll `GET /v1/async/task/{id}` every few seconds until `task.status` is `COMPLETED` or `FAILED`, or add `"webhook": {"url": "https://your.server/hook"}` to the request and the finished task arrives at that URL as a POST. A finished task stays readable for 24 hours.

In `response`:

- `text`: the answer, and `markdown` when the engine returns it.
- `sources[]`: the cited pages, each with `position`, `url` and `label`.
- `searchQueries[]`: the web searches ChatGPT, Perplexity and Copilot ran to answer.
- `shoppingCards[]`: the product cards the answer showed.
- `GOOGLE`: `aioverview` holds the AI Overview's `text` and `sources`, next to `organicResults` and `peopleAlsoAsk`. `aioverview: null` records that Google showed the query without an AI Overview.

## Many questions at once

`POST /v1/async/task/batch` takes a JSON array of up to 500 task objects, engines mixed. Each item's outcome is in `results[]`, so one malformed item leaves the rest queued.

## The same question from many places

`POST /v1/async/task/grid` asks one prompt from every point of a square grid: `"grid": { "center": { "latitude": 37.4979, "longitude": 127.0276 }, "size": 5, "radiusMeters": 2000 }`. Each point is an ordinary task with its own `payload.location`, and `GET /v1/async/task/grid/{id}?include=response` returns the answers row by row from the north-west corner.

## Errors

| HTTP | `code` | When |
| --- | --- | --- |
| 401 | `MISSING_API_KEY` | The key is missing, wrong, expired or revoked. |
| 402 | `INSUFFICIENT_CREDITS` | The account balance is below the task's credits. |
| 403 | `KEY_SCOPE_DENIED` | The key is limited to other engines. |
| 422 | `REGION_UNSUPPORTED` | The engine serves other countries; pick another engine or country. |
| 429 | `KEY_DAILY_CREDIT_LIMIT` | The key reached its daily credit limit; `details.retryAfterSec` counts down to the next UTC day. |

A task that fails ends with `task.status` `FAILED` and an `error` string, and its credits are released.

## Over MCP

Connect https://mcp.querying.ai/mcp with the same key as a bearer token. `run_prompt` submits and waits; `submit_prompt` and `get_task` split the two steps.

Reference: https://docs.querying.ai/quickstart and https://docs.querying.ai/engines/overview
