This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#gets data from API | |
import requests | |
from io import BytesIO | |
from zipfile import ZipFile | |
def QueryAPI(query_name): | |
api_url=f'http://oasis.caiso.com/oasisapi/SingleZip?queryname={query_name}&startdatetime=20180919T07:00-0000&enddatetime=20180920T07:00-0000&market_run_id=DAM&version=1' | |
response = requests.get(api_url) | |
zipfile = ZipFile(BytesIO(response.content)) | |
output_url="/Users/miriammakhyoun/Desktop/Python Class 2018/Energy Storage/Data/Raw/" |