Get Competitive Brand Sentiment
curl --request GET \
--url https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions \
--header 'Authorization: <authorization>'import requests
url = "https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions', 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.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"brandName": "<string>",
"positiveSentiment": 123,
"neutralSentiment": 123,
"negativeSentiment": 123,
"topPositiveKeyword": "<string>",
"topPositiveKeywordCount": 123,
"topPositiveKeywordThemeId": "<string>",
"topPositiveKeywordId": "<string>",
"topNegativeKeyword": "<string>",
"topNegativeKeywordCount": 123,
"topNegativeKeywordThemeId": "<string>",
"topNegativeKeywordId": "<string>"
}Sentiment
Get Competitive Brand Sentiment
Compare sentiment across competing brands mentioned in AI responses.
GET
/
ai-analytics-service
/
api
/
public
/
v1
/
sentiment
/
competitive-brand
/
mentions
Get Competitive Brand Sentiment
curl --request GET \
--url https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions \
--header 'Authorization: <authorization>'import requests
url = "https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions', 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.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"brandName": "<string>",
"positiveSentiment": 123,
"neutralSentiment": 123,
"negativeSentiment": 123,
"topPositiveKeyword": "<string>",
"topPositiveKeywordCount": 123,
"topPositiveKeywordThemeId": "<string>",
"topPositiveKeywordId": "<string>",
"topNegativeKeyword": "<string>",
"topNegativeKeywordCount": 123,
"topNegativeKeywordThemeId": "<string>",
"topNegativeKeywordId": "<string>"
}Returns sentiment data grouped by competing brand. Each brand entry includes positive, neutral, and negative mention counts along with the top positive and negative keywords driving sentiment.
Parameters
string
required
Bearer token. Format:
Bearer slat_<your-token>.integer
Number of days for the analysis window. Range: 1–365. Default:
30.string
Start of date range. RFC 3339 timestamp (e.g.,
2026-02-01T00:00:00Z). Send together with to.string
End of date range. RFC 3339 timestamp. Send together with
from. Data through the end of this date (UTC) is included. The range can’t exceed 366 days.number
Filter by topic ID.
number
Filter by brand ID. If omitted, uses the brand of the workspace’s most recently updated prompt.
string[]
Filter by one or more platforms:
CHATGPT, PERPLEXITY, GOOGLE_AI_OVERVIEW, GOOGLE_AI_MODE, GEMINI, CLAUDE.string
Filter by ISO country code for region.
number
Filter by a single prompt ID.
number[]
Filter by multiple prompt IDs. Maximum 500 values.
Response
Returns200 OK with a JSON array of brand sentiment objects, most-mentioned brands first. Each object has these fields:
string
required
Name of the mentioned brand.
integer
required
Positive mention count.
integer
required
Neutral mention count.
integer
required
Negative mention count.
string
Most frequent positive keyword for the brand. The four
topPositiveKeyword* fields are an empty string (or 0 for the count) when the brand has no positive keywords.integer
Count of the top positive keyword.
string
Theme ID of the top positive keyword.
string
Keyword ID of the top positive keyword.
string
Most frequent negative keyword for the brand. The four
topNegativeKeyword* fields are an empty string (or 0 for the count) when the brand has no negative keywords.integer
Count of the top negative keyword.
string
Theme ID of the top negative keyword.
string
Keyword ID of the top negative keyword.
Example
curl -s "https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions?dateRange=30&topicId=42" \
-H "Authorization: Bearer slat_YOUR_TOKEN"
import requests
response = requests.get(
"https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions",
headers={
"Authorization": "Bearer slat_YOUR_TOKEN",
},
params={
"dateRange": 30,
"topicId": 42,
},
)
brands = response.json()
for b in brands:
total = b["positiveSentiment"] + b["neutralSentiment"] + b["negativeSentiment"]
print(f"{b['brandName']}: {total} mentions, top positive: {b.get('topPositiveKeyword')}")
const params = new URLSearchParams({
dateRange: "30",
topicId: "42",
});
const response = await fetch(
`https://api.slatehq.ai/ai-analytics-service/api/public/v1/sentiment/competitive-brand/mentions?${params}`,
{
headers: {
"Authorization": "Bearer slat_YOUR_TOKEN",
},
}
);
const brands = await response.json();
console.log(brands.length, "brands found");
Response
[
{
"brandName": "MyBrand",
"positiveSentiment": 85,
"neutralSentiment": 45,
"negativeSentiment": 12,
"topPositiveKeyword": "ease of use",
"topPositiveKeywordCount": 28,
"topPositiveKeywordThemeId": "theme-abc-123",
"topPositiveKeywordId": "kw-001",
"topNegativeKeyword": "pricing",
"topNegativeKeywordCount": 8,
"topNegativeKeywordThemeId": "theme-def-456",
"topNegativeKeywordId": "kw-010"
},
{
"brandName": "CompetitorA",
"positiveSentiment": 60,
"neutralSentiment": 50,
"negativeSentiment": 20,
"topPositiveKeyword": "integration options",
"topPositiveKeywordCount": 15,
"topPositiveKeywordThemeId": "theme-abc-123",
"topPositiveKeywordId": "kw-003",
"topNegativeKeyword": "learning curve",
"topNegativeKeywordCount": 12,
"topNegativeKeywordThemeId": "theme-ghi-789",
"topNegativeKeywordId": "kw-015"
}
]
Status codes
| Status | Description |
|---|---|
200 | Brand sentiment data returned. |
400 | A filter is invalid, such as more than 500 promptIds, an unsupported platform, dateRange outside 1–365, or an invalid from/to range. |
401 | Missing or invalid Bearer token. See Authentication. |
500 | Internal server error. |
503 | The analytics store is temporarily unavailable (analytics store unavailable). |
What’s next
- Get Competitive Theme Sentiment — View sentiment by brand and theme.
- Get Overall Sentiment — View aggregated sentiment.
Was this page helpful?