This is a comparison of web search APIs (SERP APIs) for LLM-based AI agents.
Why Use a Search API With an AI Agent?
You may need a web search API if you’re building an AI agent and want it to be able to search for information on the web.
How Do AI Agents Use Web Search APIs?
If you’re developing an AI agent, you’ll typically want it to make use of web search APIs through functionality baked into LLMs known as ‘tool-calling’, ‘tool-use’ or ‘function-calling’.
Frameworks such as LangChain have support for tool-/function-calling and have off-the-shelf integrations with some of the APIs (e.g. this one for Tavily and this one for YOU.com.) If an integration isn’t already available, it’s typically fairly simple to build one.
Web Search API Pricing
Name | Free Tier | Lowest-Volume Paid Tier | Lowest Advertised Cost* (at Scale) | Notes |
---|---|---|---|---|
Serper | 2500 calls | $50 (valid for 6 months) | 0.03¢/call | |
Tavily | 1000 calls/month | $100/month | 0.6¢/call | Limited to 100 requests/minute |
YOU | 1000 calls/month for 60 days | $100/month | 0.8¢/call | |
Brave | 2000 calls/month 1 call/second | Pay-as-you-go (0.5¢/call) | 0.5¢/call | |
Exa | $10 of free credits | Pay-as-you-go (0.25¢/call) | 0.25¢/call |
What to Consider When Choosing a Web Search API
- Relevance of search results – different services use different search engines to retrieve their results. Just as you may prefer Google search over Bing search when you’re searching manually, you may prefer the results from one web search API over those from another.
- Content of each search result – different services return different information for each search result and this can have a big impact on the effectiveness of your agent. You may, for example, prefer services that include relatively long snippets of content.
- Pricing – unsurprisingly, different services have different prices. Note that some services have optional parameters that can significantly impact pricing, e.g. doubling the effective cost of requests.
- Other terms and conditions – depending on the nature of your business, factors such as the providers’ privacy policies may be very important.