|
| 1 | +Browse API client |
| 2 | +================= |
| 3 | + |
| 4 | +|coverage| |build_status| |Documentation Status| |PyPI version| |
| 5 | + |
| 6 | +This package is a Python client for eBay Browse API. It is asynchronous |
| 7 | +and designed to send a large number of requests by one function call. |
| 8 | + |
| 9 | +For more information about this API visit official |
| 10 | +`documentation <https://developer.ebay.com/api-docs/buy/browse/overview.html>`__. |
| 11 | + |
| 12 | +Installation |
| 13 | +------------ |
| 14 | + |
| 15 | +Install from PyPI by ``pip install browseapi`` |
| 16 | + |
| 17 | +Supported methods |
| 18 | +----------------- |
| 19 | + |
| 20 | +Only these methods are now implemented (names changed to lowercase |
| 21 | +notation): |
| 22 | + |
| 23 | +- `search <https://developer.ebay.com/api-docs/buy/browse/resources/item_summary/methods/search>`__ |
| 24 | +- `search\_by\_image <https://developer.ebay.com/api-docs/buy/browse/resources/search_by_image/methods/searchByImage>`__ |
| 25 | + |
| 26 | +Quickstart |
| 27 | +---------- |
| 28 | + |
| 29 | +Create a BrowseAPI instance with your application id (app\_id) and |
| 30 | +application secret (cert\_id) and start sending requests: |
| 31 | + |
| 32 | +.. code:: python |
| 33 | +
|
| 34 | + from browseapi import BrowseAPI |
| 35 | +
|
| 36 | + app_id = '<your_app_id>' |
| 37 | + cert_id = '<your_cert_id>' |
| 38 | +
|
| 39 | + api = BrowseAPI(app_id, cert_id) |
| 40 | + responses = api.execute('search', [{'q': 'drone', 'limit': 50}, {'category_ids': 20863}]) |
| 41 | +
|
| 42 | + # this will make 'search' request two times with parameters |
| 43 | + # q=drone and limit=50 for the first time and |
| 44 | + # category_ids=20863 for the second time |
| 45 | +
|
| 46 | + print(responses[0].itemSummaries[0]) |
| 47 | +
|
| 48 | +All response fields have similar names and types as those mentioned in |
| 49 | +official docs. |
| 50 | + |
| 51 | +Tests |
| 52 | +----- |
| 53 | + |
| 54 | +For running tests put your ``secret.json`` file with fields |
| 55 | +``'eb_app_id'`` and ``'eb_cert_id'`` to the ``browseapi/tests`` |
| 56 | +directory, then run a command from the parent browseapi directory: |
| 57 | + |
| 58 | +``python -m unittest browseapi.tests.test_client`` |
| 59 | + |
| 60 | +Requirements |
| 61 | +------------ |
| 62 | + |
| 63 | +- Python >= 3.5.3 |
| 64 | +- `aiohttp <https://aiohttp.readthedocs.io/en/stable/>`__ |
| 65 | + |
| 66 | +Documentation |
| 67 | +------------- |
| 68 | + |
| 69 | +Documentation built with `mkdocs <https://www.mkdocs.org/>`__. |
| 70 | + |
| 71 | +`browseapi.readthedocs.io <https://browseapi.readthedocs.io/en/latest/>`__ |
| 72 | + |
| 73 | +.. |coverage| image:: https://img.shields.io/codecov/c/github/AverHLV/browseapi.svg |
| 74 | +.. |build_status| image:: https://img.shields.io/gitlab/pipeline/AverHLV/browseapi/dev.svg |
| 75 | +.. |Documentation Status| image:: https://readthedocs.org/projects/browseapi/badge/?version=latest |
| 76 | + :target: https://browseapi.readthedocs.io/en/latest/?badge=latest |
| 77 | +.. |PyPI version| image:: https://badge.fury.io/py/browseapi.svg |
| 78 | + :target: https://badge.fury.io/py/browseapi |
0 commit comments