github-readme-stats: [BREAKING CHANGE] WakaTime Stats API Changes

The Problem

As pointed in #863 seems like wakatime changed their public API and now we can only access the resources only if the requests is authenticated.

That’s why while fetching the data it throws “FOBIDDEN” error and we cannot fetch the data.

Solution

So to fix this issue I think it would be nicer if we utilize wakatime’s embeddable share feature https://wakatime.com/share/embed

Benefits of this feature is that

  • No need of authentication
  • Super nice JSON responses
  • Users are can change how much data they need to show (last_7_days, last_30_days etc etc)
  • Lot of options to customize without us needing to tinker around with the response data

Usage

image

After than it will give you HTML code like this: image

And just simply copy past the highlighted part of the string intro github readme stats url

https://github-readme-stats.vercel.app/api/wakatime?shareid=yourusername/6c3e4875-6301-4b7e-955f-9251e06c7d95

And that’s it.

But there’s a catch

As I noticed this json response only shows percentage data and does not provides us with time data about the languages.

@alanhamlett can you help us with this issue?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Hey @SP-XD @FC5570 @LFGaming @LevraGav the fix has been deployed and you can try it out now. (note that we have cache so if you see no changes, just add &v=2 at the end of the url to bust the cache)

Yeah it’s working now, thank you very much guys @anuraghazra @SP-XD

The public time range is customizable, and @anuraghazra has selected to show all_time publicly instead of the default last_7_days. Changing the time range works: https://wakatime.com/api/v1/users/LevraGav/stats/all_time

To fix this, just remove the time range from the url and the user’s default preference will be used: https://wakatime.com/api/v1/users/LevraGav/stats

i have already checked those two boxes and it’s still not showing up (:

image

Kinda facing a prob with wakatime… i used this:

[![Frenzy's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=frenzyexists)](https://github.com/anuraghazra/github-readme-stats)

I also tried the embeded thing: image

[![Frenzy's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?shareid=frenzyexists/da716838-7963-40b8-9d4c-87f4a8883ee4)](https://github.com/anuraghazra/github-readme-stats)

I do have the all time set n all image

So, I have no idea what am i doing wrong

Oh Ops!

Seems like wakatime api is fine and github-readme-stats is fine too!

@LevraGav @FC5570

Seems like in #863 the issue was that in your wakatime profile settings you did not checked these options so we cannot fetch your data

image

Check these checkboxes and it should work just fine.