mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-20 00:35:22 +00:00
1.3 KiB
1.3 KiB
How to Use Our Code API
The Hackatime API lets you get your coding data with code. It works just like WakaTime's API.
Quick Start
- Get your API key from Hackatime settings
- Make requests to:
https://hackatime.hackclub.com/api/v1/
How to Log In With Code
Put your API key in your requests like this:
Best way (Authorization Header):
Authorization: Bearer YOUR_API_KEY
Other way (in the URL):
?api_key=YOUR_API_KEY
Try It Out
Get your coding stats:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://hackatime.hackclub.com/api/v1/users/{your-username}/stats
Works With WakaTime Tools
Since Hackatime works like WakaTime's API, you can:
- Use any WakaTime code libraries
- Point WakaTime tools to Hackatime
- Move data between WakaTime and Hackatime
Popular Endpoints
- Your Stats:
/api/v1/stats- How much you've coded (Admin Only) - Your Heartbeats:
/api/v1/my/heartbeats- Raw coding activity - User Stats:
/api/v1/users/{username}/stats- Any user's public stats
More Details
Want to see all the API commands? Check out our complete API list. Most things work exactly like WakaTime's API.