keepa.AsyncKeepa#

class keepa.AsyncKeepa#

Asynchronous Python interface to keepa backend.

Initializes API with access key. Access key can be obtained by signing up for a recurring or one-time plan. To obtain a key, sign up for one at Keepa Data.

Parameters:
accesskeystr

64 character access key string.

timeoutfloat, default: 10.0

Default timeout when issuing any request. This is not a time limit on the entire response download; rather, an exception is raised if the server has not issued a response for timeout seconds. Setting this to 0.0 disables the timeout, but will cause any request to hang indefinitely should keepa.com be down

Examples

Query for all of Jim Butcher’s books using the asynchronous keepa.AsyncKeepa class.

>>> import asyncio
>>> import keepa
>>> product_parms = {"author": "jim butcher"}
>>> async def main():
...     key = "<REAL_KEEPA_KEY>"
...     api = await keepa.AsyncKeepa.create(key)
...     return await api.product_finder(product_parms)
...
>>> asins = asyncio.run(main())
>>> asins
['B000HRMAR2',
 '0578799790',
 'B07PW1SVHM',
...
 'B003MXM744',
 '0133235750',
 'B01MXXLJPZ']

Query for product with ASIN 'B0088PUEPK' using the asynchronous keepa interface.

>>> import asyncio
>>> import keepa
>>> async def main():
...     key = "<REAL_KEEPA_KEY>"
...     api = await keepa.AsyncKeepa.create(key)
...     return await api.query("B0088PUEPK")
...
>>> response = asyncio.run(main())
>>> response[0]["title"]
'Western Digital 1TB WD Blue PC Internal Hard Drive HDD - 7200 RPM,
SATA 6 Gb/s, 64 MB Cache, 3.5" - WD10EZEX'
__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

best_sellers_query(category[, ...])

Retrieve an ASIN list of the most popular products.

category_lookup(category_id[, domain, ...])

Return root categories given a categoryId.

create(accesskey[, timeout])

Create an asynchronous Keepa client without making an API request.

deals(deal_parms[, domain, wait, typed])

Query the Keepa API for product deals.

download_graph_image(asin, filename[, ...])

Download the graph image of an ASIN from keepa.

product_finder(product_parms[, domain, ...])

Query the keepa product database to find products matching criteria.

query(items[, stats, domain, history, ...])

Perform a product query of a list, array, or single ASIN.

search_for_categories(searchterm[, domain, ...])

Search for categories from Amazon.

seller_query(seller_id[, domain, ...])

Receive seller information for a given seller id or ids.

update_status()

Update available tokens.

wait_for_tokens()

Check if there are any remaining tokens and waits if none are available.

Attributes

time_to_refill

Return the time to refill in seconds.

accesskey

tokens_left

status