Vercel AI SDK
Integrate You.com’s real-time web search and webpage content extraction capabilities into any application you’ve built with Vercel’s AI SDK.
The @youdotcom-oss/ai-sdk-plugin package provides two ready-made tools for the Vercel AI SDK:
youSearch()for real-time web and news searchyouContents()for page content extraction
Drop them into any generateText, streamText, or generateObject call to give your AI application real-time web access.
Starting from scratch? We recommend using Skills, so your agent can build this integration for you. Learn how.
Getting Started
Install the package
Set your API key
Get your API key at you.com/platform/api-keys.
Usage
Web search with youSearch
Use youSearch() to give a model access to structured real-time web and news results.
Content extraction with youContents
Use youContents() when the model needs to retrieve entire web page content as HTML or markdown.
Combining both tools
You can provide both tools at once and let the model decide which to use:
Passing the API key explicitly
If you prefer not to use environment variables, pass the key directly: