Skip to main content
Best for: building Valyu into your product / agents. Add real-time search to a Gemini app via function calling.
Wire Valyu search into Gemini through function calling. Your models gain access to proprietary data sources, real-time web search, academic papers, and financial data without changing your core Gemini workflow.

Paste into your AI assistant to wire Valyu search into a Google Gemini app.

Open in Cursor

Installation

Install the required packages:
You’ll also need to set your API keys:

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:
The valyu_search function declaration accepts:
  • query (required) - natural-language search query
  • search_type - "all", "web", "proprietary", or "news" (default "all")
  • max_num_results - 1-20 for standard keys, up to 100 with a special API key
  • relevance_threshold - 0.0-1.0 relevance filter (default 0.5)
  • max_price - max cost per thousand retrievals (CPM); auto-adjusts if unset
  • category - natural-language context guide
  • included_sources - specific datasets or URLs
  • start_date / end_date - YYYY-MM-DD time filter
Use a system instruction to tell Gemini to cite sources and use natural-language queries, not operators. See the Prompting Guide.

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)