Architecture
About this API Domains Versioning Example URLsGeneral
Identifiers Supported Data Formats Data TypesRequests
Access Token and Related Information Localization GET Request Query Parameter Collection RequestsResponses
Content Type Response Codes Response Body Error Responses Standard ResponsesAuthentication and Authorization
Partner Authentication User AuthorizationAuthorization Code Grant (GET /oauth2/auth)
Request query parameters Example 1: Requesting the diary scope Example 2: Requesting all available scopes Response Authorization ErrorsAccess Token Request (POST /oauth2/token)
Request body form parameters Response Access Token ErrorsRefreshing Access Tokens (POST /oauth2/token)
Request body form parameters Response Refresh Token Errors Making RequestsRevoking Tokens (POST /oauth2/revoke)
Request body form parameters ResponseUsers
Resources GET /users/:userId
Example Response with no fields parameter Example Response with fields elementsResources PATCH /users/:userId
Request ExampleMeasurements
Resources
GET /measurements/ POST /measurements/Diary
Resources
GET /diary/ POST /diary/ PATCH /diary/ DELETE /diary/Exercises
Resources
GET /exercises/Subscriptions
Management
POST /subscription/ GET /subscription/ DELETE /subscription/Notifications
Example Request Body Best Design PracticesAppendix
Data Structures
User Measured Value User Profile Account Privacy Preferences Goal Preferences Location Preferences Diary Preferences Nutritional Contents Exercise Measurement Diary SubscriptionError Codes
Error CodesMigrating from MyFitnessPal API v1 to v2
v1 action: log_cardio_exercise v1 action: remove_cardio_exercise v1 action: log_weight v1 action: log_expended_energy v1 action: get_food_summary v1 action: get_cardio_exercises v1 action: get_weight v1 action: fetch_user_info v1 action: subscribe_to_user_updates v1 action: unsubscribe_from_user_updatesTracking allday steps activity
Tracking all-day steps activity Recommended approach for tracking steps Determining daily totals Calorie AdjustmentsMyFitnessPal exercises and their identifiers
MyFitnessPal exercises and their identifiersFull request and response examples
POST and GET request and responseProduction Environment
All production-environment requests will use the hostname api.myfitnesspal.com.