I am trying to access an API and it is mentioned that it gives in HTML. I went through these answers
(Get html using Python requests?) but I am not getting my results. I just wanted to make sure I am doing it correctly as I am getting error like this ("'{"request":{"category_id":"717234","command":"category"},"data":{"error":"invalid or missing api_key'"
Is this API not working ? Is there any way to get HTML data and convert them to CSV or excel?
Here is the code which I am using.
import requests
URL = "https://api.eia.gov/category?api_key=YOUR_API_KEY_HERE&category_id=717234"
r = requests.get(url = URL)
r.text[:100]