WakaTime API

⭐ Beginner's Pick Documents & Productivity / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

WakaTime automatically tracks how much time you spend coding in your editor and exposes this data through a public API. You can retrieve coding stats per project, language, editor, and OS for any user who has made their profile public. Great for building developer dashboards, portfolio widgets, or team productivity tools.

💡

Beginner Tip

You can access any public WakaTime profile without authentication using the /api/v1/users/:username/stats endpoint. If you need your own private stats, generate an API key from your WakaTime account settings and use HTTP Basic Auth with a Base64-encoded key.

Available Data

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

Example Response

JSON Response
{
  "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

data.total_seconds Total seconds of coding activity in the selected period
data.languages List of programming languages used, with time breakdown per language
data.projects List of projects worked on, with time breakdown per project
data.editors Editors used during the period with time spent in each
data.range Start and end dates of the stats period in ISO 8601 format

Implementation Example

const url = "https://wakatime.com/developers";
const response = await fetch(url);
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

401 Unauthorized Accessing private stats without authentication
Add -u "YOUR_API_KEY:" (note the trailing colon) to authenticate with Basic Auth for private data
404 Not Found Username does not exist or the profile is not public
Verify the username on wakatime.com and ensure the user has set their profile to public in settings
Empty data arrays No coding activity recorded for the requested time range
Try a different range (e.g., last_30_days) or check that the WakaTime editor plugin is installed and active

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 15/20
✓ Reliability 7/15
Response Time 172ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →