Star Wars API
Last updated
Last updated
For our first use of APIs, we're going to use a cool . One of the most important things about using APIs is taking the time to read the API documentation. Hopefully, all APIs you will ever use that you do not have access to the code of will have documentation; otherwise it's basically impossible to use successfully. In the upper right hand corner, we see a link to documentation. Let's look through it to better understand what we need to do to successfully use this API!
On the front page, you see a section called Introduction
and another section called Getting Started
. This is a pretty common pattern with API documentation and a great place to start to understand what is going on. This API also has provided a Base URL
for us: https://swapi.co/api/
. Another great thing about this API is that while it has a rate limit, it's pretty high at 10,000/day, meaning you can do TEN THOUSAND requests a day before they stop you. It's also an open API, which means it's super easy to get information from.
We're going to utilize this Star Wars API to make a little app. Since this is a large API with lots of different endpoints, lets focus our documentation research on the endpoint that we actually want to use! In this case, we're going to utilize the people
endpoint. Check out the documentation for this endpoint . Notice that the API Documentation nicely supplies a sample request and a sample response, as well as detailed information about the attributes of the response!
Make sure you read over the whole people
endpoint documentation (it's not very long) before we jump into the next step of actually utilizing this API and endpoint!