APIs
Application Programming Interfaces (APIs) are a way for two computer programs to communicate with one another. With Web APIs, the data is often transferred in JSON format.
Star Wars Example
The following example uses SWAPI to populate a table with Star Wars Opening Crawl text.
See the Pen SWAPI API Example by Rich Hauck (@richhauck) on CodePen.
Library of Congress (LOC) Example
This example generates pulls a single instance from the Library of Congress (https://www.loc.gov).
For context:- LOC Documentation on JSON Requests
- Here's the search request: https://www.loc.gov/search/?q=camden%20yards
- adding &fo=json to the URL will return JSON: https://www.loc.gov/search/?q=camden%20yards&fo=json
- Here's the result page: https://www.loc.gov/item/2010630835/
See the Pen Camden Yards via LOC API by Rich Hauck (@richhauck) on CodePen.