I'm trying to build inventory checker application using walmart api. I started playing with the open source api's provided in https://developer.walmartlabs.com/docs/read/Home
eg: http://api.walmartlabs.com/v1/items/12417832?apiKey={MYKEY}&format=xml
Can someone please help me understand how to retrieve stock/quantity and local store by providing zip code and id.
There are existing web apps like brickseek and bmsteek etc..
https://search.mobile.walmart.com/v1/products-by-code/UPC/027242901605?storeId=1 works.
You may combine other walmartlab APIs to convert sku to UPC, get store ids by zip code and pass it to the above url.
I've been trying to do the same, and as far as I can tell, you can't.
So, the developer of Walton (Walmart stock lookup app) shared a bit of his code
this.walmart.dotcom.query.URL1 = 'http://mobile.walmart.com/m/j?e=1&version=2&service=Browse&method=searchByDepartmentFiltered&p1=';
this.walmart.dotcom.query.URL2 = '&p2=ENTIRESITE&p3=All&p4=RELEVANCE&p5=';
this.walmart.dotcom.query.URL3 = '&p6=50&p7=%5B%5D';
this.walmart.dotcom.upcq = 'http://www.walmart.com/product/mobile/api/upc/';
this.walmart.dotcom.item = 'http://www.walmart.com/product/mobile/api/';
this.walmart.store.query = 'http://search.mobile.walmart.com/search?query=';
this.walmart.store.items = 'http://search.mobile.walmart.com/items';
getWalmartDotcomQuery(query){
return this.http.get(this.walmart.dotcom.query.URL1 + query + this.walmart.dotcom.query.URL2 + '0' + this.walmart.dotcom.query.URL3).map(res => res.json()); } getWalmartDotcomQueryMore(query, more){
return this.http.get(this.walmart.dotcom.query.URL1 + query + this.walmart.dotcom.query.URL2 + more + this.walmart.dotcom.query.URL3).map(res => res.json()); } getWalmartDotcomUPC(upc){
return this.http.get(this.walmart.dotcom.upcq + upc).map(res => res.json()); } getWalmartDotcomID(id){
return this.http.get(this.walmart.dotcom.item + id).map(res => res.json()); }getWalmartStoreQuery(query, offset){
return this.http.get('http://search.mobile.walmart.com/search?query='+query+'&store='+this.storeid+'&size=20&offset='+ offset).map(res => res.json()); }
Looks like we have to cross reference it from their official website as well.
Source:
https://www.reddit.com/r/walmart/comments/4hsq7s/questions_about_walmart_api/d2ste4f/
来源:https://stackoverflow.com/questions/39844345/walmart-retrieve-stock-quantity-and-local-store-by-providing-zip-code-and-id