Create Audit query
curl --request POST \
--url https://app.surferseo.com/api/v1/audits \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"keyword": "How to write content that ranks?",
"url": "https://surferseo.com/",
"cache": 3600,
"device": "mobile",
"location": "United States"
}
'import requests
url = "https://app.surferseo.com/api/v1/audits"
payload = {
"keyword": "How to write content that ranks?",
"url": "https://surferseo.com/",
"cache": 3600,
"device": "mobile",
"location": "United States"
}
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: 'How to write content that ranks?',
url: 'https://surferseo.com/',
cache: 3600,
device: 'mobile',
location: 'United States'
})
};
fetch('https://app.surferseo.com/api/v1/audits', 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/audits",
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' => 'How to write content that ranks?',
'url' => 'https://surferseo.com/',
'cache' => 3600,
'device' => 'mobile',
'location' => 'United States'
]),
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/audits"
payload := strings.NewReader("{\n \"keyword\": \"How to write content that ranks?\",\n \"url\": \"https://surferseo.com/\",\n \"cache\": 3600,\n \"device\": \"mobile\",\n \"location\": \"United States\"\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/audits")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"keyword\": \"How to write content that ranks?\",\n \"url\": \"https://surferseo.com/\",\n \"cache\": 3600,\n \"device\": \"mobile\",\n \"location\": \"United States\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v1/audits")
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 \"keyword\": \"How to write content that ranks?\",\n \"url\": \"https://surferseo.com/\",\n \"cache\": 3600,\n \"device\": \"mobile\",\n \"location\": \"United States\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"permalink_hash": "G74SCitlYgE_N8iIYIxIS_US8yuUgsfx",
"state": "scheduled"
}Audit
Create Audit query
Use the id from a successful response to poll for state updates, as the process is asynchronous and might take a while to complete.
Rate limit: 10 requests/sec
POST
/
api
/
v1
/
audits
Create Audit query
curl --request POST \
--url https://app.surferseo.com/api/v1/audits \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"keyword": "How to write content that ranks?",
"url": "https://surferseo.com/",
"cache": 3600,
"device": "mobile",
"location": "United States"
}
'import requests
url = "https://app.surferseo.com/api/v1/audits"
payload = {
"keyword": "How to write content that ranks?",
"url": "https://surferseo.com/",
"cache": 3600,
"device": "mobile",
"location": "United States"
}
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: 'How to write content that ranks?',
url: 'https://surferseo.com/',
cache: 3600,
device: 'mobile',
location: 'United States'
})
};
fetch('https://app.surferseo.com/api/v1/audits', 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/audits",
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' => 'How to write content that ranks?',
'url' => 'https://surferseo.com/',
'cache' => 3600,
'device' => 'mobile',
'location' => 'United States'
]),
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/audits"
payload := strings.NewReader("{\n \"keyword\": \"How to write content that ranks?\",\n \"url\": \"https://surferseo.com/\",\n \"cache\": 3600,\n \"device\": \"mobile\",\n \"location\": \"United States\"\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/audits")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"keyword\": \"How to write content that ranks?\",\n \"url\": \"https://surferseo.com/\",\n \"cache\": 3600,\n \"device\": \"mobile\",\n \"location\": \"United States\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v1/audits")
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 \"keyword\": \"How to write content that ranks?\",\n \"url\": \"https://surferseo.com/\",\n \"cache\": 3600,\n \"device\": \"mobile\",\n \"location\": \"United States\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"permalink_hash": "G74SCitlYgE_N8iIYIxIS_US8yuUgsfx",
"state": "scheduled"
}Authorizations
Headers
Workspace ID to create the audit in. If not provided, uses the oldest active workspace.
Required range:
x >= 1Body
application/json
keyword
Minimum string length:
1Example:
"How to write content that ranks?"
URL
Pattern:
http(s?)://.*Example:
"https://surferseo.com/"
cache TTL in seconds; if provided, we will try to fetch latest, non-failed query matching the input params before creating a new one
Required range:
x >= 900Example:
3600
Available options:
mobile, desktop Location; get the list of supported locations from /api/v1/locations (no auth required)
Example:
"United States"
Response
Created
Was this page helpful?