Documents & Productivity — entry 009 of 30

Code::Stats

Verified Jul 2026

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.

time-trackingdeveloper-toolsfreeopen-source
AuthenticationAPI KeySign up with the provider to obtain credentials.
HTTPSSupportedTraffic is encrypted in transit.
CORSEnabledCallable directly from browser JavaScript.
PricingFreeNo paid tier — free for the documented use case.
FormatsJSONResponses can be requested as JSON.

GreatAPIs Score

Score64out of 100
Authentication15/25API key required
Pricing20/20Free to use
Docs0/20No docs or spec available
Formats9/15Single response format
Freshness20/20Verified within 6 months

Embed this badge

Scored 64 on greatapis.com
<a href="https://greatapis.com/api/code-stats/"><img src="https://greatapis.com/badge/code-stats.svg" alt="Scored 64 on greatapis.com"></a>

Auth quickstart

  1. 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/pulses with no auth header returned a genuine 403 {"error": "You must be authenticated"}, and Code::Stats' own docs show writes need an X-API-Token header carrying a token from the account's API keys page.
  2. 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.
Stored keyNo key stored

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

200 application/json; charset=utf-8

{
  "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_xp is 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, where new_xp: 0 and every new_xps in languages/machines are also 0 despite the profile having years of history in total_xp.
  • dates is 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 a 0 value. 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/search endpoint 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.