I am working on a project which involves geocoding.
Now I would like to use the JSON output of a link.
Unfortunately, when I try to log the output in the terminal, it just prints the link itself.
Do you want to access the data available in the link you provided? If the answer is yes, then you can use fetch. Otherwise, I do not understand what you are wanting to do here.
The link does not need to end in .json to access it. The data retrieved is in JSON format. That is all that matters.
The code you wrote above works for me. Do you see any error messages in the browser console? If I change the console.log(json) to console.log(JSON.stringify(json, null, 2), then I see the following in the browser console: