Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

save request response json to file python

import requests
# there is inbuilt json() constructor for requests.get() method
json_data = requests.get("https://api.blinkist.com/v4/books/5420831a63656400089f0000").json()
print(json_data)

# To actually write the data to the file, we just call the dump() function from json library
import json
with open('personal.json', 'w') as json_file:
    json.dump(json_data, json_file)
Comment

PREVIOUS NEXT
Code Example
Python :: convert string list to float 
Python :: python random hex color 
Python :: python strip non numeric in string 
Python :: pandas tuple from two columns 
Python :: long to_bytes python how to use it 
Python :: timeout exception in selenium python 
Python :: pandas columns to int64 with nan 
Python :: python time.strptime milliseconds 
Python :: pandas select all columns except one 
Python :: python except error as e 
Python :: how to make a star in python turtle 
Python :: get python script path 
Python :: index in zip python 
Python :: difference between w+ and r+ in python 
Python :: python cli parameter 
Python :: alias python in macbook 
Python :: autoslugfield django 3 
Python :: how to change window size in kivy python 
Python :: how to find element in selenium by class 
Python :: python change working directory to file directory 
Python :: pygame how to make a transparent surface 
Python :: django add media 
Python :: setwd python 
Python :: dislike_count 
Python :: label size matplotlib 
Python :: run celery on windows 
Python :: how to replace a word in csv file using python 
Python :: python tk fullscreen 
Python :: python remove empty string from list 
Python :: pandas_datareader 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =