muety / wakapi

📊 A minimalist, self-hosted WakaTime-compatible backend for coding statistics
https://wakapi.dev
MIT License
2.63k stars 163 forks source link

Unable to retrieve data via the wakatime api #520

Closed swiftwind0405 closed 1 year ago

swiftwind0405 commented 1 year ago

I deployed it on my own server using Docker. When I call this API (/api/compat/wakatime/v1/users/current/stats/last_30_days), it doesn't return any data, as shown in the following image:

image

However, when I access it on the web, it works fine:

image

Could you please let me know if I am accessing the API incorrectly?

muety commented 1 year ago

Are you sending an authorized request (including Authorization header) or an anonymous one? The endpoint you're using allows for public, unauthorized access, but in that case, will only return as much data as you gave permissions to. So possible solutions include:

image

You might also want to look into the /summary endpoint as an alternative (also requires authentication).

muety commented 1 year ago

Hope that helps?

swiftwind0405 commented 1 year ago

THX. It helps me a lot!