Use the requests module: import requests r = requests.get(https://api.fda.gov/drug/label.json) https://requests.readthedocs.io/en/master/user/quickstart/ The website you linked also has API documentation, check it out. Answer from the_shell_man_ on reddit.com
Real Python
realpython.com › python-json
Working With JSON Data in Python – Real Python
August 20, 2025 - If you followed along with the tutorial, then you’ve got a hello_frieda.json file that doesn’t contain newlines or indentation. Alternatively, you can download hello_frieda.json in the materials by clicking the link below:
Reddit
reddit.com › r/learnpython › how do i download json files from a website with python?
r/learnpython on Reddit: How do I download json files from a website with python?
December 16, 2020 -
It would be the files listed here. https://open.fda.gov/apis/drug/event/download/
I have been using youtube videos on how to bulk download but I haven't figure it out.
Top answer 1 of 2
8
Use the requests module: import requests r = requests.get(https://api.fda.gov/drug/label.json) https://requests.readthedocs.io/en/master/user/quickstart/ The website you linked also has API documentation, check it out.
2 of 2
2
Be prepared because it's gonna take you a long time to download the 1080 files. import json import requests def download_file(url): r = requests.get(url) filename = url.split('/')[-1] with open(filename, 'wb') as f: f.write(r.content) api_url = 'https://api.fda.gov/download.json' r = requests.get(api_url) files = [file['file'] for file in json.loads(r.text)['results']['drug']['event']['partitions']] count = 1 for file in files: download_file(file) print(f"{count}/{len(files)} downloaded!") count += 1
Videos
PyPI
pypi.org › project › jsons
jsons - For serializing Python objects to JSON
Uploaded Jun 9, 2022 Python 3 · Details for the file jsons-1.6.3.tar.gz. Download URL: jsons-1.6.3.tar.gz · Upload date: Jun 9, 2022 · Size: 39.9 kB · Tags: Source · Uploaded using Trusted Publishing? No · Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3 ·
» pip install jsons
SourceForge
sourceforge.net › projects › json-py
json-py download | SourceForge.net
Download json-py for free. json.py is an implementation of a JSON (http://json.org) reader and writer in Python. jsontests.py are unit tests demonstrating the correctness of the implementation.
Top answer 1 of 10
452
Get data from the URL and then call json.loads e.g.
Python3 example:
import urllib.request, json
with urllib.request.urlopen("http://maps.googleapis.com/maps/api/geocode/json?address=google") as url:
data = json.loads(url.read().decode())
print(data)
Python2 example:
import urllib, json
url = "http://maps.googleapis.com/maps/api/geocode/json?address=google"
response = urllib.urlopen(url)
data = json.loads(response.read())
print data
The output would result in something like this:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Charleston and Huff",
"short_name" : "Charleston and Huff",
"types" : [ "establishment", "point_of_interest" ]
},
{
"long_name" : "Mountain View",
"short_name" : "Mountain View",
"types" : [ "locality", "political" ]
},
{
...
2 of 10
165
I'll take a guess that you actually want to get data from the URL:
jsonurl = urlopen(url)
text = json.loads(jsonurl.read()) # <-- read from it
Or, check out JSON decoder in the requests library.
import requests
r = requests.get('someurl')
print r.json() # if response type was set to JSON, then you'll automatically have a JSON response here...
PyPI
pypi.org › project › jsonlib
jsonlib · PyPI
Details for the file jsonlib-1.6.1.tar.gz. ... See more details on using hashes here. ... AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page
» pip install jsonlib
Readthedocs
jsons.readthedocs.io
Features — jsons documentation
Jsons is a library that allows you to serialize your plain old Python objects to readable json (dicts or strings) and deserialize them back. No magic, no special types, no polluting your objects.
Stack Overflow
stackoverflow.com › questions › 52781589 › how-to-download-the-json-content-using-python
How to download the json content using python - Stack Overflow
import requests import json # docs.python.org/3/library/urllib.request.html#examples r = requests.get('raw.githubusercontent.com/wesm/pydata-book/2nd-edition/datasets/…) print(r) 2018-10-12T15:27:11.2Z+00:00
Code Forum
codeforum.org › software & web development › back-end development › python
Python - Generate (and download) JSON file from hosted site using server side python | Code Forum - Where your coding journey begins
July 23, 2022 - However, the only way I can see this working would be to call a python script from the trigger that would update the json file. I did read somewhere that the database would need an extension for this to work, and I don't think that will be an option from the hosting company?
Power CMS Technology
powercms.in › article › how-get-json-data-remote-url-python-script
How to get json data from remote url into Python script | Power CMS Technology
August 17, 2016 - check out JSON decoder in the requests library. import requests r = requests.get('url') print r.json() Python · Linux · Json ·
GitHub
github.com › ijl › orjson
GitHub - ijl/orjson: Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy · GitHub
orjson is a fast, correct JSON library for Python. It benchmarks as the fastest Python library for JSON and is more correct than the standard json library or other third-party libraries.
Starred by 8K users
Forked by 298 users
Languages Python 52.9% | Rust 46.4% | Shell 0.7%
W3Schools
w3schools.com › python › python_json.asp
Python JSON
JSON is text, written with JavaScript object notation. Python has a built-in package called json, which can be used to work with JSON data.
Python Basics
pythonbasics.org › json
Working With JSON Data in Python - Python Tutorial
The object will then be converted to a python object. ... You can get JSON objects directly from the web and convert them to python objects.
ReqBin
reqbin.com › code › python › rituxo3j › python-requests-json-example
How do I get JSON using the Python Requests?
To request JSON data from the server using the Python Requests library, call the request.get() method and pass the target URL as a first parameter. The Python Requests Library has a built-in JSON decoder and automatically converts JSON strings into a Python dictionary.