{"id":28972402,"url":"https://github.com/philippdormann/mensamax-api","last_synced_at":"2025-07-07T04:04:14.307Z","repository":{"id":44686582,"uuid":"135147409","full_name":"philippdormann/mensamax-api","owner":"philippdormann","description":"unofficial MensaMax-API","archived":false,"fork":false,"pushed_at":"2024-03-16T22:56:54.000Z","size":1095,"stargazers_count":4,"open_issues_count":5,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-20T15:17:37.074Z","etag":null,"topics":["api","mensamax","mensamax-api","nodejs","vercel"],"latest_commit_sha":null,"homepage":"https://mensa.vercel.app","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philippdormann.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"ko_fi":"philippdormann","liberapay":"philippdormann","custom":"https://paypal.me/philippdormann"}},"created_at":"2018-05-28T10:41:46.000Z","updated_at":"2024-10-21T06:18:49.000Z","dependencies_parsed_at":"2023-02-18T09:20:25.527Z","dependency_job_id":"40ce1b72-9394-4194-95f5-3b411020be14","html_url":"https://github.com/philippdormann/mensamax-api","commit_stats":{"total_commits":238,"total_committers":7,"mean_commits":34.0,"dds":0.4201680672268907,"last_synced_commit":"d0cd9f82145675fa392230d2ef3bba569279236e"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/philippdormann/mensamax-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philippdormann%2Fmensamax-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philippdormann%2Fmensamax-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philippdormann%2Fmensamax-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philippdormann%2Fmensamax-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philippdormann","download_url":"https://codeload.github.com/philippdormann/mensamax-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philippdormann%2Fmensamax-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261548847,"owners_count":23175513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","mensamax","mensamax-api","nodejs","vercel"],"created_at":"2025-06-24T11:02:21.623Z","updated_at":"2025-06-24T11:06:32.099Z","avatar_url":"https://github.com/philippdormann.png","language":"HTML","funding_links":["https://ko-fi.com/philippdormann","https://liberapay.com/philippdormann","https://paypal.me/philippdormann","https://buymeacoffee.com/philippdormann","https://ko-fi.com/V7V4I6I8"],"categories":[],"sub_categories":[],"readme":"# MensaMax-API\n\n### Scraper for MensaMax products (like `mensadigital.de`/ `mensamax.de`/ `mensapoint.de`)\n\n\u003cpre style=\"text-align:center\"\u003e\n🍲🥘🥡🍛🍜🦐🥔\n🍴🍽️ this is just a fancy way of getting some food 🍽️🍴\n🍲🥘🥡🍛🍜🦐🥔\n\u003c/pre\u003e\n\n[![Deployment](https://badgen.net/badge/Deployment/Vercel/black)](https://mensa.vercel.app) [![donate with PayPal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://paypal.me/philippdormann) [![buy me a coffee](https://img.shields.io/badge/buymeacoffee-donate-yellow.svg)](https://buymeacoffee.com/philippdormann) [![ko-fi](https://badgen.net/badge/ko-fi/donate/yellow)](https://ko-fi.com/V7V4I6I8) [![npm](https://img.shields.io/npm/dy/@philippdormann/mensamax-api?label=npm%20downloads)](https://www.npmjs.com/package/@philippdormann/mensamax-api)\n\n## 🧐 Usage\n\u003e General Note: Please use your own caching strategy, MensaMax servers might be quite slow\n### API usage\nsee \u003chttps://mensa.vercel.app/institutions-ui\u003e for API URLs\n\n### npm package usage\n#### Install package\n```bash\npnpm i @philippdormann/mensamax-api\n```\n#### ts/ module imports\n```ts\nimport { fetchHTML, parser } from '@philippdormann/mensamax-api';\nconst html = await fetchHTML({ p: 'FO111', e: 'herz', kw: 15 });\nconst parsed = await parser(html);\nconsole.log(parsed);\n```\n#### CommonJS imports\n```js\nconst { fetchHTML, parser } = require('@philippdormann/mensamax-api');\n(async function () {\n\ttry {\n\t\tconst html = await fetchHTML({ p: 'FO111', e: 'herz', kw: 15 });\n\t\tconst parsed = await parser(html);\n\t\tconsole.log(parsed);\n\t} catch (e) {\n\t\tconsole.log(e);\n\t}\n})();\n```\n\n## 🚀 Deployment\nThis project is deployed as a serverless function on the url \u003chttps://mensa.vercel.app\u003e with [Vercel](https://vercel.com/) ☁️\n\n## 🐳 Docker Deployment\nThis project can be deployed as a docker container.\nTo do so, just run this code:\n```\ndocker-compose up -d --build\n```\n\n## 💻 Local Development\nEither develop on your machine directly or use the provided devcontainer for VSCode\n```\npnpm i\npnpm dev\n```\n\n## 💡 How this works\n1. Fetch data from url ([fetcher.js](./api/fetcher.js))\n   - fetch `VIEWSTATE` + `VIEWSTATEGENERATOR` from .NET with axios\n     - hit login endpoint with a GET request\n     - request method: POST\n     - enable followAllRedirects\n     - set login headers\n   - setup request (these settings are important)\n     - enable cookies\n     - request method: POST\n     - enable followAllRedirects\n     - set login headers\n2. Parsing the data ([parser.js](./api/parser.js))\n    - get relevant elements with cheerio\n      - timePeriod\n      - categories\n      - day cards with food items\n    - minify html\n    - Regex\n    - Replace unreadable markup such as internal MensaMax IDs\n    - Build JSON from custom markup\n3. Serve via rayo http/ Vercel Serverless Function\n\n## 🏫 Known/ tested institutions\n- For a nice GUI version, see \u003chttps://mensa.vercel.app/institutions-ui\u003e\n- For the raw data, see [institutions.json](./institutions.json)\n- Please feel free to suggest new institutions by opening a PR/ Issue\n\n## 🧠 General Knowledge\n- For some reason, MensaMax IT department decided to have **many URLs**\n  - you can find a list of all known MensaMax URLS @[mensamax-urls.txt](./mensa-urls.txt)\n- These **URLs are not interchangeable** and seem to be different MensaMax versions (as of 13.04.2023)\n- There is a private/ internal GraphQL API for MensaMax which needs authentication\n\n## 👍💰 Support this project\nYou like this project and would like to give something back?\nThanks! [Have a look at my profile](https://github.com/philippdormann) for more information \u0026 options.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippdormann%2Fmensamax-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilippdormann%2Fmensamax-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippdormann%2Fmensamax-api/lists"}