First of all, it depends on what operating system you're using.

On Windows

If you right click and press "save" (Alternatively use ctrl-s) and then chose the file format "json" when saving.

On macOS

You can do this in a few ways, I'd suggest using curl. You'd do this by opening the terminal and navigating to the directory you'd like to download the file to. Then enter the following:

curl https://somedomain.com/somepath.json > fileName.json

This will download the file in its original format.

Answer from Maximilian on Stack Overflow
🌐
Reddit
reddit.com › r/data › good easy way to download json from the web?
r/data on Reddit: Good easy way to download JSON from the web?
July 20, 2022 -

So I've got a JSON file I want to download from a website.

The data comes in a URL that ends with a 6 digit ID number (unfortunately I cannot find a logic to the ID but it's not a single increment system, so I'd like to be able to check like the next 10,000 ID's say once a week).

I'd then like to pull parts of the JSON files into some kind of spreadsheet (dumping to a CSV is fine). There is a lot of data I don't need/want in these files. I know how to pull the data into excel but I feel like there will be a better way to do this automagically.

🌐
GitHub
gist.github.com › petermeissner › c15f178711266405528ed751cf0cb5fb
Download JSON file from webpage · GitHub
Share Copy sharable link for this gist. Clone via HTTPS Clone using the web URL. Learn more about clone URLs · Clone this repository at <script src="https://gist.github.com/petermeissner/c15f178711266405528ed751cf0cb5fb.js"></script> Save petermeissner/c15f178711266405528ed751cf0cb5fb to your computer and use it in GitHub Desktop. Download ZIP · Download JSON file from webpage ·
🌐
CodeSandbox
codesandbox.io › s › download-json-file-with-js-p9t1z
download json file with Js - CodeSandbox
January 30, 2020 - download json file with Js by hieuht2048
Published   May 20, 2019
Author   hieuht2048
🌐
Valentino G.
valentinog.com › blog › link-download
JSON files download with the anchor download attribute
April 5, 2020 - const form = document.forms[0]; form.addEventListener("submit", function(event) { event.preventDefault(); buildJSON(this); }); function buildJSON(form) { const data = new FormData(form); const entries = data.entries(); const obj = Object.fromEntries(entries); const json = JSON.stringify(obj); const dataURL = `data:application/json,${json}`; const anchor = document.querySelector("a"); anchor.setAttribute("download", "Your_data.txt"); anchor.setAttribute("href", dataURL); }
🌐
GitHub
gist.github.com › ganezasan › 4fbdfff0bf828eca3c74
Download JSON File · GitHub
Share Copy sharable link for this gist. Clone via HTTPS Clone using the web URL. Learn more about clone URLs · Clone this repository at <script src="https://gist.github.com/ganezasan/4fbdfff0bf828eca3c74.js"></script> Save ganezasan/4fbdfff0bf828eca3c74 to your computer and use it in GitHub Desktop. Download ZIP · Download JSON File ·
🌐
MyCleverAI
mycleverai.com › it-questions › how-can-i-download-a-json-file-from-a-link
How can I download a JSON file from a link?
- Direct Download: If the link directly points to a JSON file (e.g., ends with .json), clicking the link will usually prompt the browser to download the file. The behavior might slightly differ across browsers, but the common action is downloading the file. - Right-Click and "Save As": You ...
🌐
n8n
community.n8n.io › questions
Download image from Url(s) in a Json File - Questions - n8n Community
August 26, 2022 - I am new here and have problems to read all URL’s from a JSON file. You can find my workflow here. Maybe there is someone who can help me? I create a HTTP request to the JSON file. In another request I say that I want to get the “coverImgUrl” as a file, so I can read it as a URL and copy ...
Find elsewhere
🌐
URL to Any
urltoany.com › url-to-json
URL to JSON Converter - Free Online JSON Data Extractor
Convert any URL to JSON instantly with our free online converter. Extract structured JSON data from any webpage for API testing, data extraction, and web scraping.
🌐
UiPath Community
forum.uipath.com › help
Downloading JSON from Web and getting data to datable - Help - UiPath Community Forum
July 14, 2018 - Hi, I need to get JSON file from http address from web. Address returns JSON file. In file is a list of companys names and addresses. After that i need to get names to datable. I have no idea how to accomplish this, co…
🌐
JMP User Community
community.jmp.com › t5 › Discussions › How-to-parse-a-JSON-file-opened-from-URL › td-p › 44791
Solved: How to parse a JSON file opened from URL? - JMP User Community
September 28, 2017 - I would like to import a JSON file into JMP that is downloaded off of the web. The best way I've been able to do this is through the GUI, manually selecting File --> Open --> and entering the URL into "File Name".
🌐
Hacking with Swift
hackingwithswift.com › quick-start › concurrency › how-to-download-json-from-the-internet-and-decode-it-into-any-codable-type
How to download JSON from the internet and decode it into any Codable type - a free Swift Concurrency by Example tutorial
November 12, 2024 - let messages: [Message] = try await URLSession.shared.decode(from: url2) print("Downloaded \(messages.count) messages") // Create a custom URLSession and decode a Double array from that let config = URLSessionConfiguration.default config.requestCachePolicy = .reloadIgnoringLocalAndRemoteCacheData let session = URLSession(configuration: config) let url3 = URL(string: "https://hws.dev/readings.json")!
🌐
Mozilla Discourse
discourse.mozilla.org › t › download-a-json-from-personnal-website › 12158
Download a .json from personnal website - addons.mozilla.org - Mozilla Discourse
November 22, 2016 - Hello ! 🙂 Some days ago, I submited an add-on named “Drive+” to review, the version I submited use a .json file included in the package. At the time i submited the add-on I didn’t knew how the whole verification system worked, so now I know, I’m thinking about making the file external.
🌐
Reddit
reddit.com › r/learnpython › trouble downloading json files from a url
r/learnpython on Reddit: Trouble downloading JSON files from a URL
April 14, 2022 -

I'm trying to download JSON files from a URL. When I've attempted to open the saved JSON files in python, I get the error:

"raise JSONDecodeError("Expecting value", s, err.value) from None".

Whenever I try opening the JSON files in a URL, I see this:

"SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"

Below is a simplified version of my code. Is there a way to download JSON files correctly?

def read_url(url):

    urls = []
    psfiles = []
    
    url = url.replace(" ","%20")
    req = Request(url)
    a = urlopen(req).read()
    soup = BeautifulSoup(a, 'html.parser')
    x = (soup.find_all('a'))
    for i in x:
        file_name = i.extract().get_text()
        url_new = url + file_name
        url_new = url_new.replace(" ","%20")
        if(file_name[-1]=='/' and file_name[0]!='.'):
            read_url(url_new)
        if url_new.endswith('json'):
            urls.append(url_new)
      
    for i in urls:
        psfile = i.replace('url','')
        psfiles.append(psfile)
 
         
    for j in range(len(psfiles)):
        urllib.request.urlretrieve("url", "path to directory"+psfiles[j])


if __name__ == '__main__':
    while True:
        read_url("url")
        time.sleep(1800)
Top answer
1 of 2
5
here's a code snippet with requests that works >>> import requests >>> >>> url = 'https://old.reddit.com/r/learnpython/comments/v02hmv/trouble_downloading_json_files_from_a_url.json' >>> >>> response = requests.get(url) >>> json_data = response.json() >>> print(json_data) some of the output: [{'kind': 'Listing', 'data': {'after': None, 'dist': 1, 'modhash': '', 'geo_filter': '', 'children': [{'kind': 't3', 'data': {'approved_at_utc': None, 'subreddit': 'learnpython', 'selftext': 'I\'m trying to download JSON files from a URL. When I\'ve attempted to open the saved JSON files in python, I get the error:\n\n"raise JSONDecodeError("Expecting value", s, err.value) from None".\n\nWhenever I try opening the JSON files in a URL, I see this:\n\n"SyntaxError: JSON.parse: [...] if that doesn't work at your URL it's probably not valid a json string in the response you're getting
2 of 2
2
Imho you should start by actively debugging the stages in your code. The prime place to start is to check what is actually downloaded, eg add html = urlopen(req).read() # avoid confusing names like 'a' with open("base.html", "w") as fp: fp.write(html) to check in an editor or browser if that's a functional webpage that includes your data. Then add prints to the data extracted in BS, so links = (soup.find_all('a')) # again, more useful name print("found", len(links), "urls") for link in links: # you see now it reads more like English than 'for i in x' file_name = link.extract().get_text() print("file_name", file_name) url_new = url + file_name url_new = url_new.replace(" ","%20") if(file_name[-1]=='/' and file_name[0]!='.'): print("calling read_url with", url_new) read_url(url_new) else: print("skipping read_url") # or whatever you would call this case if url_new.endswith('json'): print("appending", url_new) urls.append(url_new) else: print("not json", url_new) same for the rest. Then you can actually know what parts are working and if it behaves like you're expecting.
🌐
ParseHub
parsehub.com › blog › scrape-data-json
How to Scrape data from any website to a JSON file | ParseHub
June 1, 2021 - ParseHub can extract data from any website and automatically export it as a JSON file. Better yet, ParseHub can run on a schedule and update your JSON file with new data every hour or day or week.
🌐
JSON Formatter
jsonformatter.org › json-url-decode
Best JSON URL Decode Online
This tools helps to convert JSON URL Encoded data to JSON Data String. [ is replaced with [ ] is replaced with ] { is replaced with { } is replaced with } " is replaced with " × · Load URL · Upload File · Close · × · DownloadUpdateSave OnlineCloseErrorDialog ·
🌐
European Medicines Agency
ema.europa.eu › home › about us › about this website › download website data in json data format
Download website data in JSON data format | European Medicines Agency (EMA)
November 19, 2025 - For medicines and related procedures, data is also available in a table format via the link below. The data in the JSON files and the data tables are the same: ... You can download JSON data for all documents published on the EMA website using the links below.
🌐
Jameslmilner
jameslmilner.com › posts › downloading-a-file-with-javascript
Downloading Text, JSON and Images with clientside JavaScript
January 8, 2023 - // Turn the JSON object into a string const data = "Hello world"; // Pass the string to a Blob and turn it // into an ObjectURL const blob = new Blob([data], { type: "text/plain" }); const jsonObjectUrl = URL.createObjectURL(blob); // Create an anchor element, set it's // href to be the Object URL we have created // and set the download property to be the file name // we want to set const filename = "example.txt"; const anchorEl = document.createElement("a"); anchorEl.href = jsonObjectUrl; anchorEl.download = filename; // There is no need to actually attach the DOM // element but we do need to click on it anchor.click(); // We don't want to keep a reference to the file // any longer so we release it manually URL.revokeObjectURL(jsonObjectUrl);