import os
from profound import Profound
client = Profound(
api_key=os.environ.get("PROFOUND_API_KEY"),
)
report = client.reports.citations(
date_interval="day",
dimensions=[],
metrics=["count"],
order_by={},
category_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
start_date="2024-01-01T00:00:00.000Z",
end_date="2024-01-01T00:00:00.000Z",
)
print(report)import Profound from '@profoundai/client';
const client = new Profound({
apiKey: process.env['PROFOUND_API_KEY'], // defaults to the PROFOUND_API_KEY env var
environment: 'production',
});
const report = await client.reports.citations({
date_interval: 'day',
dimensions: [],
metrics: ['count'],
order_by: {},
category_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
start_date: '2024-01-01T00:00:00.000Z',
end_date: '2024-01-01T00:00:00.000Z',
});
console.log(report);use profound::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ProfoundClient::builder()
.api_key(std::env::var("PROFOUND_API_KEY")?)
.build()?;
let response = client
.reports()
.citations(CitationsQuery {
date_interval: None,
dimensions: None,
metrics: vec![CitationsQueryMetric::Count],
order_by: None,
pagination: None,
category_id: "7c9e6679-7425-40de-944b-e07fc1f90ae7".to_string(),
start_date: chrono::Utc::now().fixed_offset(),
end_date: chrono::Utc::now().fixed_offset(),
filters: None,
})
.send()
.await?;
println!("{:?}", response);
Ok(())
}curl --request POST \
--url https://api.tryprofound.com/v1/reports/citations \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"metrics": [],
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"date_interval": "day",
"dimensions": [],
"order_by": {
"date": "asc"
},
"pagination": {
"limit": 10000,
"offset": 0
},
"filters": [
{
"field": "hostname",
"value": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metrics: [],
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
date_interval: 'day',
dimensions: [],
order_by: {date: 'asc'},
pagination: {limit: 10000, offset: 0},
filters: [{field: 'hostname', value: '<string>'}]
})
};
fetch('https://api.tryprofound.com/v1/reports/citations', 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.tryprofound.com/v1/reports/citations",
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([
'metrics' => [
],
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'date_interval' => 'day',
'dimensions' => [
],
'order_by' => [
'date' => 'asc'
],
'pagination' => [
'limit' => 10000,
'offset' => 0
],
'filters' => [
[
'field' => 'hostname',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.tryprofound.com/v1/reports/citations"
payload := strings.NewReader("{\n \"metrics\": [],\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"date_interval\": \"day\",\n \"dimensions\": [],\n \"order_by\": {\n \"date\": \"asc\"\n },\n \"pagination\": {\n \"limit\": 10000,\n \"offset\": 0\n },\n \"filters\": [\n {\n \"field\": \"hostname\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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://api.tryprofound.com/v1/reports/citations")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metrics\": [],\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"date_interval\": \"day\",\n \"dimensions\": [],\n \"order_by\": {\n \"date\": \"asc\"\n },\n \"pagination\": {\n \"limit\": 10000,\n \"offset\": 0\n },\n \"filters\": [\n {\n \"field\": \"hostname\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryprofound.com/v1/reports/citations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metrics\": [],\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"date_interval\": \"day\",\n \"dimensions\": [],\n \"order_by\": {\n \"date\": \"asc\"\n },\n \"pagination\": {\n \"limit\": 10000,\n \"offset\": 0\n },\n \"filters\": [\n {\n \"field\": \"hostname\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"dimensions": [
"example.com",
"/some/path",
"2023-10-01"
],
"metrics": [
10,
0.05
]
}
],
"info": {
"query": {
"date_interval": "day",
"dimensions": [
"hostname",
"path",
"date"
],
"filters": [
{
"field": "hostname",
"operator": "is",
"value": "example.com"
}
],
"metrics": [
"count",
"citation_share"
]
},
"total_rows": 200
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Query Citations
Get citations for a given category.
The mentioned filter supports is true and is false. It uses the
latest page analysis available at or before end_date; pages without an
analysis by then are excluded from both values. citation_share keeps all
otherwise eligible citations in its denominator when this filter is used.
import os
from profound import Profound
client = Profound(
api_key=os.environ.get("PROFOUND_API_KEY"),
)
report = client.reports.citations(
date_interval="day",
dimensions=[],
metrics=["count"],
order_by={},
category_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
start_date="2024-01-01T00:00:00.000Z",
end_date="2024-01-01T00:00:00.000Z",
)
print(report)import Profound from '@profoundai/client';
const client = new Profound({
apiKey: process.env['PROFOUND_API_KEY'], // defaults to the PROFOUND_API_KEY env var
environment: 'production',
});
const report = await client.reports.citations({
date_interval: 'day',
dimensions: [],
metrics: ['count'],
order_by: {},
category_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
start_date: '2024-01-01T00:00:00.000Z',
end_date: '2024-01-01T00:00:00.000Z',
});
console.log(report);use profound::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ProfoundClient::builder()
.api_key(std::env::var("PROFOUND_API_KEY")?)
.build()?;
let response = client
.reports()
.citations(CitationsQuery {
date_interval: None,
dimensions: None,
metrics: vec![CitationsQueryMetric::Count],
order_by: None,
pagination: None,
category_id: "7c9e6679-7425-40de-944b-e07fc1f90ae7".to_string(),
start_date: chrono::Utc::now().fixed_offset(),
end_date: chrono::Utc::now().fixed_offset(),
filters: None,
})
.send()
.await?;
println!("{:?}", response);
Ok(())
}curl --request POST \
--url https://api.tryprofound.com/v1/reports/citations \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"metrics": [],
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"date_interval": "day",
"dimensions": [],
"order_by": {
"date": "asc"
},
"pagination": {
"limit": 10000,
"offset": 0
},
"filters": [
{
"field": "hostname",
"value": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metrics: [],
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
date_interval: 'day',
dimensions: [],
order_by: {date: 'asc'},
pagination: {limit: 10000, offset: 0},
filters: [{field: 'hostname', value: '<string>'}]
})
};
fetch('https://api.tryprofound.com/v1/reports/citations', 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.tryprofound.com/v1/reports/citations",
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([
'metrics' => [
],
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'date_interval' => 'day',
'dimensions' => [
],
'order_by' => [
'date' => 'asc'
],
'pagination' => [
'limit' => 10000,
'offset' => 0
],
'filters' => [
[
'field' => 'hostname',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.tryprofound.com/v1/reports/citations"
payload := strings.NewReader("{\n \"metrics\": [],\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"date_interval\": \"day\",\n \"dimensions\": [],\n \"order_by\": {\n \"date\": \"asc\"\n },\n \"pagination\": {\n \"limit\": 10000,\n \"offset\": 0\n },\n \"filters\": [\n {\n \"field\": \"hostname\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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://api.tryprofound.com/v1/reports/citations")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metrics\": [],\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"date_interval\": \"day\",\n \"dimensions\": [],\n \"order_by\": {\n \"date\": \"asc\"\n },\n \"pagination\": {\n \"limit\": 10000,\n \"offset\": 0\n },\n \"filters\": [\n {\n \"field\": \"hostname\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryprofound.com/v1/reports/citations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metrics\": [],\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"date_interval\": \"day\",\n \"dimensions\": [],\n \"order_by\": {\n \"date\": \"asc\"\n },\n \"pagination\": {\n \"limit\": 10000,\n \"offset\": 0\n },\n \"filters\": [\n {\n \"field\": \"hostname\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"dimensions": [
"example.com",
"/some/path",
"2023-10-01"
],
"metrics": [
10,
0.05
]
}
],
"info": {
"query": {
"date_interval": "day",
"dimensions": [
"hostname",
"path",
"date"
],
"filters": [
{
"field": "hostname",
"operator": "is",
"value": "example.com"
}
],
"metrics": [
"count",
"citation_share"
]
},
"total_rows": 200
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
Metrics to include. share_of_voice is deprecated, use citation_share instead.
count, citation_share, share_of_voice, first_cited_at Start date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full ISO timestamp.
End date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full ISO timestamp.
Date interval for the report. (only used with date dimension)
hour, day, week, month, quarter, year, relative_week Dimensions to group the report by.
hostname, path, date, region, topic, topic_id, model, tag, prompt, prompt_id, url, root_domain, persona, citation_category Custom ordering of the report results.
The order is a record of key-value pairs where:
- `key` is the field to order by, which can be a metric or dimension
- `value` is the direction of the order, either `asc` for ascending or `desc` for descending.
When not specified, the default order is the first metric in the query descending.
Show child attributes
Show child attributes
{ "date": "asc" }
{ "count": "desc", "date": "asc" }
Pagination settings for the report results.
Show child attributes
Show child attributes
List of filters to apply to the citations report.
Filter by hostname
- HostnameFilter
- PathFilter
- RegionIdFilter
- RegionNameFilter
- TopicIdFilter
- TopicNameFilter
- ModelIdFilter
- TagIdFilter
- TagNameFilter
- UrlFilter
- RootDomainFilter
- AnalysisTypeFilter
- PromptTypeFilter
- PersonaIdFilter
- CitationCategoryFilter
- PromptFilter
- PromptIdFilter
- MentionedFilter
Show child attributes
Show child attributes
Was this page helpful?