Skip to main content

Collecting product information from Dutch supermarkets: Albert Heijn and Jumbo

Project description

SupermarketConnector

Publish

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.

Jumbo prices

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

supermarktconnector-0.8.1.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

supermarktconnector-0.8.1-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page