Overview

Code::Stats is a free API that tracks programming activity by language, recording XP points earned through coding. You can retrieve a user's total stats, XP per language, and recent activity history. It is a fun way to add developer activity statistics to portfolios or personal dashboards.

Beginner Tip

Code::Stats profiles are public by default, so you can query any username without authentication — perfect for adding your coding stats to a personal website with zero setup.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

track name and artist
album metadata
audio preview URLs
popularity score
genre classification
vehicle make and model

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "name": "Bohemian Rhapsody",
  "artist": "Queen",
  "album": "A Night at the Opera",
  "duration_ms": 354000,
  "popularity": 92,
  "preview_url": "https://p.scdn.co/mp3-preview/..."
}

Field Reference

username The Code::Stats username whose data is returned.
total_xp Total XP accumulated by the user across all languages.
new_xp XP earned in the current 24-hour period (resets daily).
languages Map of language names to their XP stats objects.
languages[name].xps Total XP earned for that programming language.
languages[name].new_xps XP earned for that language in the current 24-hour window.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://codestats.net/api/users/YOUR_USERNAME";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

404 Not Found The username in the URL does not exist on Code::Stats.
Check that the username is spelled correctly and matches the exact profile URL at codestats.net.
Empty languages object The user has not synced any coding activity yet.
The user needs to install the Code::Stats plugin for their editor and complete some coding sessions.
CORS error in browser Code::Stats does not support CORS, so direct browser requests fail.
Make API requests from a server-side script or a backend proxy rather than directly from frontend JavaScript.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS NO
Difficulty Intermediate
Listing details not endpoint-verified

Similar APIs

View All →