Tavily

Search the web and extract structured content with Tavily's AI search API.

AI and MLAPI key3 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (3)
  4. extract
  5. search
  6. custom_api_call
  7. Details

Connect

Auth type: API key (secret_text). Pass the provider's API key or token as the connection's credential. It is sealed at rest and only opened on the server when an action runs.

  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("tavily", action, input) resolves with the provider's answer and rejects when Tavily isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "tavily"} says whether yours can call it.

Workflow
// workflows/notify.ts: call Tavily when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellTavily = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when Tavily isn't connected.
  const output = await step.run("Tavily", () =>
    step.ctx.integrations.invoke("tavily", "extract", {
      "urls": []
    }),
  );
  step.ctx.log("Tavily answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "tavily",
    "piece_action": "extract",
    "input": {
      "urls": []
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/tavily/extract" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "content-type: application/json" \
  -d '{"props":{"urls":[]}}'

Actions

extract

Extract Content. Retrieve raw web content from specified URLs.

InputTypeDescription
urlsrequiredarrayThe URLs you want to extract with Tavily.
include_imagesoptionalbooleanInclude a list of images extracted from the URLs in the response.

search

Search. Search for data based on a query.

InputTypeDescription
queryrequiredlong textThe search query you want to execute with Tavily.
search_depthoptionalone of "basic" | "advanced"The depth of the search. It can be "basic" or "advanced".
topicoptionalone of "general" | "news"The category of the search. This will determine which of our agents will be used for the search.
daysoptionalnumberThe number of days back from the current date to include in the search results. Only available when using the "news" search topic. Default is 3.
time_rangeoptionalone of "day" | "week" | "month" | "year" | "d" | "w" | "m" | "y"The time range back from the current date to include in the search results.
max_resultsoptionalnumberThe maximum number of search results to return.
include_imagesoptionalbooleanInclude a list of query-related images in the response.
include_image_descriptionsoptionalbooleanWhen include_images is set to True, this option adds descriptive text for each image.
include_answeroptionalbooleanInclude a short answer to original query, generated by an LLM based on Tavily's search results.
include_raw_contentoptionalbooleanInclude the cleaned and parsed HTML content of each search result.
include_domainsoptionalarrayA list of domains to specifically include in the search results.
exclude_domainsoptionalarrayA list of domains to specifically exclude from the search results.

custom_api_call

Custom API Call. Make a custom API call to a specific endpoint

InputTypeDescription
urlrequiredobject (depends on other props)url
methodrequiredone of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD"Method
headersrequiredobjectAuthorization headers are injected automatically from your connection.
queryParamsrequiredobjectQuery Parameters
body_typeoptionalone of "none" | "json" | "form_data" | "raw"Body Type
bodyoptionalobject (depends on other props)Body
response_is_binaryoptionalbooleanEnable for files like PDFs, images, etc.
failsafeoptionalbooleanNo Error on Failure
timeoutoptionalnumberTimeout (in seconds)
followRedirectsoptionalbooleanFollow redirects

Details

Id
tavily
Category
AI and ML
Tags
search, extraction, web, ai, research
Package
@activepieces/piece-tavily@0.1.5
Runs
Through the integration runner