The Serpstack API is extremely easy to use. It only takes a few lines of code to make your first validation request. All registered users, whether on a free or paid plan, can use our Quickstart Guide to explore the full range of API functionalities with just one click.
- Existing users: Access the Quickstart Guide below.
- New users: Create an account and get started in minutes.
Step 1: Get Your API Access Key
Sign up for a free or paid plan to receive your unique access_key. This key is how you authenticate every API request.
This key authenticates your requests and ensures you have access to the API features available under your subscription plan.
Step 2: Make a Request
Send an HTTP GET request to the Serpstack search endpoint:
https://api.apilayer.net/serpstack/search?access_key=YOUR_ACCESS_KEY&query=your+search+termBy default, this returns Google search results in JSON format.
Example (curl):
curl "https://api.apilayer.net/serpstack/search?access_key=YOUR_ACCESS_KEY&query=coffee+shops"Step 3: Interpret the Response
Serpstack returns structured JSON data. Key fields include:
| Field | Description |
|---|---|
search_information | Metadata about the request (time taken, total results, detected location) |
organic_results | Array of organic search results (title, URL, snippet) |
pagination | Info about next / previous pages of results |
answer_box | If Google provides a featured snippet or direct answer |
You can also request a CSV format by adding &output=csv to your query.
Step 4: Integrate With Your Application
Use Serpstack inside your project with just a few lines of code.
Python Example
import requests
params = {
'access_key': 'YOUR_ACCESS_KEY',
'query': 'best pizza in New York'
}
response = requests.get('https://api.apilayer.net/serpstack/search', params=params)
print(response.json())Node.js Example
const fetch = require('node-fetch');
fetch("https://api.apilayer.net/serpstack/search?access_key=YOUR_ACCESS_KEY&query=weather+today")
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Step 5: You're Ready to Go!
You can now:
- Add parameters like
type=images,device=mobile, orlocation=New York - Switch output formats (
JSONorCSV) - Build SEO tools, dashboards, automations, or data pipelines using real-time SERP data.
Support & Resources
- Explore commonly used API calls and examples to get the most out of your integration.
- For any assistance, contact our support team anytime.