Skip to content
/ mercari Public
forked from marvinody/mercari

a wrapper around mercari jp shopping site

Notifications You must be signed in to change notification settings

zhecfy/mercari

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • id
  • productURL
  • imageURL
  • productName
  • price
  • status
  • soldOut

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:

  • sort=MercariSort.SORT_CREATED_TIME
  • order=MercariOrder.ORDER_DESC
  • status=MercariSearchStatus.ON_SALE

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

MercariSort

  • STATUS_DEFAULT
  • STATUS_ON_SALE
  • STATUS_SOLD_OUT

MercariOrder

  • SORT_DEFAULT
  • SORT_CREATED_TIME
  • SORT_NUM_LIKES
  • SORT_SCORE
  • SORT_PRICE

MercariSearchStatus

  • ORDER_DESC
  • ORDER_ASC

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

Mercari API Parameters Guide (Unofficial)

Development

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

Deploying / Publishing

  • python setup.py sdist

  • twine upload dist/mercari-<version>.tar.gz

About

a wrapper around mercari jp shopping site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%