![]() The URL we’ll be sending our HTTP requests to is, which you can find by scrolling down to the Browse APIs section of the webpage and opening the APOD dropdown menu: This section of the NASA webpage also states that the string “DEMO_KEY” can be used in place of a real API key value, so that’s what we’ll use in this tutorial. You should be able to stay well within these limits while following along with our HTTP requests experiment. The rate limits for the demo API key are 30 requests per hour and 50 requests per day, as explained in the DEMO_KEY Rate Limits section of the same webpage. If you wish to create one anyway, follow the instructions on the webpage and use the API key you’re given instead of the DEMO_KEY we’ll be using. You’ll see in the Authentication section that you do not need a unique API key to explore the NASA dataset. If asynchronous requests are a better fit for your use case, check out the companion blog post called Asynchronous HTTP Requests in Python with aiohttp and asyncio. ![]() Our goal is to make simple GET requests quickly using a variety of Python packages, rather than to compare and contrast all of the features and subtleties of each package. We’ll use NASA’s Astronomy Photo of the Day API (shortened to APOD throughout the rest of the tutorial) and open today’s photo in our web browser. In this experiment-based tutorial, we’ll walk through brief code snippets that show how to make a simple GET request using 5 of Python’s most popular requests-related packages. For example, in the Python ecosystem there are thousands of packages related to making HTTP requests. ![]() This is true when evaluating a family of third-party software packages, too. ![]() When it comes to software development, there are almost always several different ways to achieve the same outcome. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |