Matt-Brigida / EIAdata

R Wrapper for the Energy Information Administration (EIA) API
16 stars 15 forks source link

Does EIA transition to API 2.0.1 present a code risk? #18

Closed sawyervillers closed 2 years ago

sawyervillers commented 2 years ago

The EIA is transitioning to a new RESTful architecture in November2022. I'm curious if this will break or cause problems with the EIAdata package.

Reference: https://www.eia.gov/opendata/documentation.php

sawyervillers commented 2 years ago

What spurred this question is that I've been getting the following error lately. It's hit or miss when querying the EIA, and I'm not sure if it's a server issue or something with the code.

storagedf<-getEIA(ID='NG.NW2_EPG0_SWO_R48_BCF.W',eiaapikey)

Specification mandate value for attribute async attributes construct error Couldn't find end of Start Tag script line 44 Opening and ending tag mismatch: head line 3 and script xmlParseEntityRef: no name EntityRef: expecting ';' xmlParseEntityRef: no name EntityRef: expecting ';' error parsing attribute name attributes construct error Couldn't find end of Start Tag bo line 65 xmlParseEntityRef: no name EntityRef: expecting ';' xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name EntityRef: expecting ';' xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name EntityRef: expecting ';' xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name Opening and ending tag mismatch: link line 57 and head Failed to parse QName 'fb:like:' Namespace prefix fb for like:layout on a is not defined Specification mandate value for attribute compensate-for-scrollbar xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name xmlParseEntityRef: no name Opening and ending tag mismatch: br line 715 and a Opening and ending tag mismatch: a line 715 and li Opening and ending tag mismatch: li line 714 and ol Opening and ending tag mismatch: br line 722 and ul Opening and ending tag mismatch: ol line 713 and div Opening and ending tag mismatch: ul line 711 and div Opening and ending tag mismatch: div line 138 and nav Opening and ending tag mismatch: div line 137 and header Entity 'nbsp' not defined Opening and ending tag mismatch: input line 824 and form Opening and ending tag mismatch: input line 822 and p Opening and ending tag mismatch: input line 821 and div Opening and ending tag mismatch: form line 820 and div Opening and ending tag mismatch: p line 820 and div Opening and ending tag mismatch: div line 810 and section Opening and ending tag mismatch: section line 808 and body Opening and ending tag mismatch: nav line 93 and html Premature end of data in tag header line 88 Premature end of data in tag div line 69 Premature end of data in tag div line 68 Premature end of data in tag body line 67 Premature end of data in tag html line 2 Error: 1: Specification mandate value for attribute async 2: attributes construct error 3: Couldn't find end of Start Tag script line 44 4: Opening and ending tag mismatch: head line 3 and script 5: xmlParseEntityRef: no name 6: EntityRef: expecting ';' 7: xmlParseEntityRef: no name 8: EntityRef: expecting ';' 9: error parsing attribute name 10: attributes construct error 11: Couldn't find end of Start Tag bo line 65 12: xmlParseEntityRef: no name 13: EntityRef: expecting ';' 14: xmlParseEntityRef: no name 15: xmlParseEntityRef: no name 16: xmlParseEntityRef: no name 17: xmlParseEntityRef: no name 18: xmlParseEntityRef: no name 19: EntityRef: expecting ';' 20: xmlParseEntityRef: no name 21: xmlParseEntityRef: no name 22: xmlParseEntityRef: no name 23: xmlParseEntityRef: no name 24: xmlParseEntityRef: no name 25: EntityRef: expecting ';' 26: xmlParseEntityRef: no name 27: xmlParseEntityRef: no name 28: xmlParseEntityRef: no name 29: xmlParseEntityRef: no name 30: Opening and ending tag

Matt-Brigida commented 2 years ago

Great question @sawyervillers. Under APIv1 Availability it says:

As of early 2022, EIA will maintain support for its legacy API (APIv1). Many applications may have been written to the APIv1 specification, and EIA have no immediate plans to close that platform.

So it looks like v1 will continue to be maintained and no changes need to be made to the EIAdata package (for now).

Note the error you are getting in the second post is almost certainly server side, but if it persists you can open a separate issue and I'll try and track it down.