Collecting product information from Dutch supermarkets: Albert Heijn and Jumbo
Project description
SupermarketConnector
Collecting product information from Dutch supermarkets: Albert Heijn and Jumbo
Getting Started
Install the Pip package
pip install supermarktconnector
Sample
Import the jumbo connector and search for a product
from supermarktconnector.jumbo import JumboConnector
connector = JumboConnector()
connector.search_products(query='Smint', size=1, page=0)
{
"products": {
"data": [
{
"id": "70942PAK",
"title": "Smint Peppermint Sugarfree 100 Stuks 2 x 35g",
"quantityOptions": [
{
"defaultAmount": 1,
"minimumAmount": 1,
"amountStep": 1,
"unit": "pieces",
"maximumAmount": 99
}
],
"prices": {
"price": {
"currency": "EUR",
"amount": 365
},
"unitPrice": {
"unit": "kg",
"price": {
"currency": "EUR",
"amount": 5214
}
}
},
"available": true,
"productType": "Product",
"quantity": "2 x 35 g",
"imageInfo": {
"primaryView": [
{
"url": "https://ish-images-static.prod.cloud.jumbo.com/product_images/240420200540_70942PAK-1_360x360.png",
"height": 360,
"width": 360
}
]
}
}
]
}
}
You can also get the different product-categories:
from supermarktconnector.ah import AHConnector
connector = AHConnector()
connector.get_categories()
[
{
"id": 6401,
"name": "Aardappel, groente, fruit",
"images": [
{
"height": 400,
"width": 600,
"url": "https://static.ahold.com//cmgtcontent/media//002304400/000/002304468_001_groenten-fruit.png"
}
],
"nix18": false
}
]
Deprecated
X-Digest (Albert Heijn)
The Albert Heijn used a special X-Digest for verifying that the app data traffic was coming from the backend, in the new versions this has been removed.
This X-Digest is an hashed value that uses SHA1 to check if the request is valid and made by the original android app. The logic behind this hash is:
X_DIGEST = URL + PARAMETERS + USERNAME + POST_BODY (Max 1000 bytes) + SECRET_PASSWORD
Price differences (Jumbo)
In the past all the the jumbo stores where divided over 5 different categories, with each category a different price for some of the products. The token used for store identification is no longer working in the new versions, It might be handled on the backend.
I created an interactive map which sorts all the stores by category.
Project details
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 supermarktconnector-0.8.1.tar.gz
.
File metadata
- Download URL: supermarktconnector-0.8.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.28.1 setuptools/56.0.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69ed9297eac80c1b55aaaf6bc18ac1859daf59bc10bbd38a285d99287522a62d |
|
MD5 | c8105289b94955a0edc10bfab6211391 |
|
BLAKE2b-256 | faf53b0ddb59317d93762c9c767f4f3b841e0cf957d8c854bcdbfe1ccc3950be |
File details
Details for the file supermarktconnector-0.8.1-py3-none-any.whl
.
File metadata
- Download URL: supermarktconnector-0.8.1-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.28.1 setuptools/56.0.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f520b9fdef923daab2972775d434d32b28f7ac4ffd1d3a2e3a6d884294949b37 |
|
MD5 | 02fe6fef1fa309ac7794c0ba4c91138e |
|
BLAKE2b-256 | ffb535c6cd9ca6fc93090761ed138f1ce6f5b5d1e0a923c402ae38ddbaf73d50 |