Get the visibility summary
Returns the Dashboard's headline scores for a period, each with the previous period's value and the change between them.
Required scope: v2:metrics.
previousValue and changePercent are null when there is nothing to compare with.
curl -X GET "https://api.opttab.com/v1/external/metrics/summary?period=7d" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://api.opttab.com/v1/external/metrics/summary?period=7d"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://api.opttab.com/v1/external/metrics/summary?period=7d", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.opttab.com/v1/external/metrics/summary?period=7d", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.opttab.com/v1/external/metrics/summary?period=7d')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"visibility": {
"value": 42,
"previousValue": 40,
"changePercent": 5
},
"sentiment": {
"value": 71,
"previousValue": 68,
"changePercent": 4.4
},
"shareOfVoice": {
"value": 18,
"previousValue": 16,
"changePercent": 12.5
},
"shareOfCitations": {
"value": 9,
"previousValue": 11,
"changePercent": -18.2
}
}
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"formErrors": [],
"fieldErrors": {
"pageSize": [
"Number must be less than or equal to 100"
]
}
}
}
{
"error": "API_KEY_INVALID",
"code": "UNAUTHORIZED"
}
{
"error": "API_KEY_SCOPE",
"code": "FORBIDDEN"
}
{
"error": "API_KEY_IP_DENIED",
"code": "FORBIDDEN"
}
{
"error": "ThrottlerException: Too Many Requests",
"code": "RATE_LIMITED"
}
/v1/external/metrics/summary
Target server for requests. Edit to use your own host.
An API key secret from Settings › API. It starts with opt_live_.
Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key
header and an ?api_key= query parameter do not authenticate.
opt_live_.
Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key
header and an ?api_key= query parameter do not authenticate.
The time window: 1d (last day), 7d, 30d, 3m, 6m or 1y.
Omitted, the window is the last seven days.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. An API key secret from Settings › API. It starts with opt_live_.
Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key
header and an ?api_key= query parameter do not authenticate.
Query Parameters
The time window: 1d (last day), 7d, 30d, 3m, 6m or 1y.
Omitted, the window is the last seven days.
1d7d30d3m6m1y