github-readme-stats: Waka time card broken range parameter broken
Describe the bug
It looks like the range parameter of the WakaTime card is no longer working due to some upstream changes. https://github.com/anuraghazra/github-readme-stats/pull/2670 fixed the card for the all_time range. For the other ranges, however, the 403 “Forbidden” error is thrown. The strange thing is that this error is not thrown when I directly try the generated WakaTime API link in the browser, but it only happens when I request it through Axios. This is strange as according to the documentation this should work.
Regular card
[](https://github.com/anuraghazra/github-readme-stats)
*All time
[](https://github.com/anuraghazra/github-readme-stats)
Last 7 days
[](https://github.com/anuraghazra/github-readme-stats)
Last 30 days
[](https://github.com/anuraghazra/github-readme-stats)
Expected behaviour
Should work according to the documentation
Screenshots / Live demo link
No response
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 15 (2 by maintainers)
Commits related to this issue
- fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://github.com/anuraghazra/github-readme-stats/issues/2698 for m... — committed to anuraghazra/github-readme-stats by rickstaa 4 years ago
- 🪲 Fix wakatime card not loading see https://github.com/anuraghazra/github-readme-stats/issues/2698 add range=last_7_days fixed it for now — committed to DanielSRS/DanielSRS by DanielSRS 4 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to anuraghazra/github-readme-stats by rickstaa 3 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to sheerlox/github-readme-stats by rickstaa 3 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to LucienZhang/github-readme-stats by rickstaa 3 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to devantler/github-readme-stats by rickstaa 3 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to jacobbexten/github-readme-stats by rickstaa 3 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to t-cooke/github-readme-stats by rickstaa 3 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to design-dev333/github-readme-stats by design-dev333 3 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to necofuryai/github-readme-stats by necofuryai 3 years ago
- fix: Make WakaTime card compatible with new API (#2707) * fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://g... — committed to xhayper/github-readme-stats by rickstaa 3 years ago
You can check the range for a user with https://wakatime.com/api/v1/users/current looking at the user’s attribute
public_profile_time_range. No loop necessary, just get the range for the user from that API endpoint.@hakula139 I just implemented https://github.com/anuraghazra/github-readme-stats/pull/2707 which automatically gets the right information, throws descriptive errors and documents the behaviour in the README. I would appreciate it if you could review this PR so that we can merge. I don’t use the WakaTime card myself, so a review of somebody who does would be great!
Thanks for looking into this issue 🚀. I checked the behaviour you described, and it seems to be correct. The new API behaviour is that if users are logged in, they can request all ranges from the API in the browser. If they are logged out or try to request stats from other users, they can only request the time range that is used on the profile. I think there are two ways to solve the behaviour:
What option do you guys think is best?
Thanks, I’ve fixed that. It’s just validation on that page and doesn’t affect your dashboard or stats and doesn’t prevent saving your chosen default dashboard range.
For new issues like this we should continue chatting over email with support@wakatime.com to prevent taking over this thread.
I had a problem with my wakatime card as well and couldn’t fix it no matter what i tried. Then i visited the wakatime profile settings page and found out i had selected ‘last 14 days’ (as a free user), which is apparently not for free anymore. Changing it to last 7 days fixed it. (used url:
https://github-readme-stats.vercel.app/api/wakatime?username=Pawele&theme=dark&range=last_year&is_including_today=true)also (not related to the problem), i noticed that wakatime api call return different time values on my machine and on different machines (shows less time spent). It almost feels like it hides time stats from private repos, but I haven’t really worked on any since i started using it. Any ideas why would that be? (used url: https://wakatime.com/api/v1/users/Pawele/stats/last_year?is_including_today=true) also, somehow ‘last_7_days’ (publicly) is forbidden for me while ‘last_year’ (publicly) isn’t…