> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fetchserp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Start using the fetchSERP API in minutes

Welcome to the fetchSERP API! This quick-start guide walks you through every way you can call our endpoints—cURL, official SDKs, and LLM integrations—so you can be productive right away.

## 1. Get your API token

1. Sign up or log in at [www.fetchserp.com](https://www.fetchserp.com)
2. Copy your **API token** from the dashboard
3. Save it as an environment variable (recommended):

```bash theme={null}
export FETCHSERP_API_TOKEN="YOUR_API_TOKEN"
```

## 2. Your first request (cURL)

```bash theme={null}
curl -X GET "https://www.fetchserp.com/api/v1/serp" \ 
  -G \
  -d "search_engine=google" \
  -d "country=us" \
  -d "pages_number=1" \
  -d "query=serp+api" \
  -H "accept: application/json" \
  -H "authorization: Bearer $FETCHSERP_API_TOKEN"
```

You should receive a **200 OK** response with structured search results.

***

## 3. Use the official SDKs

### JavaScript / TypeScript

```bash theme={null}
npm install fetchserp
```

```javascript theme={null}
import FetchSERP from 'fetchserp';

const client = new FetchSERP(process.env.FETCHSERP_API_TOKEN);
const results = await client.serp({
  query: 'serp api',
  search_engine: 'google',
  country: 'us',
  pages_number: 1
});
console.log(results.data);
```

### Python

```bash theme={null}
pip install fetchserp
```

```python theme={null}
from fetchserp import FetchSERP

client = FetchSERP()
client.api_key = os.environ['FETCHSERP_API_TOKEN']
results = client.serp(query="serp api", search_engine="google", country="us", pages_number=1)
print(results["data"])
```

### Ruby

```bash theme={null}
gem install fetchserp
```

```ruby theme={null}
require 'fetchserp'

client = FetchSERP::Client.new(api_key: ENV['FETCHSERP_API_TOKEN'])
results = client.serp(query: 'serp api', search_engine: 'google', country: 'us', pages_number: 1)
puts results['data']
```

***

## 4. Integrate with LLMs via MCP

fetchSERP offers a [Model Context Protocol](https://github.com/model-context) server so you can give LLMs direct access to real-time SEO data.

### Claude API Example

```javascript theme={null}
const claudeRequest = {
  model: 'claude-sonnet-4-20250514',
  messages: [{ role: 'user', content: 'Show me the top keywords for fetchserp.com' }],
  mcp_servers: [
    {
      type: 'url',
      url: 'https://www.fetchserp.com/mcp',
      name: 'fetchserp',
      authorization_token: process.env.FETCHSERP_API_TOKEN,
      tool_configuration: { enabled: true }
    }
  ]
};
```

### OpenAI API Example

```javascript theme={null}
let response = await openai.responses.create({
  model: 'gpt-4o',
  tools: [
    {
      type: 'mcp',
      server_label: 'fetchserp',
      server_url: process.env.MCP_SERVER_URL,
      headers: {
        Authorization: `Bearer ${process.env.FETCHSERP_API_TOKEN}`
      }
    }
  ],
  input: 'Find low-competition keywords for "seo api"'
});
```

***

## Next steps

* Explore the [Endpoints](/api-reference/introduction) for full parameter details
* Check out real-world [Use Cases](/guides/use-cases)
* Read about [Pricing](/pricing) and start with **250 free credits**

Happy querying! 😎
