Subjects - Consensus History
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 map | A map, indexed by subject_uid, of subject-media consensus count objects. |
timestamp unix timestamp | The timestamp of the subject consensus count. Consensus counts are reported up to the minute. |
Subject Consensus Count Object
True integer | (optional) Total count of media (and optional focus area) items that have reached consensus of positive association with the subject. |
False integer | (optional) Total count of media (and optional focus area) items that have reached consensus of negative association with the subject. |
All integer | (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 unix timestamp | 1234567890 | (optional) Earliest timestamp of subject-media consensus records to return. |
end unix timestamp | 1234567890 | (optional) Latest timestamp of subject-media consensus records to return. |
limit integer | 10 | (optional) Max number of records (per subject) to return. |
reverse boolean | True | (optional) True - results are returned in descending order (by time). False - results are returned in ascending order (by time). |
user_id string | [email protected] | (optional) Returns consensus counts for subject-media correctly asserted by the given user. |
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 request
from pprint import pprint
my_headers = {"Authorization": "Bearer abcdefg.hijklmnop.qrstuvwxyz"}
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
},
...
]
}
Updated over 6 years ago