Public APIs
Code::Stats favicon

Code::Stats

Documents & Productivity

Automatic time tracking for programmers.

Code::Stats's website screenshot

About Code::Stats

Code::Stats is a service that tracks programming activity by awarding experience points (XP) for keystrokes that add or delete characters, with XP tracked per language. Client integrations (such as editor plugins) monitor coding activity locally and periodically send "pulses" — batches of accumulated XP per language along with a timestamp — to the API, allowing offline activity to be queued and submitted later, as long as the pulse is no more than a week old.

The API exposes a public endpoint for reading a user's profile, returning total XP, XP gained in the last 12 hours, and breakdowns by machine, language, and date. Adding new pulses requires authentication via a per-machine API token, generated through the Code::Stats machine control panel, sent using the X-API-Token header. All requests use HTTPS and JSON, with paths prefixed by /api, and the API follows semantic versioning.

This is aimed at developers building editor plugins or clients that want to log and report a user's coding activity to Code::Stats, or at users/developers who want to programmatically read public coding statistics for a given username. A separate beta instance is available for testing new XP submissions before using the production API.

Key features

  • Tracks XP earned per keystroke to measure coding activity
  • Assigns XP to specific programming languages based on editor syntax or file extension
  • Calculates user level from accumulated XP
  • Public read API for user profile stats via GET /api/users/username
  • Token-authenticated pulse submission to log periodic XP via POST /api/my/pulses
  • Accepts offline-queued pulses as long as the coded_at timestamp is under a week old

Frequently asked questions

Is there a free tier or pricing?

The documentation does not mention pricing; it describes a free-to-use API requiring only account and machine token creation.

What authentication does the API use?

It uses a single signed token per user/machine, generated from the Machine control panel and sent via the X-API-Token header.

What data formats and protocols does the API require?

All requests use HTTPS with JSON payloads, and timestamps must be sent as RFC 3339 values with timezone offsets.

Who is Code::Stats for?

It is for developers who want to track their coding activity and language usage automatically via editor plugins that call the API.

Can I retrieve another user's stats?

Yes, a public GET /api/users/username endpoint returns a user's total XP, per-machine XP, and per-language XP if their profile is public.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product