0
url = 'https://api.misoenergy.org/MISORTWDDataBroker/DataBrokerServices.asmx?messageType=getace&returnType=json'

pd.read_json(url)

ValueError: Expected object or value

pd.read_json(url, lines= True)

TypeError: initial_value must be str or None, not bytes

json sample:

{"MktDay":"11-19-2020","RefId":"19-Nov-2020 - Interval 14:10:00 EST","ACE":[{"instantEST":"2020-11-19 12:10:30 PM","value":"-60.95"},{"instantEST":"2020-11-19 12:11:00 PM","value":"172.85"},{"instantEST":"2020-11-19 12:11:30 PM","value":"344.70"}
2
  • The first code block works for me (python 3.9.5, pandas 1.2.0). Something else is wrong. Commented Aug 2, 2021 at 15:01
  • Check your pandas version. Commented Aug 2, 2021 at 15:02

1 Answer 1

1

Both of your examples worked for me.

you can try this as an option:

import requests
data = requests.get('https://api.misoenergy.org/MISORTWDDataBroker/DataBrokerServices.asmx?messageType=getace&returnType=json')
pd.read_json(data.text)
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, that worked. not sure why for the same URL, pd.read_json wont work, but requests.get would

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.