akaszynski/keepa

How to specify marketplace and other questions

brahmac opened this issue · 3 comments

Hello,
Thank you for making this helpful package. I would not have subscribed to Keepa API, if this package wasn't there. I am fairly new with the API and have a few questions - hope someone would be kind enough to help me.

  1. In the following query how do I specify a marketplace of Canada (6). I thought ASINs were unique to a marketplace, but it seems like they are not (e.g. 1454857935)

asins = np.asarray(['list of asins'])
products = api.query(asins)

products = api.query(asins, domain = 6) doesn't work.

  1. What's the difference between 'csv' and 'data' in the product object? A lot of the data between the two seems to be the same.

  2. Not all ASINS return enough data via the Keepa API. For example the actively listed starbucks product - B078HVQ311 in CA marketplace - currently returns very little data. However, the Keepa graph within the browser has data for 1069 days. Why is this the case? Not only does it not return enough data - it also returns incorrect data (e.g. the 'title' is not correct)

Thank you.

For 1.

# keepa/interface.py (lines 348-350)
domain : str, optional
    One of the following Amazon domains: RESERVED, US, GB, DE,
    FR, JP, CA, CN, IT, ES, IN, MX Defaults to US.

you can pass asins as regular list too

  1. I don't know

  2. I don't know (maybe related to domain ?)

Thank you. The following solves 1) and 3)

Aproduct = api.query('B078HVQ311', domain = 'CA')

Two years late answering this, but late is better than never...

What's the difference between 'csv' and 'data' in the product object? A lot of the data between the two seems to be the same.

  1. The 'data' key is the processed raw csv results. When working with this library (ages ago), I found it helpful to have processed results. See:

    keepa/keepa/interface.py

    Lines 185 to 201 in 129f64a

    def parse_csv(csv, to_datetime=True, out_of_stock_as_nan=True):
    """Parse csv list from keepa into a python dictionary.
    Parameters
    ----------
    csv : list
    csv list from keepa
    to_datetime : bool, optional
    Modifies numpy minutes to datetime.datetime values.
    Default True.
    out_of_stock_as_nan : bool, optional
    When True, prices are NAN when price category is out of stock.
    When False, prices are -0.01
    Default True