forked from mvanhorn/printing-press-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspec.yaml
More file actions
446 lines (414 loc) · 13.2 KB
/
Copy pathspec.yaml
File metadata and controls
446 lines (414 loc) · 13.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
name: myfitnesspal
display_name: MyFitnessPal
description: Calorie tracking, food logging, exercise tracking, and weight management. Reverse-engineered access using your logged-in browser session.
cli_description: Pull your MyFitnessPal diary, foods, exercises, and measurements into a local SQLite store, run trend reports offline, and export per-food CSV that the official UI never gives you.
version: 0.1.0
base_url: https://www.myfitnesspal.com
spec_source: sniffed
http_transport: standard
category: productivity
website_url: https://www.myfitnesspal.com
owner_name: Nick Scarabosio
auth:
type: cookie
cookie_domain: ".myfitnesspal.com"
cookies:
- "__Secure-next-auth.session-token"
title: MyFitnessPal browser session
description: |
MyFitnessPal closed their public API. This CLI reads cookies from your logged-in
browser session (Chrome, Firefox, Safari, Brave) the same way python-myfitnesspal
and AdamWalt's MCP server do. Log in at myfitnesspal.com, then run:
myfitnesspal-pp-cli auth login --chrome
Cookies are read from the .myfitnesspal.com domain. The api.myfitnesspal.com
subdomain receives them automatically because the session cookie is host-scoped
to the parent domain. Some commands additionally need an mfp-user-id header,
which the CLI bootstraps via /user/auth_token after first login.
requires_browser_session: true
browser_session_reason: "MyFitnessPal has no public API key. Authenticated endpoints (diary, exercises, measurements, goals, reports) require cookies from a logged-in browser session."
browser_session_validation_path: "/user/auth_token"
browser_session_validation_method: GET
verify_path: "/user/auth_token"
required_headers:
- name: User-Agent
value: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36"
config:
format: toml
path: "~/.config/myfitnesspal-pp-cli/config.toml"
cache:
enabled: false
mcp:
transport: [stdio]
resources:
user:
description: Authenticated user account info, units, and preferences.
endpoints:
auth_token:
method: GET
path: /user/auth_token
description: Bootstrap a v2 bearer token from your session cookies.
no_auth: false
params: []
body: []
response:
type: object
item: AuthToken
top_foods_server:
method: GET
path: /api/services/top_foods
description: Get your top-logged foods over a date range, computed server-side (powers the "your most-eaten" insights).
params:
- name: from
type: string
required: true
description: Start date (YYYY-MM-DD).
- name: to
type: string
required: true
description: End date (YYYY-MM-DD).
- name: lists
type: string
required: false
description: Repeat for each list type (e.g. "frequent_foods"). On the wire this serializes as lists[]=...
response:
type: object
item: TopFoods
diary:
description: Daily food diary (per-meal entries with full nutrient panel).
endpoints:
get_day:
method: GET
path: /food/diary
description: Get one day's food diary as scraped HTML (legacy surface python-myfitnesspal uses).
params:
- name: username
type: string
required: false
description: Username to query (defaults to your own username from /v2/users/me).
- name: date
type: string
required: true
description: Date in YYYY-MM-DD format.
response:
type: object
format: html
item: DiaryDayHTML
load_recent:
method: POST
path: /food/load_recent
description: Load the recent-foods quick-pick list for a meal.
params: []
body:
- name: meal
type: integer
required: true
description: Meal index (0=breakfast, 1=lunch, 2=dinner, 3=snacks, 4+=custom).
- name: base_index
type: integer
required: false
description: Pagination base index (default 29).
- name: page
type: integer
required: false
description: Page number (default 1).
response:
type: object
format: html
item: RecentFoodsHTML
food:
description: Search the public food database, view food details, log custom foods.
endpoints:
search:
method: POST
path: /food/search
description: Search the food database.
params: []
body:
- name: search
flag_name: query
type: string
required: true
description: Food name or brand to search (e.g. "banana", "kirkland yogurt").
- name: meal
type: integer
required: false
description: Meal index for context (0=breakfast, 1=lunch, 2=dinner, 3=snacks).
- name: date
type: string
required: false
description: Date the search is for (YYYY-MM-DD).
- name: authenticity_token
type: string
required: false
description: Rails CSRF token (auto-extracted from /food/diary if omitted).
response:
type: object
format: html
item: FoodSearchHTML
details:
method: GET
path: /v2/foods/{food_id}
description: Get full nutrient panel for a single food by MFP food id.
params:
- name: food_id
type: string
required: true
description: MyFitnessPal food id (e.g. "5e0f6c28a9c0e80008d8c2c1").
- name: fields
type: string
required: false
description: Repeat for each field to include (e.g. "nutrients,serving_sizes,verified"). Serializes as fields[]= on the wire.
response:
type: object
item: Food
suggested_servings:
method: GET
path: /v2/foods/{food_id}/suggested_servings
description: Get common serving-size suggestions for a food (powers the "1 cup / 100g / medium" picker).
params:
- name: food_id
type: string
required: true
description: MyFitnessPal food id.
- name: version
type: string
required: false
description: Suggestion engine version.
response:
type: object
item: SuggestedServings
exercise:
description: Cardio and strength exercises logged on a given day.
endpoints:
get_day:
method: GET
path: /exercise/diary
description: Get one day's exercise log (cardio + strength) as scraped HTML.
params:
- name: username
type: string
required: false
description: Username (defaults to your own).
- name: date
type: string
required: true
description: Date in YYYY-MM-DD format.
response:
type: object
format: html
item: ExerciseDayHTML
water:
description: Daily water intake tracking.
endpoints:
get:
method: GET
path: /food/water
description: Get water intake for a single day.
params:
- name: date
type: string
required: true
description: Date in YYYY-MM-DD format.
response:
type: object
item: WaterEntry
note:
description: Free-text notes attached to a day's food or exercise diary.
endpoints:
get:
method: GET
path: /food/note
description: Get the food note for a single day.
params:
- name: date
type: string
required: true
description: Date in YYYY-MM-DD format.
response:
type: object
item: DayNote
measurement:
description: Weight, body fat, and other body measurements (time series).
endpoints:
types:
method: GET
path: /api/user-measurements/measurements/types
description: List the measurement types defined for your account (Weight, BodyFat, Neck, Waist, Hips, plus custom).
params: []
response:
type: array
item: MeasurementType
get_range:
method: GET
path: /measurements/edit
description: Get a date range of values for one measurement type as scraped HTML.
params:
- name: type
type: string
required: true
description: Measurement type ("Weight", "BodyFat", or any custom type defined for your account).
- name: from
type: string
required: false
description: Start date (YYYY-MM-DD). Defaults to 90 days ago.
- name: to
type: string
required: false
description: End date (YYYY-MM-DD). Defaults to today.
response:
type: object
format: html
item: MeasurementsHTML
goals:
description: Daily calorie / macro / water / weight goals.
endpoints:
get:
method: GET
path: /account/my-goals
description: Get your current daily goals (calorie target, macro split, water target) as scraped HTML.
params: []
response:
type: object
format: html
item: GoalsHTML
reports:
description: Aggregated time-series reports (any nutrient or weight as a date->value series).
endpoints:
get:
method: GET
path: /api/services/reports/results/{category}/{report_name}/{days}
description: Get a time-series report (e.g. nutrition/Net%20Calories/30 returns the last 30 days of net calories).
params:
- name: category
type: string
required: true
description: Report category - "nutrition" (Net Calories, Carbohydrates, Fat, Protein, Sodium, Sugar, Fiber) or "progress" (Weight, BodyFat, etc).
- name: report_name
type: string
required: true
description: Report name (URL-encoded). For nutrition use "Net%20Calories", "Carbohydrates", "Fat", "Protein", "Sodium". For progress use "Weight", "BodyFat".
- name: days
type: integer
required: true
description: Number of days back from today to include (e.g. 7, 30, 90).
response:
type: array
item: ReportPoint
api_user:
description: Authenticated user record on the v2 API (preferences, paid subs, profiles).
endpoints:
get:
method: GET
path: /v2/users/{user_id}
description: Get the v2 user record (units, goals preferences, paid subs, profiles).
params:
- name: user_id
type: string
required: true
description: Numeric MFP user id (visible in the /user/auth_token response, or pass "me" once we resolve it).
- name: fields
type: string
required: false
description: Repeat for each field (e.g. "diary_preferences,goal_preferences,unit_preferences,paid_subscriptions,account,profiles"). Serializes as fields[]= on the wire.
response:
type: object
item: ApiUser
types:
AuthToken:
fields:
- name: access_token
type: string
- name: token_type
type: string
- name: user_id
type: string
- name: expires_in
type: integer
TopFoods:
fields:
- name: items
type: array
Food:
fields:
- name: id
type: string
- name: brand
type: string
- name: description
type: string
- name: nutrients
type: object
- name: serving_sizes
type: array
- name: verified
type: boolean
- name: public
type: boolean
SuggestedServings:
fields:
- name: items
type: array
WaterEntry:
fields:
- name: date
type: string
- name: amount
type: number
- name: unit
type: string
DayNote:
fields:
- name: date
type: string
- name: text
type: string
MeasurementType:
fields:
- name: name
type: string
- name: unit
type: string
ReportPoint:
fields:
- name: date
type: string
- name: value
type: number
ApiUser:
fields:
- name: id
type: string
- name: username
type: string
- name: diary_preferences
type: object
- name: goal_preferences
type: object
- name: unit_preferences
type: object
- name: paid_subscriptions
type: array
DiaryDayHTML:
fields:
- name: raw
type: string
ExerciseDayHTML:
fields:
- name: raw
type: string
MeasurementsHTML:
fields:
- name: raw
type: string
FoodSearchHTML:
fields:
- name: raw
type: string
RecentFoodsHTML:
fields:
- name: raw
type: string
GoalsHTML:
fields:
- name: raw
type: string