Web search API for AI agents: how to add search, paid per call
Updated · 1ToolRing team
A web search API for AI agents lets the agent send a query and get back result titles, links and snippets it can reason over. With 1ToolRing the agent calls serpapi/google/light-search or serpapi/duckduckgo/search over MCP or REST, using one key and one prepaid balance. You pay per call, discovery and inspection are free, and a failed search costs nothing.
Agents need search for anything newer than their training data or outside it, such as a library's current version or a regulation that changed last month. Developers usually wire in one search provider, get a separate key for it, and later add a second engine with another key and another bill.
Quality problems show up later, in the answers. One phrasing finds only part of what exists, and an agent will happily quote a snippet that is accurate but answers a different question. Most of the fix is a few lines in the agent's instructions, set up once.
Paste this into your agent
Works in Claude, ChatGPT, Cursor, Codex, n8n and any MCP client. Change the placeholders, keep the row cap.
Set up 1ToolRing from 1toolring.com/install, then answer this question using web search: [your question]. Inspect the price first for serpapi/google/light-search and serpapi/duckduckgo/search. Write three different phrasings of the question, run each on Google light search and the best one on DuckDuckGo, no more than 6 searches in total. Merge the results by URL, list the 10 most relevant links with their snippets, and say which claims you could only confirm from a snippet.First time? Set up takes one command or one connector URL:
set up 1ToolRing - https://1toolring.com/llms.txtPaste this into your agent's chat (Claude Code, Codex, Cursor, ChatGPT, claude.ai). Your agent sets up 1ToolRing and you sign in.
Tools this workflow uses
Your agent finds these with discover_tools and reads each input schema and price with inspect_tool. Both are free. Only a successful run is charged.
| Tool | What it does here | Price |
|---|---|---|
serpapi/google/light-search | Returns a light list of Google organic results for a query, the default search for most agent questions. | $0.020 / callRp353 / call |
serpapi/duckduckgo/search | Returns DuckDuckGo organic results, a second engine for catching pages one index ranks low. | $0.020 / callRp353 / call |
serpapi/bing/search | Returns Bing organic results and ads, another independent index to cross-check against. | $0.020 / callRp353 / call |
dataforseo/serp/google-organic | Fetches the full Google page with every feature parsed, for when the agent needs more than links and snippets. | $0.0027 / callRp48 / call |
Step by step
- Connect the agent once. Install 1ToolRing from the install page so the agent can reach mcp.1toolring.com/mcp, or call the REST endpoints with your key. Every search engine in the catalog then runs on the same key and balance.
- Let the agent find and inspect the tool. The agent calls
discover_toolsto find search tools andinspect_toolto read the input schema and price. Both steps are free, so it can choose the right engine for the question before spending anything. - Search with more than one phrasing. Have the agent write two or three phrasings of the same question and run each one. Different wording surfaces different pages, and merging the results by URL gives a fuller set than any single query.
- Cross-check on a second engine. Run the strongest phrasing on
serpapi/duckduckgo/searchorserpapi/bing/search. Pages that only one engine shows are worth a look, and a result both engines agree on is a safer source. - Cap the spend per task. Put a search limit in the prompt or the agent's instructions, such as six searches per question. That limit is what stops a loop of many small searches. Each single run also has a spending cap: 1ToolRing holds the most it can cost before it starts and refuses a run that would go over.
- Check numbers outside the snippet. When the answer is a figure, a date or a price, have the agent say whether it saw it in a snippet only. A snippet is a short excerpt and can come from a part of the page about something else.
What does a web search API for AI agents return?
A web search API takes a query and returns a ranked list of results, each with a title, a link and a short snippet, sometimes with a date. The agent reads that list to decide what is relevant and what to cite. The fuller Google tool, dataforseo/serp/google-organic, also returns page features such as question boxes, which helps when the agent needs to know what the search engine itself shows for the query.
Which search engine should the agent use?
Start with one engine and add a second when coverage matters. Each is billed per call.
| Tool | Index | Good default for |
|---|---|---|
serpapi/google/light-search | Google organic, light response | Most factual questions and quick lookups |
serpapi/duckduckgo/search | DuckDuckGo organic | A second opinion from a different index |
serpapi/bing/search | Bing organic and ads | Cross-checks, and questions where ads show who sells something |
dataforseo/serp/google-organic | Google with every page feature parsed | Questions where the shape of the results page matters |
Is there a free web search API for agents?
1ToolRing has no free search quota. Finding and inspecting tools costs nothing, each search is charged per call at a price the agent sees first, a failed call is free, and the prepaid balance does not expire. An agent that searches a few times a day runs up a small bill that is easy to predict. See pricing for how the balance works.
What goes wrong when an agent searches the web?
These are the failures worth writing into the agent's instructions.
- One phrasing misses pages. Merge two or three phrasings by URL before the agent decides there is nothing to find.
- A filtered search can come back empty with no error. Retry without the filter before treating the result as a real absence.
- Page two is a different set of results. Ask for it only when page one does not hold the answer.
- Dates in results come in mixed formats or are missing. Treat a missing date as unknown, and do not assume the page is old.
What can a search API not do for my agent?
Search tools return results pages. Reading the full text of a page behind a link is a separate call: ask discover_tools for a page-fetch tool, and keep that step only for the few links worth reading. If the question is about structured data the catalog already covers, such as a product price, a business listing or a stock quote, call that tool directly. It returns clean fields that a search snippet only hints at.
What does it cost?
One hundred agent questions in a month, each searched with three phrasings on Google light search and cross-checked once on DuckDuckGo.
| Call | Tool | Count | USD | IDR |
|---|---|---|---|---|
| 100 questions, 3 phrasings each | serpapi/google/light-search | 300 | $5.86 | Rp105.900 |
| One cross-check per question | serpapi/duckduckgo/search | 100 | $1.95 | Rp35.300 |
| Total | $7.81 | Rp141.200 | ||
Computed from list prices as of 2026-11-10. A run is held at its maximum and settled to the real cost, and a failed call is not charged. See how pricing works.
Questions
Can I use the same key for search and other data?
Does it work with Claude Code and other MCP clients?
How do I stop an agent from running hundreds of searches?
Which engine gives the best results?
Can the agent search news instead of the whole web?
serpapi/bing/news and serpapi/duckduckgo/news return recent articles for a topic, billed per call like the web search tools. For a scheduled version, see Google news monitoring.