# List a prompt's answers

> List the AI answers a prompt got over a window, newest first, with the brands they named and the sources they cited.

Source: https://ranqo.ai/docs/api/reference/list-answers

```http
GET https://api.ranqo.ai/v1/brands/{brand_id}/prompts/{prompt_id}/answers
```

The answers a window counts for this prompt, newest first: those from its completed runs, or the latest run before it when it held none. Failed and filled-in answers are left out, as in the reports, so the answers of every prompt add up to the `answer_count` of `/visibility` over the same window and engines.

## Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `brand_id` | string | The brand id, from `GET /v1/brands`. |
| `prompt_id` | string | The prompt id, from `GET /v1/brands/{brand_id}/prompts`. |

## Query parameters

Every parameter is optional. A parameter the endpoint does not take is refused with `unknown_parameter`.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `period` | string |  | `7d`, `30d` and `90d` run from midnight in `tz` that many days back to now; `365d` runs from midnight 365 days back to the end of today. Default `30d`. Not with `start_date`. One of `7d`, `30d`, `90d`, `365d`. |
| `start_date` | string |  | First day of a custom window, in `tz`. Send with `end_date`. |
| `end_date` | string |  | Last day of a custom window, in `tz`, included. The window may span at most 366 days, both dates counted. |
| `tz` | string |  | IANA time zone for day boundaries, such as `Asia/Kolkata`. Default `UTC`. |
| `platforms` | string |  | Engines to list: claude, chatgpt, perplexity, gemini, grok, google_aio. |
| `limit` | integer | `20` | Items per page, 1 to 50. |
| `cursor` | string |  | The `next_cursor` of the previous page. |

## Response

The response body, as JSON.

| Field | Type | Description |
| --- | --- | --- |
| `window` | object | The answers a report counts: those from completed runs inside the window. |
| `window.start` | string | RFC 3339 timestamp in UTC. |
| `window.end` | string | RFC 3339 timestamp in UTC. |
| `window.previous_start` | string | The comparison window runs from here to `start`: the whole days before `start` for `7d`, `30d` and `90d`, the same length as the window otherwise. |
| `window.time_zone` | string |  |
| `window.period` | string or null | The preset, or null for a custom window. One of `7d`, `30d`, `90d`, `365d`. |
| `window.carried_from` | string or null | RFC 3339 timestamp in UTC. Set when the window held no completed run: the figures are the latest run before it, which completed at this time, and nothing is compared. |
| `data` | array of objects |  |
| `data[].id` | string |  |
| `data[].prompt_id` | string |  |
| `data[].run_id` | string |  |
| `data[].platform` | string |  |
| `data[].created_at` | string | RFC 3339 timestamp in UTC. |
| `data[].text` | string | The answer as the engine returned it. |
| `data[].text_markdown` | string or null | The answer reformatted as markdown, when it was. |
| `data[].brand_named` | boolean |  |
| `data[].position` | integer or null | Where the brand was named, 1 = first; null when not named. |
| `data[].sentiment` | string or null | How the answer spoke of the brand; null when not named. One of `positive`, `neutral`, `negative`, `mixed`. |
| `data[].competitors` | array of objects |  |
| `data[].competitors[].name` | string |  |
| `data[].competitors[].position` | integer or null |  |
| `data[].competitors[].sentiment` | string or null | One of `positive`, `neutral`, `negative`, `mixed`. |
| `data[].competitors[].domain` | string or null | Null when no domain could be confirmed; never guessed. |
| `data[].sources` | array of objects |  |
| `data[].sources[].url` | string |  |
| `data[].sources[].domain` | string |  |
| `data[].sources[].title` | string or null |  |
| `has_more` | boolean | Whether another page follows. |
| `next_cursor` | string or null | Pass as `cursor` for the next page; null on the last page. |

## Response headers

| Header | Description |
| --- | --- |
| `X-Request-Id` | The request id; quote it to support. |
| `RateLimit` | Requests left in this window and seconds until it resets. |
| `RateLimit-Policy` | The key's limit per window. |

## Example request

```bash title="curl"
curl "https://api.ranqo.ai/v1/brands/BRAND_ID/prompts/PROMPT_ID/answers" \
  -H "Authorization: Bearer $RANQO_API_KEY"
```

## Errors

Errors are problem details (`application/problem+json`) with a stable `code`. See [Errors](https://ranqo.ai/docs/api/errors) for each one.

| Status | Codes |
| --- | --- |
| 400 | [`invalid_parameter`](https://ranqo.ai/docs/api/errors#invalid_parameter), [`unknown_parameter`](https://ranqo.ai/docs/api/errors#unknown_parameter), [`invalid_cursor`](https://ranqo.ai/docs/api/errors#invalid_cursor), [`api_key_in_url`](https://ranqo.ai/docs/api/errors#api_key_in_url) |
| 401 | [`missing_api_key`](https://ranqo.ai/docs/api/errors#missing_api_key), [`invalid_api_key`](https://ranqo.ai/docs/api/errors#invalid_api_key), [`api_key_revoked`](https://ranqo.ai/docs/api/errors#api_key_revoked), [`api_key_expired`](https://ranqo.ai/docs/api/errors#api_key_expired), [`api_key_orphaned`](https://ranqo.ai/docs/api/errors#api_key_orphaned) |
| 403 | [`plan_upgrade_required`](https://ranqo.ai/docs/api/errors#plan_upgrade_required), [`subscription_inactive`](https://ranqo.ai/docs/api/errors#subscription_inactive) |
| 404 | [`not_found`](https://ranqo.ai/docs/api/errors#not_found) |
| 429 | [`rate_limited`](https://ranqo.ai/docs/api/errors#rate_limited) |
| 500 | [`internal_error`](https://ranqo.ai/docs/api/errors#internal_error) |
| 503 | [`service_unavailable`](https://ranqo.ai/docs/api/errors#service_unavailable) |
