Skip to content

Commit

Permalink
Add process used buybox (#150)
Browse files Browse the repository at this point in the history
* add process buy box

* add in buy box info

* fix typing
  • Loading branch information
akaszynski authored Oct 27, 2023
1 parent de7e2f7 commit 0af5971
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 47 deletions.
28 changes: 28 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,34 @@ If you plan to do a lot of simulatneous query, you might want to speedup query u
products = await api.query('059035342X', wait=False)
Buy Box Statistics
~~~~~~~~~~~~~~~~~~
To load used buy box statistics, you have to enable ``offers``. This example
loads in product offers and converts the buy box data into a
``pandas.DataFrame``.

.. code:: pycon
>>> import keepa
>>> key = '<REAL_KEEPA_KEY>'
>>> api = keepa.Keepa(key)
>>> response = api.query('B0088PUEPK', offers=20)
>>> product = response[0]
>>> buybox_info = product['buyBoxUsedHistory']
>>> df = keepa.process_used_buybox(buybox_info)
datetime user_id condition isFBA
0 2022-11-02 16:46:00 A1QUAC68EAM09F Used - Like New True
1 2022-11-13 10:36:00 A18WXU4I7YR6UA Used - Very Good False
2 2022-11-15 23:50:00 AYUGEV9WZ4X5O Used - Like New False
3 2022-11-17 06:16:00 A18WXU4I7YR6UA Used - Very Good False
4 2022-11-17 10:56:00 AYUGEV9WZ4X5O Used - Like New False
.. ... ... ... ...
115 2023-10-23 10:00:00 AYUGEV9WZ4X5O Used - Like New False
116 2023-10-25 21:14:00 A1U9HDFCZO1A84 Used - Like New False
117 2023-10-26 04:08:00 AYUGEV9WZ4X5O Used - Like New False
118 2023-10-27 08:14:00 A1U9HDFCZO1A84 Used - Like New False
119 2023-10-27 12:34:00 AYUGEV9WZ4X5O Used - Like New False
Contributing
------------
Contribute to this repository by forking this repository and installing in
Expand Down
1 change: 1 addition & 0 deletions src/keepa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
convert_offer_history,
format_items,
keepa_minutes_to_time,
process_used_buybox,
run_and_get,
)
from keepa.plotting import plot_product # noqa: F401
Loading

0 comments on commit 0af5971

Please sign in to comment.