> For clean Markdown of any page, append `.md` to the page URL.
> Documentation index: https://you.com/docs/llms.txt (section indexes: append `/llms.txt` to any section URL).
> Search these docs: Docs MCP at https://you.com/docs/_mcp/server (`searchDocs`, no API key).
> Call live You.com APIs: Product MCP at https://api.you.com/mcp (free Search only: `?profile=free`). To pick an API or integration path, call `you-discover` on that server instead of guessing.
> OpenAPI: https://you.com/docs/openapi.json—auth header `X-API-Key`, env `YDC_API_KEY`.

# Search Controls

The Answer API accepts the same freshness, locale, domain, and explicit-content controls as the Web Search API. All controls are optional and can be combined, except `include_domains` with `exclude_domains` or `boost_domains`.

`safesearch` defaults to `moderate`. Set it to `strict` for stronger explicit-content filtering or `off` to return unfiltered web results.

## Freshness

Restrict results to the last week for questions about recent events:

```python
from youdotcom import You

with You() as you:
    response = you.answer(
        query="What changed in the latest Fed interest rate decision?",
        freshness="week",
    )
```

```typescript
const response = await fetch("https://api.you.com/v1/answer", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.YDC_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "What changed in the latest Fed interest rate decision?",
    freshness: "week",
  }),
});
```

```curl
curl -X POST https://api.you.com/v1/answer \
  -H "X-API-Key: $YDC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What changed in the latest Fed interest rate decision?",
    "freshness": "week"
  }'
```

Use a custom date range for questions bounded to a specific period:

```python
from youdotcom import You

with You() as you:
    response = you.answer(
        query="What were the major AI regulation developments in 2025?",
        freshness="2025-01-01to2025-12-31",
    )
```

```typescript
const response = await fetch("https://api.you.com/v1/answer", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.YDC_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "What were the major AI regulation developments in 2025?",
    freshness: "2025-01-01to2025-12-31",
  }),
});
```

```curl
curl -X POST https://api.you.com/v1/answer \
  -H "X-API-Key: $YDC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What were the major AI regulation developments in 2025?",
    "freshness": "2025-01-01to2025-12-31"
  }'
```

## Domain Filters

Restrict results to trusted sources with `include_domains`:

```python
from youdotcom import You

with You() as you:
    response = you.answer(
        query="What are the FDA-approved GLP-1 receptor agonists?",
        include_domains=["fda.gov", "nih.gov"],
    )
```

```typescript
const response = await fetch("https://api.you.com/v1/answer", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.YDC_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "What are the FDA-approved GLP-1 receptor agonists?",
    include_domains: ["fda.gov", "nih.gov"],
  }),
});
```

```curl
curl -X POST https://api.you.com/v1/answer \
  -H "X-API-Key: $YDC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What are the FDA-approved GLP-1 receptor agonists?",
    "include_domains": ["fda.gov", "nih.gov"]
  }'
```

Exclude unreliable sources while boosting authoritative ones. `exclude_domains` and `boost_domains` can be used together:

```python
from youdotcom import You

with You() as you:
    response = you.answer(
        query="What is the current state of quantum computing?",
        exclude_domains=["reddit.com", "quora.com"],
        boost_domains=["nature.com", "science.org", "arxiv.org"],
    )
```

```typescript
const response = await fetch("https://api.you.com/v1/answer", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.YDC_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "What is the current state of quantum computing?",
    exclude_domains: ["reddit.com", "quora.com"],
    boost_domains: ["nature.com", "science.org", "arxiv.org"],
  }),
});
```

```curl
curl -X POST https://api.you.com/v1/answer \
  -H "X-API-Key: $YDC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What is the current state of quantum computing?",
    "exclude_domains": ["reddit.com", "quora.com"],
    "boost_domains": ["nature.com", "science.org", "arxiv.org"]
  }'
```

## Country and Language

Focus results on a specific region and language:

```python
from youdotcom import You

with You() as you:
    response = you.answer(
        query="What are the top startup hubs in Germany?",
        country="DE",
        language="DE",
    )
```

```typescript
const response = await fetch("https://api.you.com/v1/answer", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.YDC_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "What are the top startup hubs in Germany?",
    country: "DE",
    language: "DE",
  }),
});
```

```curl
curl -X POST https://api.you.com/v1/answer \
  -H "X-API-Key: $YDC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What are the top startup hubs in Germany?",
    "country": "DE",
    "language": "DE"
  }'
```

Select `country` and `language` from the [supported values](/docs/api-reference/answer/v1-answer).

[View full API reference](/docs/api-reference/answer/v1-answer)

## Next Steps

#### [Answer API Overview](/docs/guides/answer)

When to use Answer, what you get, and pricing

#### [Answer API Quickstart](/docs/guides/answer/quickstart)

Make your first Answer API request

#### [API reference](/docs/api-reference/answer/v1-answer)

Full parameter reference and playground