---
title: "You.com / Web search"
description: "You.com tool youcom-search on looot: input fields, $0.005 per call, output shape, and code to run it with curl, JavaScript or Python."
sidebar:
  hidden: true
---

{/* Generated by scripts/generate-api-reference.mjs from data/api-reference.json. Do not edit. */}

Ranked web and news results (title, url, description, snippets) for a query; count up to 100, offset 0-9 for pages, freshness, country, language, domain include/exclude/boost, and knowledge=core for live stock, crypto, weather and sports data. Full-page extraction is not offered here; use You.com / Page contents.

- **Tool id:** `youcom-search`
- **Provider:** [You.com](/providers/youcom)
- **Job:** [Search the web and get ranked results](/reference/jobs/web-search) (`web.search`)
- **Price:** $0.005 per call. A call that fails at the provider costs $0.

## Inputs

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `boost_domains` | array | no | A list of domains to boost in search ranking. Matching results from these domains receive a fixed relative ranking boost, but this is not a filter. If the boosted domains do not have matching results, results from other domains can still appear. Supports up to 500 domains. Can be combined with `exclude_domains`. Cannot be combined with `include_domains`. Passing both `boost_domains` and `include_domains` will return a `422` error. |
| `count` | integer | no | Specifies the maximum number of search results to return per section (the sections are `web` and `news`. See the JSON response to visualize them). |
| `country` | string | no | The country code that determines the geographical focus of the web results. |
| `exclude_domains` | array | no | A list of domains to exclude from search results. Results from these domains will be filtered out. Supports up to 500 domains. Cannot be combined with `include_domains`; passing both will return a `422` error. |
| `freshness` | unknown | no | Specifies the freshness of the results to return. Provide either one of `day`, `week`, `month`, `year`, or a date range string in the format `YYYY-MM-DDtoYYYY-MM-DD`. When your search query includes a temporal keyword and you also set a freshness parameter, the search will use the broader (i.e., less restrictive) of the two timeframes. For example, if you use `query=news+this+week&freshness=month`, the results will use a freshness of month. |
| `include_domains` | array | no | A list of domains to restrict search results to. Only results from these domains will be returned. Supports up to 500 domains. This is a strict allowlist, not a boost, results are limited exclusively to the specified domains. Cannot be combined with `exclude_domains`; passing both will return a `422` error. |
| `knowledge` | string | no | Requests knowledge results alongside web and news search. |
| `language` | string | no | The language of the web results that will be returned (BCP 47 format). |
| `offset` | integer | no | Indicates the `offset` for pagination. The `offset` is calculated in multiples of `count`. For example, if `count = 5` and `offset = 1`, results 5-10 will be returned. Range `0 ≤ offset ≤ 9`. |
| `query` | string | yes | The search query used to retrieve relevant results from the web. You can also include [search operators](https://you.com/docs/guides/search/search-operators) to refine your search. |
| `safesearch` | string | no | Configures the safesearch filter for content moderation. This allows you to decide whether to return NSFW content or not. |

## Output

The run's `result` holds the provider's answer. Signed in, `looot inspect youcom-search` prints its fields.

## Run it

Every call needs your API token in `LOOOT_TOKEN`; [Sign in](/get-started/sign-in#use-the-token-in-scripts-and-agents) shows how to get one. Each run also needs a new idempotency key, so a retry never pays twice. With `wait: 30` the answer comes back inline when the run ends within 30 seconds. Otherwise you get the running run back: poll `GET /v1/runs/<runId>`.

Example input with placeholder values:

<CodeGroup>

```bash curl
curl -X POST "https://api.looot.ai/v1/runs" \
  -H "Authorization: Bearer $LOOOT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"endpointId":"youcom-search","input":{"query":"<query>"},"wait":30}'
```

```js JavaScript
const response = await fetch("https://api.looot.ai/v1/runs", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LOOOT_TOKEN}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    endpointId: "youcom-search",
    input: {
      query: "<query>",
    },
    wait: 30,
  }),
});
const run = await response.json();
console.log(run.status, run.result);
```

```python Python
import os
import uuid

import requests

response = requests.post(
    "https://api.looot.ai/v1/runs",
    headers={
        "Authorization": f"Bearer {os.environ['LOOOT_TOKEN']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "endpointId": "youcom-search",
        "input": {
            "query": "<query>",
        },
        "wait": 30,
    },
    timeout=90,
)
run = response.json()
print(run["status"], run.get("result"))
```

</CodeGroup>

To let looot pick among every provider of this job instead, send `job:web.search` as `endpointId`; see [the job page](/reference/jobs/web-search).
