GitHub Deletes Repo Traffic Data After 14 Days — Here's How One Dev Preserved It
GitHub's repository traffic dashboard provides metrics like views, clones, and referrers, but permanently deletes all data older than 14 days with no export option or recovery method. A developer began polling GitHub's four traffic API endpoints every six hours and storing results in a Postgres database to build a long-term archive. The project surfaced several technical pitfalls, including the fact that traffic data requires broad Administration-level app permissions, which can alarm users despite the app only reading page view counts. Daily unique visitor figures cannot be accurately summed across multiple days because GitHub deduplicates only within each day, not across them. Additional complications included today's traffic rows updating throughout the day — requiring upsert logic rather than simple inserts — and referrer data carrying no date information at all.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in