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.

Version Python Version Downloads License

Features

  • Log In (as guest or as user),
  • Manage Cart,
  • Check available Delivery Services,
  • Retrieve Purchases History and information about specific order,
  • Get Product information.

Installation

pip install ikea_api

To use authorization as registered user you need to have Chrome on board.

Usage

from ikea_api import IkeaApi

ikea = IkeaApi(
    token=None,
    country_code="us",
    language_code="en",
)

Examples below don't show everything you can do, but this package is almost fully typed and quite small. So, better browse code or use autocompletion in your IDE 😄

Endpoints

🔑 Authorization

As Guest

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

ikea.login_as_guest()

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.

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

📌 You probably don't want to re-login every time (this is quite suspicious behavior from IKEA's perspective). This package doesn't store tokens, so, make sure to take care of it yourself.

To show token, use this method:

ikea.reveal_token()

🛒 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,
  • Set or delete Coupon,
  • Show it,
  • Clear it,
  • And even copy another user's cart.

Authorization as user is optional. All changes apply to the real cart if you're logged in. Use case: programmatically add items to cart and order it manually on IKEA.com.

Simple example:

ikea.Cart.add_items({"30457903": 1})  # { item_code: quantity }
print(ikea.Cart.show())

🚛 Order Capture

Check Pickup or Delivery availability.

ikea.OrderCapture(
    zip_code="02215",
    state_code="MA",  # pass state code only if you're in USA
)

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

📦 Purchases

Order History

ikea.Purchases.history()

Order Info

ikea.Purchases.order_info(order_number=...)

# Or use it without authorization, email is required
ikea.Purchases.order_info(order_number=..., email=...)

🪑 Item Information

Get information about Item by item number.

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

item_codes = ("30457903",)

items = ikea.fetch_items_specs.iows(item_codes)

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

# or
item_codes_dict = {"30457903": False}  # { item_code: is_combination }
items = ikea.fetch_items_specs.pip(item_codes_dict)

🔎 Search for Products

Search for products in the IKEA product catalog by product name. Optionally also specify a maximum amount of returned search results (defaults to 24).

search_results = ikea.Search("Billy")  # Retrieves (at most) 24 search results

# or
search_results = ikea.Search("Billy", 10)  # Retrieves (at most) 10 search results

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.8.1.tar.gz (18.2 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.8.1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ikea_api-0.8.1.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for ikea_api-0.8.1.tar.gz
Algorithm Hash digest
SHA256 7bf8127ee9834d1e6730721ed8322d093c5dfb4e34b1de87a3f34ade8f7a2635
MD5 8cf6b315cfec0091a55d45c3adebebf1
BLAKE2b-256 2bb0fec17980ef3b22d4624d7adf9dd2772b06921b7656a17d8409f84f9d64fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ikea_api-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for ikea_api-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6da432def78fa4ba91d248e87d324273ad1a8457b5ae621015b097ce505cf851
MD5 c47265347b8765d28982587bfcf406ba
BLAKE2b-256 8f1169744290fc64d19756ecc8acf2783601fc703f7592c5cb5e180f15083da4

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