I am trying to read JSON data from the web, which requires authentication, is that possible to pass authentication details to pd.read_json or I must use requests for this?
df = pd.read_json("https://myurl.com/data.json", lines=False, auth=('username', 'password'))
import requests
r = requests.get('https://intranet.jsondata.com/xy.json', auth=('user', 'pass'))
json_content = r.json()
will get you the json
pd.read_json(json_content)
will read it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With