Skip to main content

Python API for querying and browsing mercari.jp

Project description

mercapi

PyPI Tests PyPI - Python Version

API Documentation

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

mercapi-0.4.2.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

mercapi-0.4.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file mercapi-0.4.2.tar.gz.

File metadata

  • Download URL: mercapi-0.4.2.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mercapi-0.4.2.tar.gz
Algorithm Hash digest
SHA256 0b2d51f2caaba2082ab073b398c7188dd456d9d0d183a86acf812ded174feee9
MD5 a375fbf5d6ab9c5b1afe0e328f6c9461
BLAKE2b-256 4e47e0b2ce0d819d0edfcbba56cf97667fd7ea4fc1d51a6d771aab3f15c322a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mercapi-0.4.2.tar.gz:

Publisher: release.yaml on take-kun/mercapi

Attestations:

File details

Details for the file mercapi-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: mercapi-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mercapi-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e55ca4470e464faddcc05cf6e935d50bfe2c261de38ba3370fe8605c953ee7dc
MD5 f8eb0bb72f9c2721f7735cfdf9f7057e
BLAKE2b-256 2622aaece71efdbe854e72178641c3cceff63e11396205ede356c757cdbd6c1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mercapi-0.4.2-py3-none-any.whl:

Publisher: release.yaml on take-kun/mercapi

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page