Get Answer
curl --request GET \
--url https://api.example.com/api/v1/brands/{brandId}/answers/{answerId}import requests
url = "https://api.example.com/api/v1/brands/{brandId}/answers/{answerId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/brands/{brandId}/answers/{answerId}', 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.example.com/api/v1/brands/{brandId}/answers/{answerId}",
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.example.com/api/v1/brands/{brandId}/answers/{answerId}"
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.example.com/api/v1/brands/{brandId}/answers/{answerId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/brands/{brandId}/answers/{answerId}")
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,
"answer": {
"id": "<string>",
"prompt": {},
"provider": "<string>",
"model": "<string>",
"text": "<string>",
"competitors": [
{}
],
"sources": [
{}
],
"sentiment": 123,
"createdAt": "<string>"
}
}Answers
Get Answer
Retrieve a single AI response with full text and detailed analysis
GET
/
api
/
v1
/
brands
/
{brandId}
/
answers
/
{answerId}
Get Answer
curl --request GET \
--url https://api.example.com/api/v1/brands/{brandId}/answers/{answerId}import requests
url = "https://api.example.com/api/v1/brands/{brandId}/answers/{answerId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/brands/{brandId}/answers/{answerId}', 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.example.com/api/v1/brands/{brandId}/answers/{answerId}",
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.example.com/api/v1/brands/{brandId}/answers/{answerId}"
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.example.com/api/v1/brands/{brandId}/answers/{answerId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/brands/{brandId}/answers/{answerId}")
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,
"answer": {
"id": "<string>",
"prompt": {},
"provider": "<string>",
"model": "<string>",
"text": "<string>",
"competitors": [
{}
],
"sources": [
{}
],
"sentiment": 123,
"createdAt": "<string>"
}
}Retrieve the complete response with full text, detected competitor mentions, cited sources, and sentiment.
Path Parameters
The unique identifier of the brand
The unique identifier of the answer
Response
Indicates if the request was successful
Show Full answer details
Show Full answer details
Answer ID
Associated prompt info (id, text, topic, type)
AI provider name
AI model name
Full response text
List of mentioned competitors with position, relationship, and sentiment
List of cited sources with URL, domain, position, and isSelf flag
Overall sentiment score
Generation timestamp
Example Request
curl -X GET "https://www.qwairy.co/api/v1/brands/cm1234567890abcdef/answers/ans1" \
-H "Authorization: Bearer qw-api-your-token-here"
Example Response
{
"success": true,
"answer": {
"id": "ans1",
"prompt": {
"id": "q1",
"text": "What are the best products in this category?",
"topic": "Product Reviews",
"type": "TOFU"
},
"provider": "ChatGPT",
"model": "GPT-4o",
"text": "Based on recent reviews and comparisons, several products stand out in this category. My Brand offers one of the best solutions with excellent performance and user ratings. Competitor A also provides a strong alternative...",
"competitors": [
{
"name": "My Brand",
"position": 3,
"relationship": "SELF",
"sentiment": 85
},
{
"name": "Competitor A",
"position": 1,
"relationship": "DIRECT",
"sentiment": 80
}
],
"sources": [
{
"url": "https://industry-news.com/product-comparison",
"domain": "industry-news.com",
"position": 1,
"isSelf": false
},
{
"url": "https://mybrand.com/products",
"domain": "mybrand.com",
"position": 2,
"isSelf": true
}
],
"sentiment": 82,
"createdAt": "2024-12-19T10:00:00.000Z"
}
}
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_PARAMETER | Invalid query parameter |
| 401 | INVALID_TOKEN | Authentication failed |
| 404 | BRAND_NOT_FOUND | Brand doesn’t exist or not accessible |
| 404 | ANSWER_NOT_FOUND | Answer doesn’t exist |
⌘I

