---
url: https://docs.freetheai.org/api/answer.md
description: >-
  POST /v1/answer - a short written answer to a question from current web
  sources, in Markdown, with the sources it used.
---

# Answer

Searches the web for a question and returns a short written answer, in Markdown, with the sources it used. Use it when you want the answer itself; use [Search](/api/search) when you want raw results to give your own model. An answer takes a few seconds longer than a search.

`POST https://api.freetheai.org/v1/answer`

## Request

::: code-group

```bash [curl]
curl https://api.freetheai.org/v1/answer \
  -H "Authorization: Bearer $FTAI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "When does daylight saving time end in the US this year?"}'
```

```python [Python]
import os
import requests

response = requests.post(
    "https://api.freetheai.org/v1/answer",
    headers={"Authorization": f"Bearer {os.environ['FTAI_KEY']}"},
    json={"query": "When does daylight saving time end in the US this year?"},
    timeout=90,
)
response.raise_for_status()
data = response.json()
print(data["answer"])
for source in data["sources"]:
    print("-", source["title"], source["url"])
```

```ts [TypeScript]
type Source = { title: string; url: string }

const response = await fetch('https://api.freetheai.org/v1/answer', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.FTAI_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ query: 'When does daylight saving time end in the US this year?' }),
})
if (!response.ok) throw new Error((await response.json()).error?.message)
const data = (await response.json()) as { answer: string; sources: Source[] }
console.log(data.answer)
```

:::

## Body parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `query` | string, **required** | The question to answer, up to 1,024 characters. |
| `num_results` | integer | The most sources to use and return, 1 to 25. Default 10. |

## Response

```json
{
  "query": "When does daylight saving time end in the US this year?",
  "answer": "Daylight saving time ends on **Sunday, November 1, 2026** at 2:00 AM local time, when clocks go back one hour [1].",
  "sources": [
    { "title": "Daylight Saving Time 2026", "url": "https://www.timeanddate.com/time/change/usa" }
  ],
  "daily_used": 4,
  "daily_limit": 50
}
```

| Field | Type | Description |
| --- | --- | --- |
| `query` | string | The question that was answered. |
| `answer` | string | A short answer written from current web sources, in Markdown. |
| `sources` | array | The pages the answer used, each with `url` and `title`. |
| `daily_used` | integer | Searches used today, including this one. |
| `daily_limit` | integer | Your account's daily web-search allowance. |

## Limits

Every call counts against the same daily web-search allowance as [`/v1/search`](/api/search), separate from your free requests, and resets at 00:00 UTC. Identical questions within an hour return the same answer.

## Errors

| Status | Meaning |
| --- | --- |
| `400` | The query is missing or too long. |
| `401` | Missing or invalid API key. |
| `429` | The daily web-search allowance is used up. It resets at 00:00 UTC. |
| `502` | No answer could be written right now. Try again, or use `/v1/search`. |
