Skip to main content

IKEA API Client

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

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

If you are planning to use log in as registered user, you need to install Selenium and chromedriver:

pip install ikea_api[driver]

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 Selenium usage.

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.4.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ikea_api-0.4.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file ikea_api-0.4.0.tar.gz.

File metadata

  • Download URL: ikea_api-0.4.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.11

File hashes

Hashes for ikea_api-0.4.0.tar.gz
Algorithm Hash digest
SHA256 fbb689ba260b54ffa7f65d3902b70cb55c4610662055c5bf752a6a9e12097a9e
MD5 d89ef189b15a329f37bc4b22ab01fac9
BLAKE2b-256 7f4626f7f2e565535ee23db05decab9f7ab42fb90f4a92566dd8f255d23aa1d4

See more details on using hashes here.

File details

Details for the file ikea_api-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ikea_api-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.11

File hashes

Hashes for ikea_api-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 754e8b5240092a0abea6f74520fc101d74767a241159e5902c303a02486073d9
MD5 98a088456714d38eb13640ab14795f3e
BLAKE2b-256 cd2c9b29f60fe957f7c738ec0c49502abf884a855f4e7da828b80097c0c2393e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page