# SerpApi Extended MCP

> SerpApi Extended provides structured access to real-time search engine results from Google, Bing, Baidu, and more. It lets your AI client pull clean, parsed data instead of messy HTML dumps. You can run global searches, validate specific geographic locations for localized queries, or check your API usage status—all through three dedicated tools.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** serp, google-search, search-api, structured-data, market-intelligence

## Description

Listen up. You don't wanna deal with raw HTML dumps from search engines. This server gives your AI client structured data—clean JSON containing titles, snippets, and links—from major players like Google, Bing, and Baidu. It bypasses the whole mess of web scraping code you used to write.

When you gotta run a search, you use the `search` tool. This is where the magic happens. You can execute global search queries in one shot across multiple engines, pulling structured data straight from the top results. Instead of getting a giant wall of garbage text, it hands you parsed JSON that's perfect for analysis.

Before you run any serious query, though, you gotta make sure your location is legit. For checking supported geography, use `get_locations`. This tool checks if a specific place name works with SerpApi and gives you the exact format you need. You can't just guess the spelling or the code; this tells you what to plug in for accurate, localized search results.

When it comes time to monitor your operation—and you always gotta monitor your usage—you use `get_account`. This tool pulls all your account details. It lets you check your plan limits and see exactly how many searches you've used against that quota. You can keep an eye on your current status before running big batches of queries, so you don't get shut down mid-task.

The entire setup is built around delivering clean SERP data. The `search` tool handles the heavy lifting by performing a live query across all those engines and giving you that structured JSON output. If location matters for your search—and it almost always does—you run `get_locations` first to validate the target coordinates, making sure every subsequent query is correctly localized.

Think of this as three specialized functions working together. You check your quota with `get_account`. You confirm your geography using `get_locations`. Then you feed those validated parameters into `search`, and boom—you get clean data ready to use in your agent's next step. It’s not just fetching results; it's giving you the structured framework for everything you need, eliminating messy scraping entirely.

## Tools

### get_account
Retrieves your SerpApi account information, letting you check plan limits and remaining searches.

### get_locations
Finds valid and supported geographic locations for use in search queries.

### search
Performs a live search query using multiple engines (Google, Bing, etc.) and returns the results as structured data.

## Prompt Examples

**Prompt:** 
```
Search for 'latest breakthroughs in quantum computing' on Google.
```

**Response:** 
```
I've performed the search. The top results include articles from Nature and MIT Technology Review discussing new error-correction methods and 1000-qubit processors. Would you like a summary of the top 3 results?
```

**Prompt:** 
```
Check my SerpApi account usage and plan details.
```

**Response:** 
```
You are currently on the 'Developer' plan. You have used 450 out of 2,500 searches this month, leaving you with 2,050 searches remaining.
```

**Prompt:** 
```
Find supported search locations for 'San Francisco'.
```

**Response:** 
```
I found several matches: 'San Francisco, California, United States', 'San Francisco, Cordoba, Argentina', and 'San Francisco, Heredia, Costa Rica'. Which one would you like to use for your search?
```

## Capabilities

### Execute global search queries
Run a single query across multiple search engines (Google, Bing, etc.), pulling structured data from the top results.

### Validate target locations
Check if a specific geographic location is supported by SerpApi and get its precise format for accurate searches.

### Monitor API usage limits
Retrieve your current account status, showing how many searches you've used against your plan limit.

### Extract structured SERP data
Receive clean, parsed JSON data containing titles, snippets, and links, eliminating the need to write web scraping code.

## Use Cases

### Checking Competitor Reach in India
A marketer needs to see how a competitor ranks for 'best CRM software' specifically in Mumbai. They first run `get_locations` to confirm the correct locale, then use that validated data in `search`. The agent returns structured results showing rankings from multiple engines.

### Training an LLM on Web Snippets
A data scientist needs thousands of clean web snippets for a training set. They call the `search` tool repeatedly, instructing it to output only the title, snippet, and URL. This structured stream of data feeds directly into their model pipeline.

### Verifying Target Market Viability
A product team is considering launching in Vietnam. They use `get_locations` to verify 'Vietnam' is supported. Once confirmed, they run a sample search via `search` to gauge the current search landscape and language requirements.

### Running Large-Scale SEO Audits
An SEO specialist needs to check 50 keywords across 10 different countries. They first use `get_account` to ensure they have enough quota, then loop through the locations and run structured searches using the `search` tool for each combination.

## Benefits

- Global Search Coverage: You don't need to hit multiple APIs. The `search` tool runs queries across major engines (Google, Bing) in one go.
- Validated Locations: Before querying a new country, run `get_locations`. This validates the target area and prevents failed searches due to incorrect formatting.
- Structured Output: Instead of getting messy HTML you have to parse, you get clean JSON. This is critical for data science workflows.
- Usage Tracking: The `get_account` tool gives immediate visibility into your API limits, so you never run out of quota halfway through a project.
- Efficiency Over Scraping: You bypass the complexity and fragility of building web scrapers entirely; it's all an API call.

## How It Works

The bottom line is, you tell your agent what you need—whether it's a global search or a status check—and it uses these tools to gather clean data for you.

1. Subscribe to this server and input your SerpApi API Key into your client.
2. Run `get_locations` if you're targeting a specific area, or run `get_account` to check your current usage limits. This ensures the inputs for your main query are valid.
3. Use the gathered data (like an approved location) in the `search` tool to perform the final query and get structured results.

## Frequently Asked Questions

**Can I search on engines other than Google?**
Yes! Use the `search` tool and specify the `engine` parameter. Supported engines include Bing, Baidu, DuckDuckGo, Yahoo, and many others.

**How do I check my remaining API credits?**
Run the `get_account` tool. Your agent will retrieve your current plan details, total searches, and remaining credits for the current billing cycle.

**How do I find the correct location string for a localized search?**
Use the `get_locations` tool with a search prefix (e.g., 'New York'). It will return a list of valid location strings that you can then pass into the `search` tool.

**How does the 'search' tool return structured data instead of raw HTML?**
The search tool parses and returns clean, usable data directly. Instead of messy web page code, you get organized JSON objects containing specific details like titles, snippets, and URLs for every result. This format makes it easy for your agent to ingest and analyze the information without complex parsing scripts.

**What do I need to provide when setting up the MCP server connection?**
You must supply a valid SerpApi API Key during setup. Your AI client uses this key to authenticate your requests with our service. This ensures that every search you run is properly attributed and counted against your account usage.

**If my searches fail due to hitting a limit, what does the 'get_account' tool help me determine?**
The get_account tool shows your real-time plan status. If you hit a rate limit or exceed your monthly cap, the output will indicate exactly how many searches you used and which specific metric is maxed out. This lets you know when to pause or upgrade your plan.

**Can I use the 'search' tool for general topics that aren't tied to a specific location?**
Yes, you can run global queries without needing a strict location string. While we support localization, the search function handles broad web searches across multiple engines regardless of geography. Just keep in mind that highly localized results will require using 'get_locations' first.

**I ran into an error after using 'get_locations'; what should I check?**
First, double-check the spelling and format of your input query. If a location isn't recognized, it usually means the string doesn't match one of the supported formats. You may need to simplify your search term or try an alternative format.