Python API for querying and browsing mercari.jp
Project description
mercapi
What is Mercapi?
Mercapi is a Python wrapper for mercari.jp API. It's capable of producing HTTP requests implementing security mechanisms employed in native mercari.jp web app. Requests and responses are mapped to custom classes with type-hinting and documentation.
Quickstart
First, install the mercapi
package using the package manager of your choice.
As an example, we want to run the search query sharpnel
.
from mercapi import Mercapi
m = Mercapi()
results = await m.search('sharpnel')
print(f'Found {results.meta.num_found} results')
for item in results.items:
print(f'Name: {item.name}\\nPrice: {item.price}\\n')
We can use a single result object to retrieve full details of the listing.
item = results.items[0]
full_item = await item.full_item()
print(full_item.description)
Or get it directly using an ID.
item = await m.item('m90925725213')
print(item.description)
Refer to mercapi.mercapi.Mercapi
documentation for all implemented features.
Examples above are not executable. If you want to try them out, run python example.py
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mercapi-0.3.0.tar.gz
.
File metadata
- Download URL: mercapi-0.3.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0da614c21f2ea41b51f1a23c2b550cb72f07ce3f2f74517203d57e0c501bf15c |
|
MD5 | 1b4fa2e9c91929cf6908f74a9161f969 |
|
BLAKE2b-256 | e4fd4d6c0af6d1c979ae25314399a820d28ec0d07c5881256033d191d3d227e9 |
File details
Details for the file mercapi-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: mercapi-0.3.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed5ffb4449930ae3df5054dc3f59a8ce613c700f9540092fd9e220faed52122e |
|
MD5 | 1ae5ed78c540d8e9954bd9e498956b40 |
|
BLAKE2b-256 | 296670e9ece294249dea38a31fbfd829a732c1a9e02e09ab227aa05bbc2c5490 |