Documents & Productivity — entry 009 of 30
Code::Stats
Code::Stats is a free, community-run time-tracking service for programmers, collecting coding activity via editor plugins and exposing it through a small read API for pulses, profiles, and language breakdowns. There is no paid tier — the whole service is free.
Code::Stats tracks coding activity from editor plugins (VS Code, IntelliJ, Vim, and others) and exposes the aggregated totals through a small read API. A live GET this run against /api/users/Nicd returned a real 56 KB profile at HTTP 200 — total XP, a per-day history going back to 2016, and per-language and per-machine breakdowns — with no key or Authorization header of any kind.
GreatAPIs Score
Auth quickstart
- Reading a public profile needs no key — the live GET above returned the full profile with zero credentials. Only submitting new activity is gated: a live POST this run against
/api/my/pulseswith no auth header returned a genuine403 {"error": "You must be authenticated"}, and Code::Stats' own docs show writes need anX-API-Tokenheader carrying a token from the account's API keys page. - The token in the docs' own curl example is a long opaque string (
SFMyNTY...), not a short API key — it's meant to be copied verbatim from the account settings page into editor-plugin config, not typed by hand.
Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.
Fetch a user's public profile and XP totals
GEThttps://codestats.net/api/users/Nicd
{
"user": "Nicd",
"total_xp": 8580804,
"new_xp": 0,
"dates": {
"2016-09-29": 5878,
"2018-01-10": 3170,
"2017-04-10": 3721
},
"languages": {
"Perl": { "new_xps": 0, "xps": 5 },
"XML": { "new_xps": 0, "xps": 6212 },
"JavaScript": { "new_xps": 0, "xps": 1712407 }
},
"machines": {
"Armi": { "new_xps": 0, "xps": 3775489 },
"Burninator": { "new_xps": 0, "xps": 3165 },
"Codespaces": { "new_xps": 0, "xps": 81 }
}
}Trimmed hard for length — the real response this run was 56,285 B with 3,026 entries in dates (one per day the user has ever coded, back to 2016) and 75 entries in languages. Code::Stats' own docs say new_xp/new_xps is "XP gained in the last 12 hours", which is why it reads 0 here even though total_xp shows over 8.5M lifetime — this profile simply had no activity in the last 12 hours at request time.
Developer reference
Gotchas & limits
new_xpis a rolling 12-hour window, not "XP earned today" or a since-last-poll counter — confirmed by Code::Stats' own docs text ("new_xps is XP gained in the last 12 hours") alongside the live response above, wherenew_xp: 0and everynew_xpsinlanguages/machinesare also0despite the profile having years of history intotal_xp.datesis a flat day → XP map with no gaps filled in — a live scan of the response this run found no entry at all for days with zero activity, rather than a0value. Summing a date range means iterating the object's own keys, not assuming every calendar day between the first and last entry is present.- The username in the URL is case-sensitive and unvalidated client-side — there's no
/api/users/searchendpoint in the docs, so a typo'd or nonexistent username is only caught by the response itself (a 404 with no XP data), not by any earlier validation step.