- Python 100%
| .auth | ||
| migros_api | ||
| .gitignore | ||
| migros_api.py | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
| settings.py | ||
| setup.cfg | ||
| setup.py | ||
Migros API
Python wrapper and automation of Migros API calls.
Disclaimer
The developer has no affiliation with Migros. Use at your own risk! (It is probably violating TOS)
Setup
Python packages
python -m pip install -r requirements.txt
Download browsers
To automatically get cookies, playwright is used to emulate a login and extract cookies
playwright install
Set username and password
WARNING: Do not enter your password unless you fully understand what is happening!
Create a .env file with the content modified to your credentials
USER_EMAIL="your.email@domain.com"
USER_PASSWORD="53cUr3p455W0RD"
Usage
List receipts
python migros_api.py list 20230101 20240101 10
will return the ten latest receipt IDs of your cumulus account.
List products of receipts
python migros_api.py products [receipt_id]
will return the products of the purchase with receipt ID receipt_id. However, the purchased quantity is unknown.
Get product details
python migros_api.py product [product_id]
will return the details of teh product with the MigrosId product_id (corresponding to the www.migros.ch shop URL), which is not equal to the uid of the product.
Further reading
A more complete API wrapper written in TypeScript can be found under Aliyss/migros-api-wrapper