Overview
Code::Stats is a publicly available service that provides developers with tools to track their personal coding metrics. Established in 2017, the platform focuses on collecting data related to programming activity, including keystrokes, editor events, and language usage. This data is then presented through a web interface, offering insights into individual development habits and progress over time.
The core functionality of Code::Stats relies on editor plugins that integrate directly with common development environments. These plugins capture coding events locally and transmit them to the Code::Stats service. The service then processes this telemetry to generate statistics, which can include metrics such as total keystrokes, lines of code written (though approximated), and time spent coding in different languages or projects. The intent is to offer a personalized view of a developer's output, distinct from team-oriented analytics tools.
Code::Stats targets individual developers who seek to monitor their own productivity, identify patterns in their work, or engage with a gamified system that awards experience points (XP) for coding activity. This approach can be used for self-improvement, understanding skill distribution, or simply as a motivational tool. The service operates on a free-for-all-users model, making it accessible for personal use without a subscription or tiered payment structure. Its design emphasizes simplicity in both integration and data presentation, allowing developers to quickly set up tracking across multiple editors and begin accumulating statistics. The API offered by Code::Stats is designed for straightforward submission of coding activity, facilitating custom integrations beyond the officially supported plugins, such as a custom Python client for Code::Stats. Developers can also review the Code::Stats documentation for details on their data collection methodology.
Unlike some broader activity tracking tools, Code::Stats maintains a specific focus on coding-related events, aiming to provide relevant metrics for software development rather than general computer usage. This specialization allows it to offer insights tailored to programming contexts, such as language proficiency trends or peaks in coding activity. The platform's commitment to being free and supporting a range of programming languages and editors positions it as an accessible option for developers seeking personal performance feedback.
Key features
- Personalized Coding Metrics: Tracks individual keystrokes, active editor time, and language usage across various projects.
- Multi-Editor Support: Provides plugins for a range of popular IDEs and text editors, including VS Code, Sublime Text, Vim, and Emacs, ensuring broad compatibility.
- Gamification System: Awards experience points (XP) for coding activity, allowing users to level up and compare their progress with others.
- Language and Editor Statistics: Visualizes coding time and keystroke distribution by programming language and development environment.
- API for Custom Integrations: Offers a straightforward API for submitting coding events, enabling developers to create their own clients or integrations, as detailed in the Code::Stats API documentation.
- Dashboard Visualizations: Presents coding data through an online dashboard with graphs and charts for trend analysis over time.
- Public Profiles: Allows users to create public profiles to share their coding statistics and achievements.
Pricing
Code::Stats is available to all users without charge. The service does not implement tiered pricing, subscription models, or feature limitations based on payment. All core features and functionalities, including API access and editor plugins, are provided for free.
| Service Tier | Features | Price (USD) | As Of |
|---|---|---|---|
| All Users | Personal coding statistics, editor plugins, API access, gamification, public profiles | Free | 2026-05-28 |
For the most current information regarding access and features, refer to the Code::Stats homepage.
Common integrations
- Visual Studio Code: Dedicated plugin for tracking activity within the VS Code editor, documented in the Code::Stats plugins documentation.
- Sublime Text: Plugin available for Sublime Text users to submit coding data.
- Vim/Neovim: Integration through a Vim plugin allowing tracking directly from these text editors.
- Emacs: An Emacs Lisp package for sending coding activity to the Code::Stats service.
- Atom: Plugin support for the Atom text editor.
- JetBrains IDEs (e.g., IntelliJ IDEA, PyCharm): Community-contributed plugins extend support to various JetBrains products, as described in the Code::Stats plugin list.
- Custom Clients: The Code::Stats API documentation facilitates custom integrations using diverse programming languages, such as Python or Go, for developers to build their own data submitters.
Alternatives
- WakaTime: A coding tracker that offers automated time tracking, metrics, and leaderboards across various editors and IDEs. WakaTime also provides more extensive reporting and team features compared to Code::Stats.
- Code Time (VS Code extension): A VS Code extension that provides local coding metrics, visualizations, and an optional cloud-based service for aggregated data.
- ActivityWatch: An open-source, local-first automated time-tracker that can monitor general computer usage, including activity in editors, with a focus on privacy and data ownership.
Getting started
To begin tracking your coding activity with Code::Stats, the primary method involves installing an editor plugin. For instance, with a Python-based editor or a custom script, you can submit data directly via the API. The following Python example demonstrates how to send a simple heartbeat (a signal of activity) to the Code::Stats API, signifying activity in a specific file and language. This requires obtaining an API key from your Code::Stats profile.
import requests
import json
import os
API_URL = "https://codestats.net/api/v1/heartbeat"
API_KEY = os.environ.get("CODESTATS_API_KEY") # Get API key from environment variable
if not API_KEY:
print("Error: CODESTATS_API_KEY environment variable not set.")
exit(1)
headers = {
"Content-Type": "application/json",
"X-API-Token": API_KEY
}
# Example data for a heartbeat
data = {
"language": "Python",
"file": "/home/user/my_project/main.py",
"time": int(os.time())
}
try:
response = requests.post(API_URL, headers=headers, data=json.dumps(data))
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
print(f"Heartbeat sent successfully. Status Code: {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"Error sending heartbeat: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Before running this Python script, ensure the requests library is installed (pip install requests) and set your Code::Stats API key as an environment variable named CODESTATS_API_KEY. This script illustrates the minimal requirements for sending activity data, and actual editor plugins typically handle more complex event tracking such as keystrokes and file modifications automatically. For more complex integration scenarios or to develop a new plugin, consult the Code::Stats API reference for detailed endpoint specifications and data structures.