Menu

How We Turned 30 Restaurant Nutrition PDFs into Calculators
📰

How We Turned 30 Restaurant Nutrition PDFs into Calculators

DEV Community: astro·Asif Iqbal Khan·16 days ago
#igvJ5LVf
#devtoastro#devto#dev#chain#every
Reading 0:00
15s threshold

Restaurant chains publish their nutrition facts, but rarely in a form you can use while ordering. Chipotle's guide lists every ingredient on its own row. Domino's lists toppings per serving, separately for each crust and size. Subway lists a 6-inch sub, and you work out the footlong yourself. None of them adds up the order you are actually about to eat.

So we built TrayFacts : one calculator per chain, built only from each chain's official numbers. You tap what goes in your bowl, sub, or box, and the calories, protein, carbs, fat, and sodium add up as you go. It now covers 30 chains and more than 10,000 menu items, sizes, and ingredients. This post is about the parts that turned out harder than expected.

1. Getting the data: every chain is different

There is no common format. In the first 30 chains, we met at least four:

PDF tables (Chipotle, QDOBA, Moe's, Subway, Dunkin', SONIC and others). Some are dated, some are not.

Data inside the page itself.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.