keepa icon indicating copy to clipboard operation
keepa copied to clipboard

api.search_for_categories()

Open ahsantfw opened this issue 2 years ago • 1 comments

I want to get "category numbers" for the Main Categories Like Home&Kitchen etc (Categories with most sales) but I don't know how to use this function as it takes "search word" and returns subcategories.

print(Initializing Keepa API\n')
api = keepa.Keepa(mykey)
categories = api.search_for_categories()
print(categories)

image

ahsantfw avatar Sep 06 '22 09:09 ahsantfw

If I understand you right, I think you're looking for something like:

Query for the best sellers among the ``"movies"`` category.

>>> import keepa
>>> key = '<REAL_KEEPA_KEY>'
>>> api = keepa.Keepa(key)
>>> categories = api.search_for_categories("movies")
>>> category = list(categories.items())[0][0]
>>> asins = api.best_sellers_query(category)
>>> asins
['B0BF3P5XZS',
 'B08JQN5VDT',
 'B09SP8JPPK',
 '0999296345',
 'B07HPG684T',
 '1984825577',
...

akaszynski avatar Jan 10 '23 22:01 akaszynski