What you need
How it works
GET /projects/{project_id}returns the brand’sbrand_name, the key its share of voice uses.GET /projects/{project_id}/visibility?from=…&to=…returns one point per tracked day. A range can span up to 366 days, so 90 days is one request with no pagination.- The script averages each week’s points. Weeks only include days that had a tracking run.
Code
Expected output
Variations
Compare against competitors
Compare against competitors
share_of_voice holds every brand named in answers, not just yours. Sum each name’s share across the period and sort to see who gained ground.Run it on a schedule
Run it on a schedule
Instead of polling, subscribe an endpoint to
tracking.run.finalized and re-run this script when the event arrives. See Slack alerts from webhooks.Every brand at once
Every brand at once
Page through
GET /projects and run the loop per brand. Each brand takes two requests, well inside the 300-per-minute rate limit.