Giter Club home page Giter Club logo

migros-api-wrapper's Introduction

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.

migros-api-wrapper's People

Contributors

aliyss avatar perfaram avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.