/mercari-python-api

The Python Mercari API.

Primary LanguagePython

The Python Mercari API (+Rakuma)

A Python interface to the unofficial Mercari/Rakuma API.

   

Example

from mercari import Mercari
from mercari import Rakuma

mercari_api = Mercari()
rakuma_api = Rakuma()

print('_' * 80)
print(mercari_api.name)
print(mercari_api.fetch_all_items(keyword='CHANEL')[0:10])
print(mercari_api.get_item_info('https://www.mercari.com/jp/items/m88046246209/'))

print('_' * 80)
print(rakuma_api.name)
print(rakuma_api.fetch_all_items(keyword='CHANEL')[0:10])
print(rakuma_api.get_item_info('https://item.fril.jp/9093de55f88bc28d47c35fd1d4dd23f0'))

Installation

From PyPI

pip install mercari_python

From the sources

pip install git+ssh://git.github.com/philipperemy/mercari-python-api

Monitoring

cd examples
# edit one of those two files to receive notifications.
cp gmail_conf.json.example gmail_conf.json # edit this file.
cp alertzy_conf.json.example alertzy_conf.json # edit this file.
python monitor.py --keywords "road bike,moto bike" --min_prices "0,0" --max_prices "43000,43000"

Note: Amazon AWS IPs are blacklisted by Mercari. So don't use AWS EC2 to run this script, it will not work.