Giter Site home page Giter Site logo

Comments (15)

JK-TC avatar JK-TC commented on September 23, 2024 3

Looks like IKEA has changed up their API. Subscribing in hopes that somebody finds a workaround.

from ikea-availability-checker.

Ephigenia avatar Ephigenia commented on September 23, 2024 1

The api.ingka.ikea.com API doesn’t support all details but at least the current stock available for pickup and the restore probability.

The API requires just the "x-client-id"-header to be present and contain a valid API key. For US stores the API key used in the Browser is "da465052-7912-43b2-82fa-9dc39cdccef8" and works:

curl 'https://api.ingka.ikea.com/cia/availabilities/ru/us?itemNos=00494394&expand=StoresList,Restocks&' \
-X 'GET' \
-H 'x-client-id: da465052-7912-43b2-82fa-9dc39cdccef8'
{
	"availabilities": [
		{
			"buyingOption": {
				"cashCarry": {
					"availability": {
                        "probability": {
                            "thisDay": {
                                "messageType": "HIGH_IN_STOCK"
                            }
                        },
                        "quantity": 2
                    },
                    "unitOfMeasure": "PIECE"
				}
			}
			"classUnitKey": {
				"classUnitCode": "026", // store code
				"classUnitType": "STO"
			},
		}
	]
}

I’ll make adjustments to the code so that this API also works.

from ikea-availability-checker.

derpingit avatar derpingit commented on September 23, 2024 1

Hi @Ephigenia thank you very much for this wonderful project. Could you plz point me In the right direction on how to mod the script to use that API ? I'm a non-programmer searching us stores . Stay awesome

from ikea-availability-checker.

Ephigenia avatar Ephigenia commented on September 23, 2024

Yes, more and more countries don’t work anymore. I’m planning to create a smoke test shell script that tests every country and puts the results in a table. If someone wants to contribute … it‘s welcome :)

from ikea-availability-checker.

okniazik avatar okniazik commented on September 23, 2024

All PL stores are returning 403 error code too...

from ikea-availability-checker.

derpingit avatar derpingit commented on September 23, 2024

subbed. same problem. hope this project gets revived.

from ikea-availability-checker.

JK-TC avatar JK-TC commented on September 23, 2024

For those that are just hopiing to check for availablity on a specific product, I found an endpoint that works. It's the one that is getting called from the product page on their site (USA). I'm sorry, I'm not able to see how this works for other countries right now, but hopefully it helps some people out or starts them down the right path.

Here's an example request:
https://api.ingka.ikea.com/cia/availabilities/ru/us?itemNos=20487415&zip=32746&expand=Restocks,SalesLocations.

You'll need to pass some header params, here's what I'm usng just to mimic the web browser. Your client id needs to be unique and you can get one from inspecting requests to the same endpont in your browser.

'x-client-id': <insert client id here>
'accept': 'application/json;version=2',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'en-US,en;q=0.9',
'origin': 'https://www.ikea.com',
'referer': 'https://www.ikea.com/',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'sec-gpc': '1',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36'

from ikea-availability-checker.

Ephigenia avatar Ephigenia commented on September 23, 2024

@JK-TC thanks for that hint! I’ll investigate this

from ikea-availability-checker.

Ephigenia avatar Ephigenia commented on September 23, 2024

The ingka api works for all countries except for russia:

countryCode iows2 ingka
at
au
be
ca
ch
cn
cz
de
dk
es
fi
fr
gb
hk
hr
hu
ie
it
jo
jp
kr
kw
lt
my
nl
no
pl
pt
qa
ro
ru
sa
se
sg
sk
th
tw
us

from ikea-availability-checker.

Ephigenia avatar Ephigenia commented on September 23, 2024

This package uses the undocumented iows2 api by IKEA which doesn’t work for several countries anymore: be, cn, fi, fr, gb, hk, ie, jp, kr, my, pl, ru, sg, th, tw, us

If you want to get availabilities for those countries please consider testing the alpha channel of this package by installing the "2.0.0-alpha.1" version:

npm install -g [email protected]

Please report any bugs related to this alpha in the issues: https://github.com/Ephigenia/ikea-availability-checker/issues

from ikea-availability-checker.

Ephigenia avatar Ephigenia commented on September 23, 2024

Please consider rating this package: https://openbase.com/js/ikea-availability-checker 🙇‍♂️

from ikea-availability-checker.

BHSPitMonkey avatar BHSPitMonkey commented on September 23, 2024

Thank you!

Note: There's a typo in the npm command in the above comment. It should read:

npm install -g [email protected]

(check -> checker)

from ikea-availability-checker.

Ephigenia avatar Ephigenia commented on September 23, 2024

@BHSPitMonkey thanks! Got it fixed.

from ikea-availability-checker.

okniazik avatar okniazik commented on September 23, 2024

Hi, I'm trying to test the alpha channel, and I do npm run start -- stock --country pl 80382321. Got an error TypeError: Cannot read properties of undefined (reading 'stock') at C:\ikea\node_modules\ikea-availability-checker\source\cli-stock.js:152:65 at Array.filter (<anonymous>) at C:\ikea\node_modules\ikea-availability-checker\source\cli-stock.js:152:32 at processTicksAndRejections (node:internal/process/task_queues:96:5)

from ikea-availability-checker.

Ephigenia avatar Ephigenia commented on September 23, 2024

@okniazik I’ve created an issue for this, will be fixed in a few minutes …

from ikea-availability-checker.

Related Issues (20)

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.