Best for: building Valyu into your product / agents. Add real-time search to a Gemini app via function calling.
Paste into your AI assistant to wire Valyu search into a Google Gemini app.
Installation
Install the required packages:Free Credits
Get your API key with $10 free credits ($20 with a work email) from the Valyu Platform.
Basic Integration
Function Definition
First, define the Valyu search function for Gemini to use:Basic Usage
Use the function with Gemini’s function calling:Function parameters
Function parameters
The
valyu_search function declaration accepts:query(required) - natural-language search querysearch_type-"all","web","proprietary", or"news"(default"all")max_num_results- 1-20 for standard keys, up to 100 with a special API keyrelevance_threshold- 0.0-1.0 relevance filter (default 0.5)max_price- max cost per thousand retrievals (CPM); auto-adjusts if unsetcategory- natural-language context guideincluded_sources- specific datasets or URLsstart_date/end_date- YYYY-MM-DD time filter
Response format
Response format
Additional Resources
Gemini Function Calling
Official Gemini function calling documentation
Valyu API Reference
Complete Valyu v2 API documentation
Gemini Models
Learn about Gemini model capabilities
Get API Key
Sign up for $10 free credits ($20 with a work email)

