reporting
A reporting view's metrics for a period
One of: rankings, ai-overviews, backlinks, site-audit, web-vitals, ai-visibility, local-seo, domain. For each metric asked for (every one when metrics is left out): value on the last day with data on or before date_end; previous on the last day with data before date_start, the previous period’s close; change and change_percent between them; and series, a point per day with data in the period. Null where there is no data. From stored data only — nothing here calls DataForSEO or spends an allowance, so a read-only key is enough. Works on the sample project.
GET
/
v1
/
projects
/
{projectId}
/
reporting
/
{view}
A reporting view's metrics for a period
curl --request GET \
--url https://api.surnex.io/v1/projects/{projectId}/reporting/{view}import requests
url = "https://api.surnex.io/v1/projects/{projectId}/reporting/{view}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.surnex.io/v1/projects/{projectId}/reporting/{view}', 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://api.surnex.io/v1/projects/{projectId}/reporting/{view}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.surnex.io/v1/projects/{projectId}/reporting/{view}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.surnex.io/v1/projects/{projectId}/reporting/{view}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.surnex.io/v1/projects/{projectId}/reporting/{view}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"view": "rankings",
"label": "<string>",
"history": true,
"date_start": "2023-12-25",
"date_end": "2023-12-25",
"metrics": {}
}
}{}Path Parameters
Available options:
rankings, ai-overviews, backlinks, site-audit, web-vitals, ai-visibility, local-seo, domain Query Parameters
Maximum string length:
500⌘I
A reporting view's metrics for a period
curl --request GET \
--url https://api.surnex.io/v1/projects/{projectId}/reporting/{view}import requests
url = "https://api.surnex.io/v1/projects/{projectId}/reporting/{view}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.surnex.io/v1/projects/{projectId}/reporting/{view}', 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://api.surnex.io/v1/projects/{projectId}/reporting/{view}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.surnex.io/v1/projects/{projectId}/reporting/{view}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.surnex.io/v1/projects/{projectId}/reporting/{view}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.surnex.io/v1/projects/{projectId}/reporting/{view}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"view": "rankings",
"label": "<string>",
"history": true,
"date_start": "2023-12-25",
"date_end": "2023-12-25",
"metrics": {}
}
}{}