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 Python

Sending a simple GET request with Python

- [Instructor] In the previous video, we leveraged the AI metadata function to pull metadata from the API for the PG AE series. In this video, we'll use the metadata we pulled 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'll need to define the following four arguments, API key, API path, frequency, and 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, define the API access key and route. We'll use the same method as before to load the API key using the get N function. Likewise, we will use the same route as before and add data at the end of the route to indicate that this is a data request as opposed to metadata request. So I'm going to add your data to ensure that the API will return us data. Next, is the frequency argument, which defines the series timestamp format. Let's go to the metadata above and…

Contents