No description
Find a file
2026-01-24 12:43:03 +01:00
.auth Keep dir 2025-09-10 22:10:58 +02:00
migros_api Move settings 2026-01-24 12:43:03 +01:00
.gitignore Update gitignore 2024-02-23 10:36:25 +01:00
migros_api.py Add debug option 2025-09-11 14:23:29 +02:00
pyproject.toml Add package files 2024-02-24 19:49:24 +01:00
README.md Update readme 2024-02-24 19:39:38 +01:00
requirements.txt Add package files 2024-02-24 19:49:24 +01:00
settings.py Add settings 2024-02-24 19:39:14 +01:00
setup.cfg Rename package 2024-02-25 11:11:54 +01:00
setup.py Add package files 2024-02-24 19:49:24 +01:00

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