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.4.0.tar.gz
.
File metadata
- Download URL: mercapi-0.4.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1a0c89e7953321dfbe138d1260ca7dbdfca5f189d9e14b1d37aea832cad09d7 |
|
MD5 | eb0926d25a239c6d21e84eff4038177a |
|
BLAKE2b-256 | 7be7ee57968410d05e7689526c18b6afb3cb484fdc1d0e7e5cb0c683764e6e53 |
File details
Details for the file mercapi-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: mercapi-0.4.0-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44cf9416171b11f278bf6130b444617477214671968989a03d66adef04a7286f |
|
MD5 | 09f565bb76db42dd2c04081b8e2d922a |
|
BLAKE2b-256 | 37c79f12aa309de49dacaec0f24de37afd3f303a6c36893a0964f581afe446ab |