Read-only API
Scope options
Discover the valid filters for a project before requesting analytics.
GET
/api/domains/{host}/scope-optionsEndpoint#
GET /api/domains/{host}/scope-options
Authenticate with your personal Bearer token. The host must be a project visible to the account.
Example request#
curl --fail-with-body 'https://app.keptai.com/api/domains/example.com/scope-options' \
-H "Authorization: Bearer $KEPT_API_TOKEN"
const response = await fetch(
'https://app.keptai.com/api/domains/example.com/scope-options',
{ headers: { Authorization: `Bearer ${process.env.KEPT_API_TOKEN}` } }
);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
console.log(data);
import json, os, urllib.request
request = urllib.request.Request(
'https://app.keptai.com/api/domains/example.com/scope-options',
headers={'Authorization': 'Bearer ' + os.environ['KEPT_API_TOKEN']}
)
with urllib.request.urlopen(request) as response:
print(json.load(response))
Response fields#
| Field | Contents |
|---|---|
| engines | id, label, configured, lastRunDay |
| topics | topic and count |
| categories | category and count |
| brands | name, tracked, and own where applicable |
| ownTerms | Normalized own-brand terms |
| days | 7, 30, 90 |
Apply the filters#
Use returned values in agent-analytics requests. Multiple engine, topic, category, and brand values may be comma-separated. Encode query values when constructing URLs. Persona is not a prompt attribute and cannot be filtered.
The optional refresh=1 query requests a scope-options refresh. A read failure can return 502. See Authentication for host and access failures.