1.1.15 • Published 3 months ago

migros-api-wrapper v1.1.15

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

migros-api-wrapper

Making the api of migros more accessible to the public.

Disclaimer

The developers of this module are in no way endorsed by or affiliated with Migros Online AG, or any associated subsidiaries, logos or trademarks.

Up-to-date

The api of Migros is constantly changing in small ways. Feel free to open an issue if you encounter stuff not working. I don't use it daily as of yet, but like to keep stuff up-to-date. Otherwise check my bio for the discord server.

Installation

npm install --save migros-api-wrapper

Usage Example

import { MigrosAPI, ILoginCookies } from "migros-api-wrapper";

main();

async function main() {
    // Search for products matching a certain string.
    const guestInfo = await MigrosAPI.account.oauth2.getGuestToken();
	const responseProductSearch = await MigrosAPI.products.productSearch.searchProduct({
        query: "cooking salt",
    },
    { leshopch: guestInfo.token })
    console.log(responseProductSearch)

    // Certain API Calls need cookies to be accessed.
    // For more accessible options and automatic logins check the IamQuiteHungry Repository: https://github.com/Aliyss/IAmQuiteHungry
    const loginCookies: ILoginCookies = {
		__VCAP_ID__: "",
		MDID: "",
		JSESSIONID: "",
		CSRF: "",
		MLRM: "",
		MTID: "",
		hl: "",
		TS012f1684: ""
	}
	// Get security options of your MigrosAPI Account
	const securityOptions = await MigrosAPI.account.security.getOptions(loginCookies)
	console.log(securityOptions)
}

API Paths

Currently following api paths are being considered:

├── www.migros.ch
|  ├── onesearch-oc-seaapi
|  |  └── public
|  |     └── v5
|  |        └── search
|  ├── product-display
|  |  └── public
|  |     ├── v2
|  |     |  └── product-detail
|  |     └── v2
|  |        └── product-cards
|  └── marketablestock
|     └── public
|        └── v1
|           └── api
|              ├── warehouses
|              |  └── [warehouseId]
|              |     └── products
|              └── product-detail
├── login.migros.ch
|  ├── security
|  |  └── options
|  ├── oauth2
|  |  └── userinfo
|  ├── cumulus
|  |  └── dashboard
|  |     ├── invoice
|  |     ├── stats
|  |     └── household
|  ├── ma
|  |  └── api
|  |     ├── content
|  |     |   └── teaser
|  |     |   |  └── services
|  |     |   |     └── small
|  |     |   └── payment
|  |     |      └── sites
|  |     ├── user
|  |     |   └── cumulus
|  |     |      └── credit-card
|  |     └── principal
|  └── mobilepayment
|     └── devices
├── cumulus.migros.ch
|  └── service
|     ├── avantaReceiptExport
|     |  └── html
|     └── api
|        └── coupon
|           └── activate
├── migusto.migros.ch
|  └── recipes
├── mobile-app.migros.ch (not yet implemented)
|  └── prepare
|     └── shl
|        └── sync
└── mobile-api-gateway.shop.migros.ch (not yet implemented)
   └── mobile-api-gateway
      └── public
         └── retentionapi
            └── v1
               └── customer-messages

Feel free to open an issue or a pull request for additional api paths.

1.1.15

3 months ago

1.1.14

3 months ago

1.1.13

3 months ago

1.1.12

3 months ago

1.1.8

4 months ago

1.1.11

4 months ago

1.1.10

4 months ago

1.1.9

4 months ago

1.1.7

4 months ago

1.1.6

4 months ago

1.1.5

1 year ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago