Valyu

raw JSON →
2.9.7 verified Sat May 09 auth: no python

Valyu is a Python client for the Valyu Deepsearch API, enabling AI agents to perform deep searches and retrieve structured results. Current version 2.9.7, actively maintained with frequent releases.

pip install valyu
error ImportError: cannot import name 'ValyuClient' from 'valyu'
cause Wrong import name. The class is named 'Client'.
fix
Change to from valyu import Client.
error AttributeError: 'dict' object has no attribute 'results'
cause Using dot notation on the response dict. The 'search' method returns a dict, not an object.
fix
Use response['results'] instead of response.results.
error TypeError: __init__() missing 1 required positional argument: 'api_key'
cause Not providing the API key as a named parameter or environment variable.
fix
Either set VALYU_API_KEY environment variable or pass api_key argument: Client(api_key='your-key').
gotcha API key must be passed as 'api_key' parameter, not as positional argument or environment variable named 'API_KEY'.
fix Use named argument `api_key` or set the VALYU_API_KEY environment variable.
breaking In version 2.x, the method `search` returns a dict with key 'results' instead of a list directly as in 1.x.
fix Access results via `response['results']` instead of iterating over the response directly.
deprecated The `deep_search` method was deprecated in 2.9.0; use `search` instead.
fix Replace `client.deep_search(query)` with `client.search(query)`.

Initialize the client with an API key and perform a search.

from valyu import Client

client = Client(api_key=os.environ.get('VALYU_API_KEY', ''))
results = client.search("What is the capital of France?")
print(results)