From the course: Data Pipeline Automation with GitHub Actions Using R and Python

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Sending a simple GET request with R

Sending a simple GET request with R

- [Instructor] In the previous video, we saw how we can use the EIA metadata function to pull metadata from the API. In this video, we will use the metadata we pull to set and send to the API, a simple get request to pull data with the EIA get function. To set a simple get request with the EIA get function, we will need to define the follow four arguments, API key, API path, frequency, facets. Let's go and set those arguments using the above variables. Similar to the get metadata function, the API key and the API path defines the API access key and route. We will use the same method as before to load the API key using the Sys.getenv function and load it from the env variable, EI_API_KEY. Likewise, we will use the same route as before and add the data at the end of the route as we wanted to inform the API that this is a data request and not a metadata. Next, is the frequency argument. Let's go ahead to the metadata output and see what are the options. You can have it over here on the…

Contents