> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tinyfish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TinyAnswer

> Ask questions and receive answers with web citations

TinyAnswer searches the web and returns an answer with citations in one JSON response. Use it for focused questions when you need an answer and its sources rather than a list of search results.

```bash theme={null}
POST https://api.answer.tinyfish.ai/
```

[Try TinyAnswer in the playground](https://agent.tinyfish.ai/playground/answer).

## Before You Start

**1. Get your API key**

Create a personal API key at [agent.tinyfish.ai/api-keys](https://agent.tinyfish.ai/api-keys).
TinyAnswer must be enabled for your account. Team API keys are not supported.

**2. Store it in your environment**

```bash theme={null}
export TINYFISH_API_KEY="your_api_key_here"
```

All requests require the `X-API-Key` header. See [Authentication](https://docs.tinyfish.ai/authentication.md) for setup and troubleshooting.

## Your First Request

```python Python theme={null}
import os
import httpx

response = httpx.post(
    "https://api.answer.tinyfish.ai/",
    headers={"X-API-Key": os.environ["TINYFISH_API_KEY"]},
    json={"question": "Who is the CEO of Stripe?"},
    timeout=70,
)
response.raise_for_status()
result = response.json()
print(result["answer"])
for citation in result["citations"]:
    print(citation["title"] or citation["url"], citation["url"])
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.answer.tinyfish.ai/", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.TINYFISH_API_KEY!,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ question: "Who is the CEO of Stripe?" }),
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
console.log(result.answer);
for (const citation of result.citations) {
  console.log(citation.title ?? citation.url, citation.url);
}
```

```bash cURL theme={null}
curl -X POST https://api.answer.tinyfish.ai/ \
  -H "X-API-Key: $TINYFISH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "Who is the CEO of Stripe?"}'
```

The Python example requires `pip install httpx`. The TypeScript example uses Node.js built-in `fetch`.

## What Success Looks Like

Successful requests return HTTP `200`. This response is illustrative; answers and citations depend on the question and available sources.

```json theme={null}
{
  "answer": "Patrick Collison is the CEO and co-founder of Stripe [1].",
  "citations": [{ "url": "https://stripe.com/about", "title": "About Stripe" }],
  "request_id": "example-request-id"
}
```

`answer` is plain text. Each `[n]` marker cites `citations[n-1]`, numbered from `[1]` in order of first use. When no source supports the answer, `citations` is empty; treat that `answer` as unsourced.

## When to Use TinyAnswer vs the Other APIs

* Use **TinyAnswer** for a focused answer with web citations.
* Use **TinyResearch** for broader synthesis across multiple sources.
* Use **TinySearch** for ranked links, snippets, and source discovery.
* Use **TinyFetch** when you know which pages to extract.
* Use **TinyAgent** when TinyFish should interact with websites.
* Use **TinyBrowser** when you need direct Playwright or CDP control.

## Read Next

> [card] [TinyAnswer reference](https://docs.tinyfish.ai/api-reference/answer-a-question.md)
>
> Request fields, response fields, errors, and limits

> [card] [TinyAnswer examples](https://docs.tinyfish.ai/tinyanswer/examples.md)
>
> Current facts, company information, and source handling


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.