Skip to main content

Client for several IKEA's APIs

Project description

Client for several IKEA APIs.

Test Version Python Downloads License

Features

  • Manage Cart,
  • Check available Delivery Services,
  • Retrieve Purchases History and information about specific order,
  • Get Product information.

Installation

pip install ikea_api

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

You can't do this automatically with this package. IKEA made it nearly impossible to get authorized token. Copy-paste token from ikea.com cookies.

🛒 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

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.10.0.tar.gz (14.6 kB view hashes)

Uploaded Source

Built Distribution

ikea_api-0.10.0-py3-none-any.whl (17.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