Skip to main content

IKEA API Client

Project description

Client for several IKEA APIs.

License Version Python Version Downloads

Features

  • Authorization (as guest or as user)
  • Manage Cart
  • Check available Delivery Services
  • Retrieve Purchases History and information about specific order
  • Fetch Product information

Installation

pip install ikea_api

To use authorization you need to have Chrome on board.

Initialization

from ikea_api import IkeaApi

api = IkeaApi(
    token=...,  # If you already have a token and stored it somewhere
    country_code="ru",
    language_code="ru",
)

Endpoints

Authorization

As Guest

api.login_as_guest()

First time you open IKEA.com guest token is being generated and stored in Cookies. It expires in 30 days.

As Registered User

Token lasts 1 day. It may take a while to get authorized token because of it uses headless Chrome to proceed. Note, that Chrome is required to login.

api.login(username=..., password=...)

Cart

This API endpoint allows you to do everything you would be able to do on the site, and even more:

  • Add, Delete and Update items
  • Show cart
  • Clear cart
  • Set and Delete Coupon
  • Copy cart from another user

Works with and without authorization. If you logged in all changes apply to the real cart. Use case: programmatically add items to cart and order it manually on IKEA.com.

Example:

cart = api.Cart
cart.add_items({"30457903": 1})
print(cart.show())

Order Capture

Check availability for Pickup or Delivery. This is the only way.

If you need to know whether items are available in stores, check out ikea-availability-checker.

api.OrderCapture(zip_code="101000")

Purchases

Order History

api.login(username=..., password=...)
history = api.Purchases.history()

Order Info

api.login(username=..., password=...)
order = api.Purchases.order_info(order_number=...)

# Or use it without authorization, email is required
api.login_as_guest()
order = api.order_info(order_number=..., email=...)

Item Specs

Get information about item by item number

item_codes = ["30457903"]

items = api.fetch_items_specs.iows(item_codes)

# or
items = api.fetch_items_specs.ingka(item_codes)

# or
item_codes_dict = {d: True for d in items}  # True — is SPR i. e. combination
items = api.fetch_items_specs.pip(item_codes_dict)

There are many ways because information about some items is not available in some endpoints.

Response Examples

You can review response examples for all endpoint before using it here

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

ikea-api-0.6.3.tar.gz (19.3 kB view hashes)

Uploaded Source

Built Distribution

ikea_api-0.6.3-py3-none-any.whl (20.4 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