Create a batch of SERP Analyzer queries
curl --request POST \
--url https://app.surferseo.com/api/v1/serp_analyzers/batch \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"keyword": "SEO"
},
{
"keyword": "SurferSEO"
}
]
'import requests
url = "https://app.surferseo.com/api/v1/serp_analyzers/batch"
payload = [{ "keyword": "SEO" }, { "keyword": "SurferSEO" }]
headers = {
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{keyword: 'SEO'}, {keyword: 'SurferSEO'}])
};
fetch('https://app.surferseo.com/api/v1/serp_analyzers/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.surferseo.com/api/v1/serp_analyzers/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'keyword' => 'SEO'
],
[
'keyword' => 'SurferSEO'
]
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.surferseo.com/api/v1/serp_analyzers/batch"
payload := strings.NewReader("[\n {\n \"keyword\": \"SEO\"\n },\n {\n \"keyword\": \"SurferSEO\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.surferseo.com/api/v1/serp_analyzers/batch")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"keyword\": \"SEO\"\n },\n {\n \"keyword\": \"SurferSEO\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v1/serp_analyzers/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"keyword\": \"SEO\"\n },\n {\n \"keyword\": \"SurferSEO\"\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": 1,
"state": "scheduled"
},
{
"error": "quota_exceeded",
"input": {
"keyword": "SurferSEO"
}
}
]SERP Analyzer
Create a batch of SERP Analyzer queries
Rate limits:
- 10 requests/min
- each query created will count against your daily limit. Fair Use Policy applies, by default 100 queries a day.
POST
/
api
/
v1
/
serp_analyzers
/
batch
Create a batch of SERP Analyzer queries
curl --request POST \
--url https://app.surferseo.com/api/v1/serp_analyzers/batch \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"keyword": "SEO"
},
{
"keyword": "SurferSEO"
}
]
'import requests
url = "https://app.surferseo.com/api/v1/serp_analyzers/batch"
payload = [{ "keyword": "SEO" }, { "keyword": "SurferSEO" }]
headers = {
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{keyword: 'SEO'}, {keyword: 'SurferSEO'}])
};
fetch('https://app.surferseo.com/api/v1/serp_analyzers/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.surferseo.com/api/v1/serp_analyzers/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'keyword' => 'SEO'
],
[
'keyword' => 'SurferSEO'
]
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.surferseo.com/api/v1/serp_analyzers/batch"
payload := strings.NewReader("[\n {\n \"keyword\": \"SEO\"\n },\n {\n \"keyword\": \"SurferSEO\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.surferseo.com/api/v1/serp_analyzers/batch")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"keyword\": \"SEO\"\n },\n {\n \"keyword\": \"SurferSEO\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v1/serp_analyzers/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"keyword\": \"SEO\"\n },\n {\n \"keyword\": \"SurferSEO\"\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": 1,
"state": "scheduled"
},
{
"error": "quota_exceeded",
"input": {
"keyword": "SurferSEO"
}
}
]Authorizations
Headers
Workspace ID to create the queries in. If not provided, uses the oldest active workspace.
Required range:
x >= 1Body
application/json
Minimum array length:
1keyword
Minimum string length:
1Example:
"How to write content that ranks?"
Available options:
mobile, desktop Location; get the list of supported locations from /api/v1/locations (no auth required)
Example:
"United States"
Toggles creating screenshots of pages from the SERP
Example:
[
{ "keyword": "SEO" },
{ "keyword": "SurferSEO" }
]
Was this page helpful?