Skip to main content

mercari api-like wrapper

Project description

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.name, item.productURL))

the item object contains the following properties:

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

Google Proxy

By default, the wrapper will try to use a google proxy to hide traffic. This is a bit finicky and I think google has wised up recently. To disable it and have your requests by direct to mercari, use it in the following way

This is false now, and the google proxyy is removed. Because of how the api endpoint works, this had to be removed.

I've left this part in here to not gaslight any one that it never existed.

import mercari

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

The wrapper will throw on any 4xx or 5xx http status code.

Main reason I've seen errors is because mercari decides to throw 403 if they blacklist your IP. I've tried to get around this with the google proxy, but it seems like google themselves are blocking either the IP or the mercari domain.

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

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

mercari-1.0.1.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file mercari-1.0.1.tar.gz.

File metadata

  • Download URL: mercari-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for mercari-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c15109d88796ecabe45c50d77275451aee35163796df0c52b6f4054e2f1d50bc
MD5 37f547b4cfd353fbe4ea6222ba5be28e
BLAKE2b-256 96256910be139e87387885061ec21230722e4709c8588b07dbfee573bbb49658

See more details on using hashes here.

Supported by

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