# Search api — how to use (mcp.ai)

Connect your Search api account and use 5 tools for developer tools straight from your AI agent. Connect with your own API key. Your real-time SERP API solution. Mastering proxy management, CAPTCHAs, and JSON parsing for seamless web data extraction.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_search_api?ms=1787295780000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `search_api_get_account_info`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/search_api`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/search_api/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/search_api/get/account/info` — Tool to retrieve account usage statistics including monthly usage, remaining credits, hourly limits, and subscription period information. Use when you need to check current account status or usage lim
  - body: { zero_retention?: boolean }
- `POST https://api.mcp.ai/api/search_api/get/cached/search/by/id` — Tool to retrieve cached search results by search ID in JSON format. Use when you need to access previously executed search results without re-running the query. The search ID is found in the search_me
  - body: { search_id: string }
- `POST https://api.mcp.ai/api/search_api/get/cached/search/html/by/id` — Tool to retrieve cached search results by search ID in HTML format. Use when you need to access the raw HTML snapshot of a previous search execution. The search ID is available in the search_metadata.
  - body: { search_id: string }
- `POST https://api.mcp.ai/api/search_api/get/locations` — Tool to get available locations for geo-localized search queries. Use when you need to find location identifiers for targeting Google searches to specific geographic areas. Returns location metadata i
  - body: { q: string, limit?: integer, zero_retention?: boolean }
- `POST https://api.mcp.ai/api/search_api/search` — Tool to perform unified search across 40+ search engines including Google, Bing, Yahoo, DuckDuckGo, YouTube, Amazon, and more. Use when you need to retrieve search results with rich structured data in
  - body: { q: string, cr?: string, gl?: string, hl?: string, lr?: string, num?: integer, nfpr?: integer, page?: integer, safe?: string, uule?: string, kgmid?: string, device?: string, engine: string, filter?: integer, location?: string, time_period?: string, google_domain?: string, zero_retention?: boolean, time_period_max?: string, time_period_min?: string, optimization_strategy?: string }

## Example prompts
- "What can I do in Search api?"
- "Show me a summary of my Search api account"

## More
- Page: https://mcp.ai/search_api
- Agent spec (llms.txt): https://mcp.ai/search_api/llms.txt
- Postman collection: https://mcp.ai/search_api/postman.json
