-2

So I was reading this: Reading JSON from a file?. So the person in this question was having trouble loading the JSON file that they presumably made. But I wanted to know if it was possible to load a JSON URL such as this: http://data.consumerfinance.gov/api/views.json. If it is possible, how would you do it? Would it be as simple as json.load(http://data.consumerfinance.gov/api/views.json)? If it isn't possible what would you recommend me to read this same JSON file?

PS. Someone tell how to earn reputation so I make a comment instead of having to ask a separate question.

Nanocode
  • 1
  • 1

1 Answers1

1
import requests
requests.get('http://data.consumerfinance.gov/api/views.json').json()

You'll need to have the requests library installed.

ngoue
  • 1,045
  • 1
  • 12
  • 25