# Tavily

> Search the web with Tavily and get results built for automation: ranked pages, the passages that matched, and an optional written answer with its sources. Read any page it finds as clean markdown instead of raw HTML.

App · AI Search & Memory · 2 actions. Web page: https://docs.lodol.com/docs/integrations/tavily

## Actions

### Read web pages

Read up to 20 web pages and get their content back as clean markdown or plain text, with the navigation, ads, and markup stripped out. Pair it with 'Search the web' to read the pages a search turned up.

**Inputs**

- Web page addresses (`urls`, list, required): The addresses (URLs) of the pages to read, such as the ones an earlier search returned. Up to 20 per step. Pass a list even when there is only one page.
- Extraction depth (`extract_depth`, text): 'Standard' handles ordinary articles and pages. 'Thorough' also pulls tables and embedded content out of complex pages, at twice the credits and more waiting. One of: `basic` (Standard (recommended)), `advanced` (Thorough (2 credits)). Default: `basic`.
- Content format (`format`, text): Markdown keeps the headings, lists, and links. Plain text drops all formatting. One of: `markdown` (Markdown (recommended)), `text` (Plain text). Default: `markdown`.
- What to look for (`query`, text): A question or topic to rank each page's content against, so the most relevant parts come back first. Leave blank to get the whole page.
- Snippets per page (`chunks_per_source`, number): Return only the most relevant snippets of each page instead of the whole thing, up to 5. Needs 'What to look for' filled in. From 1 to 5.
- Include images (`include_images`, true/false): Also return the images found on each page. Default: `false`.
- Seconds per page (`timeout`, number): How long to wait for each page before giving up on it, from 1 to 60 seconds. Leave blank to use Tavily's own timeout, which depends on the extraction depth. From 1.0 to 60.0.

**Outputs**

- `failed_count` (number): How many pages could not be read.
- `failed_results` (list): The pages that could not be read, each with the reason why.
- `request_id` (text): Tavily's ID for this request, to quote to their support if something looks wrong.
- `response_time` (number): How long Tavily took, in seconds.
- `result_count` (number): How many pages were read.
- `results` (list): The pages that were read successfully.

**Example output**

```json
{
  "failed_count": 0,
  "failed_results": [],
  "request_id": "123e4567-e89b-12d3-a456-426614174111",
  "response_time": 1.19,
  "result_count": 1,
  "results": [
    {
      "images": [],
      "raw_content": "# Lionel Messi\n\nLionel Andres Messi is an Argentine professional footballer...",
      "url": "https://en.wikipedia.org/wiki/Lionel_Messi"
    }
  ]
}
```

### Search the web

Search the web with Tavily and get back ranked pages with the passages that matched, and optionally a written answer to the question. Built for feeding later steps: results come back as clean text rather than HTML.

**Inputs**

- Search query (`query`, text, required): What to search for, such as 'who is Leo Messi?'. Write it the way you would ask a person.
- Topic (`topic`, text): Which slice of the web to search. 'News' is best for current events and reads from mainstream media; 'Finance' for markets and company data; 'General' for everything else. One of: `general` (General (recommended)), `news`, `finance`. Default: `general`.
- Search depth (`search_depth`, text): How hard Tavily works on the search. 'Balanced' suits almost every case. 'Thorough' is the most relevant and returns several matching snippets per page, at twice the credits and more waiting. The two fast options trade some relevance for speed. One of: `basic` (Balanced (recommended)), `advanced` (Thorough (2 credits)), `fast`, `ultra-fast` (Fastest (lowest quality)). Default: `basic`.
- Number of results (`max_results`, number): How many pages to return, up to 20. Set to 0 to get only the written answer, with no list of sources. From 0 to 20. Default: `5`.
- Write an answer (`include_answer`, text): Also have Tavily write an answer to the query from the results it found. 'Quick' is a sentence or two; 'Detailed' is a fuller write-up. One of: `none` (No answer), `basic` (Quick answer), `advanced` (Detailed answer). Default: `none`.
- Include page content (`include_raw_content`, text): Also return the full cleaned content of every result. Leave off unless a later step needs to read the whole page; the matching passages are usually enough, and full pages make the result much larger. Plain text takes longer than Markdown. One of: `none` (No page content), `markdown`, `text` (Plain text). Default: `none`.
- Snippets per page (`chunks_per_source`, number): How many matching snippets to return per page, up to 3. Only applies when the search depth is 'Thorough'. From 1 to 3.
- Published within (`time_range`, text): Only return pages published or updated within this much time of today. One of: `day` (Past day), `week` (Past week), `month` (Past month), `year` (Past year).
- Published after (`start_date`, date): Only return pages published or updated on or after this date, in YYYY-MM-DD format.
- Published before (`end_date`, date): Only return pages published or updated on or before this date, in YYYY-MM-DD format.
- Websites to include (`include_domains`, list): Only return results from these websites, for example nytimes.com. Up to 300.
- Websites to exclude (`exclude_domains`, list): Leave out results from these websites, for example reddit.com. Up to 150.
- Boost a country (`country`, text): Prioritize results from one country, for example 'united states' or 'united kingdom'. Only applies to the General topic.
- Match quoted phrases exactly (`exact_match`, true/false): Only return pages containing the phrases you put in quotes in the query, such as "John Smith" CEO. Without this, Tavily also matches synonyms and rewordings. Default: `false`.
- Tune the search automatically (`auto_parameters`, true/false): Let Tavily pick the topic and depth from the query itself. Anything set above still wins. It may choose the 'Thorough' depth, which costs 2 credits per search. Default: `false`.
- Include images (`include_images`, true/false): Also return images related to the query, plus the images found on each result page. Default: `false`.
- Describe the images (`include_image_descriptions`, true/false): Add a written description to every image returned. Needs 'Include images' turned on. Default: `false`.
- Include site icons (`include_favicon`, true/false): Also return each result's favicon, for showing the sources with their site icons. Default: `false`.

**Outputs**

- `answer` (text): The written answer to the query. Only when an answer was requested.
- `auto_parameters` (object): The settings Tavily chose. Only when the search was tuned automatically.
- `images` (list): Images related to the query. Only when images were included.
- `query` (text): The query that was searched for.
- `request_id` (text): Tavily's ID for this request, to quote to their support if something looks wrong.
- `response_time` (number): How long Tavily took, in seconds.
- `result_count` (number): How many results were returned.
- `results` (list): The matching pages, most relevant first.

**Example output**

```json
{
  "answer": null,
  "images": [],
  "query": "Who is Leo Messi?",
  "request_id": "123e4567-e89b-12d3-a456-426614174111",
  "response_time": 1.67,
  "result_count": 1,
  "results": [
    {
      "content": "Lionel Messi, an Argentine footballer, is widely regarded as one of the greatest football players of his generation.",
      "raw_content": null,
      "score": 0.81025416,
      "title": "Lionel Messi Facts | Britannica",
      "url": "https://www.britannica.com/facts/Lionel-Messi"
    }
  ]
}
```
