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
- Sign up or log in at www.fetchserp.com
- Copy your API token from the dashboard
- Save it as an environment variable (recommended):
export FETCHSERP_API_TOKEN="YOUR_API_TOKEN"
2. Your first request (cURL)
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
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
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
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 server so you can give LLMs direct access to real-time SEO data.
Claude API Example
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
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 for full parameter details
- Check out real-world Use Cases
- Read about Pricing and start with 250 free credits
Happy querying! 😎