marvinody / mercari

a wrapper around mercari jp shopping site
43 stars 15 forks source link

Mercari Wrapper

A simple api wrapper around the Mercari jp site.

Simple usage can be something like

import mercari

for item in mercari.search("東方 ふもふも"):
    print("{}, {}".format(item.productName, item.productURL))

The search call will take a long time because it goes through all the pages to find every item. It does not return parts where you paginate yourself.

the item object contains the following properties:

If you want to do more specific searching, you can use something like the following

from mercari import search, MercariSearchStatus, MercariSort, MercariOrder

for item in search(
        "",
        sort=MercariSort.SORT_PRICE,
        order=MercariOrder.ORDER_DESC,
        status=MercariSearchStatus.SOLD_OUT
    ):
    print("{}, {}".format(item.productName, item.productURL))

The defaults are currently:

Which will sort by most recent to oldest, and only show on sale item.

MercariSort

You can also pass excluded_keywords="something to exclude" if you want to remove certain pieces from your search

Development

Clone this repo, install the dependencies in requirement.txt and off you go.

Deploying / Publishing