Repository navigation
en use websearch serpapi
SerpApi provides structured, real-time search data from Google, Bing, Baidu and other search engines, helping AI agents access real-time information without managing web scraping infrastructure.
This page covers SerpApi setup and usage. See Web Search for general prerequisites, provider comparisons, and troubleshooting.
- Open SerpApi and create an account or sign in.
- Open the API key page and copy your key.
- Check that your SerpApi account has search quota available. Refer to SerpApi's website and your account for current quotas, billing, and service access.
Your conversation must use AstrBot Built-in AI, and both the chat model and its API must support tool calling. The server or container running AstrBot must be able to reach https://serpapi.com.
- Open
Configin the sidebar and select the profile your conversation actually uses. - Open
AI → Capabilities → Web Searchand turn onEnable Web Search. - Set
Web Search Providertoserpapi. - Add your key to the
SerpApi API Keylist. One key enables all four capabilities below; you can also add multiple keys for rotation. - Click
Save Configurationat the bottom right.
These settings apply only to the selected profile. Multiple keys rotate, and authentication or quota errors trigger a retry with the next key.
| Capability | SerpApi endpoint | Content returned by AstrBot |
|---|---|---|
| Web search | Google Search API | Titles, source URLs, and snippets from the first page; up to 5 results by default, with a requested maximum of 10 |
| Image search | Google Images Light API | Direct image URLs, thumbnails, source pages, and available dimensions; up to 5 images by default, with a requested maximum of 10 |
| Finance queries | Google Finance API | Available quotes, currencies, timestamps, financial data, and news; a history window returns the quote summary and available price series |
| Academic search | Google Scholar API | Publication titles, snippets, publication details, citation counts, and available full-text links; up to 5 publications by default, with a requested maximum of 20 |
The actual number of results and available fields depend on the search response and may be fewer than requested. Web and image search support country and interface language settings. Web search also supports a search location, and academic search supports publication year filters. Include these requirements in your message so the model can pass them to the tool.
After saving, send the bot or ChatUI an explicit search request. The model chooses the tool and its parameters. Ask it to “search first, then answer” when you want an answer based on search results.
Search for AstrBot's latest release. Give the version, summarize the main changes, and include source links.
Web search returns titles, links, and snippets without automatically reading full pages. AstrBot's SerpApi integration does not provide a page extraction tool. If you often need to summarize a specific URL, choose a service with page extraction from the provider comparison.
Find three images of coffee and include their source pages.
Image results include direct image URLs and source pages. Displaying or sending an image depends on the model's subsequent actions and the messaging platform.
Look up AAPL:NASDAQ on Google Finance and include the quote timestamp.
Finance accepts symbols such as AAPL:NASDAQ, .INX:INDEXSP, BTC-USD, and EUR-USD. Specify a time range when you need historical prices:
Look up the past month of price history for AAPL:NASDAQ on Google Finance and include the source.
Supported history windows are 1D, 5D, 1M, 6M, YTD, 1Y, 5Y, and MAX. With a history window, the API returns the quote summary and available price series instead of full financial data and news.
Search Google Scholar for retrieval augmented generation papers published since 2023. Include citation counts and available PDF links.
You can specify a publication year range and request up to 20 publications. Snippets are not the full papers; PDF and other full-text links are returned only when available in the search response.
Confirm that you entered a SerpApi key and check your remaining account quota. Inspect the error under Data & Logs → Logs. For timeouts, check whether the AstrBot environment can reach the SerpApi API. See Web Search troubleshooting for general checks.
Confirm that Web Search is enabled for the active profile, the provider is serpapi, and the key has been saved. Try the corresponding example above and explicitly request image search, Google Finance, or Google Scholar. All four tools share the same configuration, with no extra switch required; the model still decides whether to call them.
- 首页
- 文档入口
- Top Level
- community events
- config
- deploy
- dev
- others
- platform
- 接入 OneBot v11 协议实现
- 接入钉钉 DingTalk
- 接入 Discord
- 接入 Kook
- 接入飞书
- 接入 LINE
- 接入 Matrix
- 接入 Mattermost
- 接入 Misskey 平台
- 接入 QQ 官方机器人平台
- 通过 QQ官方机器人 接入 QQ (Webhook)
- 通过 QQ官方机器人 接入 QQ (Websockets)
- 接入 Satori 协议
- 接入 server-satori (基于 Koishi)
- 接入 Slack
- 接入消息平台
- 接入 Telegram
- 接入 VoceChat
- AstrBot 接入企业微信
- 接入企业微信智能机器人平台
- AstrBot 接入微信公众平台
- 接入个人微信
- providers
- use
- Home
- Docs Entry
- Top Level
- config
- deploy
- Deploy AstrBot on 1Panel
- Deploy AstrBot on BT Panel
- Deploy AstrBot on CasaOS
- Deploy AstrBot from Source Code
- Community-Provided Deployment Methods
- Deploy via Compshare
- Deploy with AstrBot Desktop Client
- Deploy AstrBot with Docker
- Deploy AstrBot with Kubernetes
- Deploy AstrBot with AstrBot Launcher
- Other Deployments
- Script Deployment
- Installation via System Package Manager
- Preface
- dev
- AstrBot Configuration File
- API Scope–Endpoint Reference
- AstrBot HTTP API
- AstrBot Plugin Market JSON Specification
- Developing a Platform Adapter
- plugin
- AI
- Text to Image
- Handling Message Events
- Plugin Configuration
- Plugin Internationalization
- Plugin Views
- Sending Messages
- Session Control
- Minimal Example
- Plugin Storage
- AstrBot Plugin Development Guide 🌠
- Publishing Plugins to the Plugin Marketplace
- ospp
- others
- platform
- Connect OneBot v11 Protocol Implementations
- Connect to DingTalk
- Connecting to Discord
- Connect to KOOK
- Connecting to Lark
- Connecting to LINE
- Connecting to Matrix
- Connecting to Mattermost
- Connecting to Misskey Platform
- Connect QQ Official Bot
- Connect QQ via QQ Official Bot (Webhook)
- Connect QQ via QQ Official Bot (Websockets)
- Connect to Satori Protocol
- Connect server-satori (Koishi)
- Connecting to Slack
- Messaging Platforms
- Connecting to Telegram
- Connect to VoceChat
- Connect AstrBot to WeCom
- Connect to WeCom AI Bot Platform
- Connect AstrBot to WeChat Official Account Platform
- Connect Personal WeChat
- providers
- Connect 302.AI
- Agent Runners
- Built-in Agent Runner
- Connect to Coze
- Connect to Alibaba Cloud Bailian Application
- Connect to DeerFlow
- Connect to Dify
- Connect AIHubMix
- coze
- dashscope
- dify
- Model input images
- Large Language Model Providers
- Connect MiraRouter
- NewAPI
- Connect PPIO Cloud
- Connect LM Studio to Use DeepSeek-R1 and Other Models
- Integrating Ollama
- Connect ShengSuanYun
- Connecting to SiliconFlow
- Connecting Model Services
- Connecting to TokenPony
- use
- Agent Execution Mode {#agent-runner}
- Agent Sandbox Environment
- astrbot sandbox
- AstrBot CLI {#cli-commands}
- Docker-based Code Interpreter
- Built-in Commands
- computer
- Context Compression
- Custom Rules
- AstrBot Knowledge Base
- MCP
- AstrBot Plugins {#astrbot-star}
- Proactive Capabilities
- Skills {#anthropic-skills}
- SubAgent Orchestration {#agent-handoff-and-subagent}
- Unified Webhook Mode
- Web Search
- DeepSeek Search API
- SerpApi
- WebUI