- 22 Dec 2023
- 1 Minute to read
- Print
- DarkLight
Subjects - Consensus History
- Updated on 22 Dec 2023
- 1 Minute to read
- Print
- DarkLight
Total counts of subject-media consensus items are tracked real-time by the Cogniac System. Subject Consensus History data are returned as an ordered list of subject consensus count maps.
subjects | A map, indexed by subject_uid, of subject-media consensus count objects. |
timestamp | The timestamp of the subject consensus count. |
Subject Consensus Count Object
True | (optional) Total count of media (and optional focus area) items that have reached consensus of positive association with the subject. |
False | (optional) Total count of media (and optional focus area) items that have reached consensus of negative association with the subject. |
All | (optional) Total count of media (and optional focus area) items that have any association with the subject (with or without consensus). |
Get Subject Consensus History
The Subject Consensus History endpoint returns subject-media consensus item counts over time for the given subject.
Argument | Example | Description |
---|---|---|
start | 1234567890 | (optional) |
end | 1234567890 | (optional) |
limit | 10 | (optional) |
reverse | True | (optional) |
user_id | user@cogniac.co | (optional) |
GET /1/subjects/{subject_uid}/consensusHistory
Host: https://api.cogniac.io
Example: Retrieve Subject Consensus History
curl -X GET https://api.cogniac.io/1/subjects/cat_123/consensusHistory?reverse=true \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz"
import requests
from pprint import pprint
my_headers = {"Authorization": "Bearer abcdefg.hijklmnop.qrstuvwxyz"}
# add the Subject_uid
res = requests.get("https://api.cogniac.io/1/subjects/cat_123/consensusHistory?reverse=True",
headers=my_headers)
pprint(res.json())
{
"data": [
{
"subjects": {
"cat_123": {
"True": 81,
"False": 12
}
},
"timestamp": 1490986560
},
{
"subjects": {
"cat_123": {
"True": 72
}
},
"timestamp": 1490986500
},
...
]
}