/mercari-client

Simulate Mercari API interaction by scraping web pages

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Mercari Client

This simple library simulates interactions with an open API for Mercari, which doesn't exist. It does so by scraping web pages using mercari-parser.

Setup

npm install git+https://github.com/louistio/mercari-client.git --save

Usage

You can retrieve info for an item with its id. The id is located after item/ in the url, for example in the url https://www.mercari.com/us/item/m000000/, the item id is m000000.

import { MercariClient } from 'mercari-client';

const client = new MercariClient();

const item = await client.getItem('m000000');

Resulting item will look like:

{
  "version": "2",
  "id": "...",
  "title": "...",
  "description": "...",
  "price": "...",
  "shipping": "...",
  "date": "...",
  "imageUrl": "https://(...).jpg",
  "seller": {
    "userId": "...",
    "username": "...",
    "profile": "https://(...)/"
  }
}