0.0.3 • Published 3 years ago

bukalapak-scraping v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Bukalapak Scraping

Simple API Wrapper for Bukalapak. Intended for usage in Node environment.


Installation

npm i bukalapak-scraping

Example

const Bukalapak = require("bukalapak-scraping");

const bl = new Bukalapak();

async function run() {
	const products = await bl.search({
		query: "RTX 2080",
		page: 1,
		orderBy: Bukalapak.SEARCH.ORDER_BY.HIGHEST_RATING,
		priceRange: "10000000:30000000",
		ratingRange: "4:5",
		couriers: ["SiCepat REG", "JNE REG"],
	});
	console.log(products[0]);
}

run();

Check out product output example

API

new Bukalapak()

Creates new Bukalapak instance.

.search(parameters)

Searches for products, it's async so it returns a Promise of products.

parameters is an object that can have following keys:

KeyDescriptionValue
conditionProduct conditionstring ("new" | "used")
orderByOrder search resultstring ("price" | "-price" | "bestratingratio" | "bestselling" | "" | "date")Enum from Bukalapak.SEARCH.ORDER_BY
querySearch keywordstring
priceRangeProduct price rangestringformat: priceMin:priceMaxe.g: "10000:50000"
superSellerOnly shows results from super seller storeboolean
bukaMallOnly shows results from mall storeboolean
pagePage duhinteger
ratingRangeProduct rating rangestringformat: ratingMin:ratingMaxe.g: "3:5"
couriersList of allowed shipping couriers of the productsstring[]

Todo

  • Improve typings in Product interface
  • More test coverage
  • Improve documentation
  • Implement more API endpoint (such as: get product information, get shop information, etc.)
0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago