Tavily AI Tavily AI

Conduct Real-Time Web Searches with Tavily AI

Quickly retrieve up-to-date web results and related images directly in your Python code, enabling fast knowledge retrieval for apps, research, and content creation.

Takes
Text
Produces
Text Image
What you'll produce
Input
Who is Lionel Messi?
Output
A list of result titles and content snippets about Lionel Messi, such as his biography, career highlights, and related image URLs.

Workflow Demo

The Workflow

7 steps · click a step number to mark it done

Open Tavily AI and have it ready before you start

Install the Tavily Python client by running "pip install tavily-python"

Create an environment variable named TAVILY_API_KEY and paste your API key into it

Import the client in your script with from tavily import TavilyClient and instantiate it using client = TavilyClient()

Write your search query as a text string, e.g., query = "Who is Lionel Messi?"

Call the search API: response = client.search(query)

Iterate over response["results"] and print each result["title"] and result["content"]

To also fetch images, add include_images=True in the search call and then loop over response["images"] to display the image URLs

Did this workflow help?
🔍 Looking for AI tools? Try searching!