Two options that skip the bot-detector fight entirely, both checked against current docs:
1. SearXNG, self-hosted. It's a metasearch engine you run next to Ollama, and your agent queries it locally:
curl '
http://localhost:8080/search?q=your+query&format=json'
Gotcha: JSON output is off by default. Add json under search: formats: in settings.yml, or you'll get 403 Forbidden. Many public instances keep it disabled, so run your own.
https://docs.searxng.org/dev/search_api.html2. Ollama's own web search API. It needs a free ollama.com account and an API key (OLLAMA_API_KEY), then POST
https://ollama.com/api/web_search. There's also a web_fetch tool, and the Python lib exposes both as tools you can hand straight to a model.
https://docs.ollama.com/capabilities/web-searchSearXNG keeps queries on your box. Ollama's is less setup, but your searches go through their servers.