Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get_report broken? (JSONDecodeError) #177

Open
guidoderam opened this issue Mar 10, 2024 · 1 comment
Open

Get_report broken? (JSONDecodeError) #177

guidoderam opened this issue Mar 10, 2024 · 1 comment

Comments

@guidoderam
Copy link

I tried calling get_report in a couple of different ways but all of them resulted in a JSONDecodeError.

I looked at the relevant code and compared it to the API calls made on https://www.myfitnesspal.com/reports:

MFP reports page: https://www.myfitnesspal.com/api/services/reports/results/nutrition/fat/30?report_name=fat
Python-myfitnesspal get_report: https://www.myfitnesspal.com/reports/results/fat/30.json

Is get_report calling an old API? It takes 2 dates where the MFP reports page only uses a number of days from today. And the urls look different, but maybe there is some python/library magic going on (no Python expert!)?

@hannahburkhardt
Copy link
Collaborator

Hi @guidoderam, you're right, it looks like the URL has changed and so has the response format. However, the number of date arguments has not changed - it looks like we use only the lower_bound argument in the API call, then drop anything out of bounds before returning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants