Web search
Summary
Ollama released a new web search API on September 24, 2025, designed to augment models with current web information, thereby reducing hallucinations and improving accuracy. This capability is available via a REST API and through deeper tool integrations in Ollama's Python and JavaScript libraries. It enables models like OpenAI's `gpt-oss` to perform extended research tasks. Ollama provides a free tier for individuals, with higher rate limits accessible through Ollama's cloud service. The article details how to get started by creating an API key and provides code examples for cURL, Python, and JavaScript to perform web searches and fetch individual page results using the `web_fetch` API. It also demonstrates building a search agent with models like Qwen 3 and outlines integrations with MCP Server, Cline, Codex, and Goose.
Key takeaway
For AI Engineers building or deploying LLM-powered applications, integrating Ollama's new web search API can significantly enhance model accuracy and reduce factual errors. You should consider using this API to provide models with real-time information, especially for tasks requiring up-to-date data or complex research. Ensure your models, like `qwen3` or `gpt-oss`, have sufficient context length (e.g., ~32000 tokens) to fully utilize search results.
Key insights
Ollama's new web search API enhances LLMs by providing real-time web data to improve accuracy and reduce hallucinations.
Principles
- Augment LLMs with external data.
- Utilize tool-use capabilities for complex tasks.
Method
Access Ollama's web search via REST API or Python/JavaScript libraries, providing a query to retrieve search results or a URL to fetch page content.
In practice
- Integrate `web_search` to reduce LLM hallucinations.
- Build search agents for long-running research.
- Increase model context length for search agents.
Topics
- Web Search API
- Ollama
- Large Language Models
- Tool Use
- AI Agents
Code references
Best for: AI Engineer, Machine Learning Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Ollama Blog.