Parse JSON within Python -


i wanted ask can solve issue have.

essentially making stock checker sneakers adidas, know endpoint obtain stock json data given me whilst readable , contains need contains bunch of other information unnecessary trying do.

example of link endpoint:

http://production.store.adidasgroup.demandware.net/s/adidas-gb/dw/shop/v16_9/products/(bz0221)?client_id=c1f3632f-6d3a-43f4-9987-9de920731dcb&expand=availability,variations,prices 

this link json containing stock of shoe, price , availability. however, if try open you'll see responds bunch of useless info such description of shoe , price not need.

a github repository using try , grips requests trying make is:

https://github.com/yzyio/adidas-stock-checker/blob/master/assets/index.js 

i can give me json response trying strip don't need , keep need finding difficult in python.

many thanks!

since you've said can json response server first think need tell python load json.

import json data = json.loads(response_from_server) 

after doing can access values in json object way access them via python dict.

data["artist"]["id"] 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -