Ollama Web Search and Web Fetch API Release

Ollama has introduced a new web search API and a web fetch API, allowing large language models (LLMs) to access real-time information from the internet. These tools are designed to reduce hallucinations and improve the accuracy of model responses by augmenting them with the latest web data.

Web Search and Web Fetch Capabilities

Ollama now provides two primary tools for web interaction: a search API for discovering information and a fetch API for extracting content from specific URLs.

Web Search API

The web search API allows models to query the internet and receive a list of relevant results. It is available as a REST API and is integrated into Ollama's Python and JavaScript libraries. This capability enables models, such as the gpt-oss series, to perform long-running research tasks.

Web Fetch API

The web fetch API is used to retrieve the content of individual pages. This is particularly useful when a user provides a specific URL in a prompt or when a search agent needs to dive deeper into a specific search result.

Technical Implementation and Integration

Ollama provides multiple ways to implement these search and fetch capabilities into existing workflows.

API and Library Access

Users can access these features via:

  • REST API: Using cURL requests to https://ollama.com/api/web_search and https://ollama.com/api/web_fetch.
  • Python Library: Using ollama.web_search and ollama.web_fetch (requires ollama>=0.6.0).
  • JavaScript Library: Using client.webSearch and client.webFetch (requires ollama@>=0.6.0).

Building Search Agents

Ollama suggests using these tools in combination with models that have strong tool-use capabilities. Recommended models include qwen3 and gpt-oss, with cloud-based options such as qwen3:480b-cloud, gpt-oss:120b-cloud, and deepseek-v3.1-cloud.

For optimal performance when building search agents, Ollama recommends increasing the model's context length to approximately 32,000 tokens, as search and fetch results can return thousands of tokens.

Ecosystem Integrations

Ollama has enabled integration with the Model Context Protocol (MCP) to extend web search capabilities to other AI clients.

MCP Server Support

Through a Python MCP server, web search can be enabled in any MCP-compatible client. Specific integration instructions are provided for:

  • Cline: Configured via MCP server settings using uv to run the MCP server script.
  • Codex: Configured via the ~/.codex/config.toml file.
  • Goose: Integrated via Goose's extensions.

Pricing and Access

Web search is available to individuals through a generous free tier associated with an Ollama account. Higher rate limits are available for users who upgrade via Ollama's cloud subscription.

Sources

Related