Web Search





Pattern
Web Search Tool
Search the web using OpenAI's tool with real-time results. Includes source verification, citation tracking, and contextual answers.
BeginnerOct 2025View the full pattern on desktop


Problems solved
- Force OpenAI web_search_preview on every query
- Return AI-synthesized answers grounded in web search
- Configure search context size and optional user location
Use cases
- Web search answer boxes
- Research lookup tools
- Local-aware search demos
- OpenAI web search integration samples
AI SDK APIs
generateTexttools:
Tags
aiwebsearchopenai
Requirements
- Node.js
- >=18.0.0
Environment variables
OPENAI_API_KEYGet key
External services
openai
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View the pattern on desktopRelated patterns


Claude Web Search Tool
Search the web with Claude AI. Includes result filtering, multiple search types, and language support.
aiwebsearch+7
View pattern β


Firecrawl Scrape Tool Chat
Crawl and extract content using Firecrawl's API. Includes URL processing, markdown conversion, and structured data extraction.
aiwebsearch+8
View pattern β



