Fetch receipts and more from Lidl Plus
Project description
This python package is unofficial and is not related in any way to Lidl. It was developed by reversed engineered requests and can stop working at anytime!
Python Lidl Plus API
Fetch receipts and more from Lidl Plus.
Installation
pip install lidl-plus
Authentication
To login in Lidl Plus we need to simulate the app login. This is a bit complicated, we need a web browser and some additional python packages. After we have received the token once, we can use it for further requestes and we don't need a browser anymore.
Prerequisites
- Check you have installed one of the supported web browser
- Chromium
- Google Chrome
- Mozilla Firefox
- Microsoft Edge
- Install additional python packages
pip install "lidl-plus[auth]"
Commandline-Tool
$ lidl-plus auth
Enter your language (de, en, ...): de
Enter your country (DE, AT, ...): AT
Enter your lidl plus username (phone number): +4915784632296
Enter your lidl plus password:
Enter the verify code you received via phone: 590287
------------------------- refresh token ------------------------
2D4FC2A699AC703CAB8D017012658234917651203746021A4AA3F735C8A53B7F
----------------------------------------------------------------
Python
from lidlplus import LidlPlusApi
lidl = LidlPlusApi(language="de", country="AT")
lidl.login(phone="+4915784632296", password="password", verify_token_func=lambda: input("Insert code: "))
print(lidl.refresh_token)
Usage
Currently, the only features are fetching receipts and activating coupons
Receipts
Get your receipts as json and receive a list of bought items like:
{
"currentUnitPrice": "2,19",
"quantity": "1",
"isWeight": false,
"originalAmount": "2,19",
"name": "Vegane Frikadellen",
"taxGroup": "1",
"taxGroupName": "A",
"codeInput": "4023456245134",
"discounts": [
{
"description": "5€ Coupon",
"amount": "0,21"
}
],
"deposit": null,
"giftSerialNumber": null
},
Commandline-Tool
$ lidl-plus --language=de --country=AT --refresh-token=XXXXX receipt --all > data.json
Python
from lidlplus import LidlPlusApi
lidl = LidlPlusApi("de", "AT", refresh_token="XXXXXXXXXX")
for receipt in lidl.tickets():
pprint(lidl.ticket(receipt["id"]))
Coupons
You can list all coupons and activate/deactivate them by id
{
"sections": [
{
"name": "FavoriteStore",
"coupons": []
},
{
"name": "AllStores",
"coupons": [
{
"id": "2c9b3554-a09c-412c-8be4-d41cbff13572",
"image": "https://lidlplusprod.blob.core.windows.net/images/coupons/LT/IDISC0000254911.png?t=1695452076",
"type": "Standard",
"offerTitle": "1 + 1",
"title": "👨🏻🍳 Frozen 👨🏻🍳",
"offerDescriptionShort": "FREE",
"isSegmented": false,
"startValidityDate": "2023-09-24T21:00:00Z",
"endValidityDate": "2023-10-01T20:59:59Z",
"isActivated": false,
"apologizeText": "Xxxxxxxxxxxxxxxxx",
"apologizeStatus": false,
"apologizeTitle": "Xxxxxxxxxxxxxxxxxxx",
"promotionId": "DISC0000254911",
"tagSpecial": "",
"firstColor": "#ffc700",
"secondaryColor": null,
"firstFontColor": "#4a4a4a",
"secondaryFontColor": null,
"isSpecial": false,
"hasAsterisk": false,
"isHappyHour": false,
"stores": []
},
.......
]
},
{
"name": "OtherStores",
"coupons": []
}
]
}
Commandline-Tool
Activate all available coupons
$ lidl-plus --language=de --country=AT --refresh-token=XXXXX coupon --all
Python
from lidlplus import LidlPlusApi
lidl = LidlPlusApi("de", "AT", refresh_token="XXXXXXXXXX")
for section in lidl.coupons()["sections"]:
for coupon in section["coupons"]:
print("found coupon: ", coupon["title"], coupon["id"])
Help
Commandline-Tool
Lidl Plus API
options:
-h, --help show this help message and exit
-c CC, --country CC country (DE, BE, NL, AT, ...)
-l LANG, --language LANG language (de, en, fr, it, ...)
-u USER, --user USER Lidl Plus login username
-p XXX, --password XXX Lidl Plus login password
--2fa {phone,email} choose two factor auth method
-r TOKEN, --refresh-token TOKEN
refresh token to authenticate
--skip-verify skip ssl verification
--not-accept-legal-terms not auto accept legal terms updates
-d, --debug debug mode
commands:
auth authenticate and get token
receipt output last receipts as json
coupon activate coupons
Support
If you find this project helpful and would like to support its development, you can buy me a coffee! ☕
Don't forget to star the repository if you found it useful! ⭐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lidl-plus-0.3.5.tar.gz
.
File metadata
- Download URL: lidl-plus-0.3.5.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0c535115df5480609e5fd43715651b78e4f7297b2dff06145b2381f22223552 |
|
MD5 | a29c86a4b5d229eff48bae15e832931c |
|
BLAKE2b-256 | ea8e45479f9b7d2fa2743a23907ab5c9a6842f0fa53907d0676165c269fe8b8c |
File details
Details for the file lidl_plus-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: lidl_plus-0.3.5-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a01c1fa88a02477aecf3cd402b6842318beeff1600cef6874f7209923bb5639 |
|
MD5 | f86e26cb62d38dbe082de0e1e59b3b34 |
|
BLAKE2b-256 | 5a8459cfd6625fab43454b9939e73e26c4be2ec7f7641b86a3879f15873ebd42 |