JonathanVusich / pcpartpicker

This is an unofficial API for the website pcpartpicker.com.
GNU General Public License v3.0
90 stars 7 forks source link

How to get all data and save it to json file. #41

Closed rinodung closed 5 years ago

rinodung commented 5 years ago

This is my code to get all data of https://pcpartpicker.com/

from pcpartpicker import API
import json
api = API()
supported_parts=api.supported_parts

for supported_part in supported_parts:  
    with open(supported_part+'.json', 'w') as f:
        data_tempt = api.retrieve(supported_part).to_json()
        print(data_tempt, file=f)      # Second Example     

Save it as run.py and type: python run.py to in your current working folder.

JonathanVusich commented 5 years ago

I'm not sure why this is here....Are you having a specific problem that you are looking to solve?