Coder Social home page Coder Social logo

price-errors's Introduction

Price Errors

About This Project

This project is designed with the goal of providing a toolkit for developers and deal enthusiasts alike in order to assist in automating the deal-finding process as well as catching the increasingly rare "price errors" that we all seem to miss out on. Most price errors are often caught, replicated, and shared within artificially exclusive, paid deal groups. The vast majority of these groups are a waste of time and my hope is that this project can provide a sufficient alternative to the few groups that do seem to garner regular success.

The two main sites that I aim to provide consistent updates for are Amazon and BestBuy.

Usage

BestBuy

This toolkit utilizes a few key BestBuy endpoints and exposes them to an easy to use api.

A few of these are demonstrated below.

Getting deals using a search query

Note: the more simplistic and vague the search query, the more items will be evaluated. This is because BestBuy's search recommondation api favors less complex queries.

TODO: Add option to use the normal search page

deals, err := bestbuy.FetchLatestDeals("gaming laptop", 10) // search query string, minimum percent off int
if err != nil {
	panic(err)
}

for _, deal := range deals {
	fmt.Println(fmt.Sprintf("%s - %d percent off - $%f", deal.Name, deal.Discount, deal.Price))
	
	// Name     string
	// Price    float64
	// Brand    string
	// Link     string
	// Discount int
	// CartLink string
}

Getting Open-Box offers for a specific sku

Note: if the sku is not available under a particular open-box condition, then the price and savings will be 0, so always check to see if it is available.

openBoxOffers, err := bestbuy.FetchOpenBoxOffers("4901811")
if err != nil {
	panic(err)
}

// There are 4 possible open-box conditions:
// - ExcellentCertified
// - Excellent
// - Satisfactory
// - Fair

log.Println(openBoxOffers.Excellent.Avail)   // bool
log.Println(openBoxOffers.Excellent.Price)   // float64
log.Println(openBoxOffers.Excellent.Savings) // float64

Getting finance options for a sku

financeOptions, err := bestbuy.GetFinanceOptions("4901811")
if err != nil {
	panic(err)
}

for _, financeOption := range financeOptions {
	fmt.Println(financeOption.Name)           // string
	fmt.Println(financeOption.OfferId)        // string
	fmt.Println(financeOption.MonthlyPayment) // float64
	fmt.Println(financeOption.TotalCost)      // float64
}

Getting inventory status for a zipcode

isAvailable, err := bestbuy.GetInventoryByZipcode("4901811", "zipcode")
if err != nil {
	panic(err)
}

if isAvailable {
	log.Println("In Stock!")
}

price-errors's People

Contributors

johnw7789 avatar

Stargazers

Peter Abbasi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.