twaddington / django-olcc

A web interface and API for searching the OLCC price list.
http://www.oregonliquorprices.com/
MIT License
19 stars 8 forks source link

Price API doesnt provide latest pricing #15

Closed Soteark closed 4 years ago

Soteark commented 4 years ago

I could be misunderstanding how to look up a price via the API, but when I use http://www.oregonliquorprices.com/api/v1/price/ID/?format=json i.e. http://www.oregonliquorprices.com/api/v1/price/1883/?format=json

I get an old price compared to what is being displayed on the website.

Soteark commented 4 years ago

just want to add to this, it seems specifically with this certain ID. (1883). Guessing there are others. The Price it shows is from 2012 even though the website shows more up to date pricing.

image

image

image

twaddington commented 4 years ago

@Soteark try this:

http://www.oregonliquorprices.com/api/v1/price/?format=json&product=1883
twaddington commented 4 years ago

The URL you were using before was loading the price entry with id "1883", not the product.

For example, here's how to load products by product code (instead of database id):

http://www.oregonliquorprices.com/api/v1/product/?format=json&code=7406B
Soteark commented 4 years ago

Wonderful! Thank you so much, and thank you for having built this API

twaddington commented 4 years ago

@Soteark you're welcome! Best of luck with your project.