Skip to content

Instantly share code, notes, and snippets.

@BillyNate
Last active January 18, 2023 20:39
Show Gist options
  • Save BillyNate/54bcf3021e7b3b9a096ae6ec0e9e8d8f to your computer and use it in GitHub Desktop.
Save BillyNate/54bcf3021e7b3b9a096ae6ec0e9e8d8f to your computer and use it in GitHub Desktop.
Dirk (van den Broek) app API

This is an overview of discoveries surrounding the Dirk app for Android & iOS.
Calls are made to app-api.dirk.nl over https. It looks like this is version 2 of the API since first segment of the path is /v2.
Funny enough a lot of the assets are loaded from app.dekamarkt.nl.

Two custom headers are send with each request to app-api.dirk.nl: x-api-id and x-api-key. The user-agent header is usually okhttp/4.9.1.

Stores

A list of stores can be requested from /stores, the parameter formulaId filters out stores: 1 is Dekamarkt and 2 is Dirk.
The response will be a json array of objects. Each object represents a store containing:

  • storeId: a unique string of digits
  • storeCode: a unique string of digits
  • name: usually the address of the store (street + nr)
  • formula: formula used in this store (see formulaId filter parameter), object containing:
    • formulaId: numerical string
    • name: name of the formula
  • location: coordinates of the store, object containing latitude & longitude
  • features: an empty array

Store

Details of a store can be requested from /stores/{storeId}.
The response will be a json object containing:

  • storeId: a unique string of digits
  • storeCode: a unique string of digits
  • name: usually the address of the store (street + nr)
  • formula: formula used in this store (see formulaId filter parameter), object containing:
    • formulaId: numerical string
    • name: name of the formula
  • address: address of the store, object containing:
    • streetAddress
    • postalCode
    • locality
  • location: coordinates of the store, object containing latitude & longitude
  • contactInformation: object containing:
    • email
    • telephone
    • visit
  • features: an array of feature strings
  • services an array of service objects, each object containing code and name

Openinghours

Opening hours of a store can be requested from /stores/{storeId}/openinghours.
The response will be a json array of objects. Each object represents a time block containing:

  • openTime: in 1970-01-01T00:00:00 format
  • closeTime: in 1970-01-01T00:00:00 format
  • emphasize: usually false

Categories of offers

Categories of temporary offers can be requested from /catalog/offers/categories with some parameters:

  • storeId: id of the store, mandatory
  • startDate: in 1970-01-01T00:00:00.000Z format
  • endDate: in 1970-01-01T00:00:00.000Z format
  • excludeCategoryCode: no effect when used, but 17000000 seems to be a common value The response will be a json array of objects. Each object represents a category containing:
  • code: unique number like 01000000
  • name: name of the category
  • icon: filename
  • backgroundImage: path/filename
  • categories: a subdivision array of objects, each object containing:
    • code: unique number like 01001000
    • name: name of the subdivision
    • categories: subdivision of the subdivision array of objects, each object containing:
      • code: unique number like 01001001
      • name: name of the subdivision

Offers

Temporary offers can be requested from /catalog/offers with some parameters:

  • storeId: id of the store, mandatory
  • startDate: in 1970-01-01T00:00:00.000Z format
  • endDate: in 1970-01-01T00:00:00.000Z format
  • excludeCategoryCode: exclude offers with given category code
  • categoryCode: only include offers with given category code The response will be a json array of objects. Each object represents an offer containing:
  • offerId: a unique string of digits
  • title: name of the product offered
  • descriptiveSize
  • imageUrl: path/filename
  • discountType: unknown
  • originalPrice: numerical value in euros
  • discountPrice: numerical value in euros
  • priceLabel: textual representation of the offer
  • validFrom: in 1970-01-01T00:00:00 format
  • validUntil: in 1970-01-01T00:00:00 format
  • products: an array of product objects containing:
    • productId: a unique string of digits
    • sku: a unique string of digits
    • name: name of the product
    • brandName: name of the brand of the product
    • descriptiveSize
    • imageUrl: path/filename
    • availability: often "AVAILABLE"
    • restriction: often "NONE"
    • tradeChannel: often "ALL"
    • prices: array of price objects containing:
      • salePrice: numerical value in euros
      • validFrom: in 1970-01-01T00:00:00 format
      • validUntil: in 1970-01-01T00:00:00 format
      • priceLabel: textual representation of the offer
    • certifications (only if applicable)
    • packaging
  • categories: array of categories this offer is used in

Categories of products

Categories of products can be requested from /catalog/products/categories with some parameters:

  • storeId: id of the store, mandatory
  • priceDate: in 1970-01-01T00:00:00.000Z format The response will be a json array of objects. Each object represents a category containing:
  • code: unique number like 01000000
  • name: name of the category
  • icon: filename
  • backgroundImage: path/filename
  • categories: a subdivision array of objects, each object containing:
    • code: unique number like 01001000
    • name: name of the subdivision
    • categories: subdivision of the subdivision array of objects, each object containing:
      • code: unique number like 01001001
      • name: name of the subdivision

Products

Products can be requested from /catalog/products with some parameters:

  • storeId: id of the store, mandatory
  • priceDate: in 1970-01-01T00:00:00.000Z format The response will be a json array of objects. Each object represents an offer containing:
  • productId: a unique string of digits
  • sku: a unique string of digits
  • name: name of the product
  • brandName: name of the brand of the product
  • variantDescription: if applicable; for products with multiple variations
  • descriptiveSize
  • imageUrl: path/filename
  • restriction: often "NONE"
  • prices: array of price objects containing:
    • salePrice: numerical value in euros
    • validFrom: in 1970-01-01T00:00:00 format
    • validUntil: in 1970-01-01T00:00:00 format
  • certifications (only if applicable)
  • packaging: object containing:
    • itemCount: seems to be always 1
    • customizable: seems to be always false
  • categories: array of categories this offer is used in

More may follow

Carts

Pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment