Web Search API by Ollama Date: September 24, 2025 --- Overview Ollama introduces a new web search API designed to augment AI models with the latest web information, reducing hallucinations and improving accuracy. The API comes with: A generous free tier for individuals. Higher rate limits available via Ollama Cloud. Deep integration in Ollama’s Python and JavaScript libraries. Enables models like OpenAI’s gpt-oss to perform long-running research tasks. --- Getting Started API Key Create an API key from your Ollama account settings. --- Usage Examples cURL Sample JSON response: Python Install the library: Make a request: Example output is a list of search results with titles, URLs, and snippets. JavaScript Install the library: Usage: --- Building a Search Agent Ollama’s web search can be combined with the web fetch tool to build agents capable of tool use and multi-turn model interactions. Example uses Alibaba’s Qwen 3 model (4B parameters) Supports long conversations calling websearch and webfetch for up-to-date info Recommended models for tool use: qwen3 gpt-oss Recommended cloud models: qwen3:480b-cloud gpt-oss:120b-cloud deepseek-v3.1-cloud Suggested context length: ~32000 tokens for performance and best results --- Fetching Page Results To extract content from a specific webpage, use the web fetch API. Python Example Sample output: JavaScript Example Sample JSON output: cURL Example --- Integration with MCP Server and Third-party Clients You can enable web search in any MCP (Model Context Protocol) client via the Python MCP server example on GitHub. Cline Integration Configure MCP servers