# Working with APIs
An API
is an Application Programming Interface. This term describes some type of service that you can communicate with programmatically.
The Application is a collection of scripts and data. The application can be written in any programming language. The data can be stored in any type of database or any data format.
The Interface part is a list of methods and properties which can be accessed externally. Inside the application there are private properties and methods which cannot be accessed. The purpose of this is to protect the data by controlling access to the data.
As we are working with websites and mobile apps, the APIs that we generally work with are web APIs.
There are many publicly available APIs.
Sample JSON data for practicing and testing code (opens new window)
DarkSky is a public weather API. This is the public website (opens new window) - which uses the API. Here is the developer site where you can sign up to access the weather data through the API - https://darksky.net/dev/ (opens new window)
Rotten Tomatoes has an API - http://developer.rottentomatoes.com/docs (opens new window) and closely related to that is The Movie DataBase API (opens new window).
Flickr, the public image sharing site, has a public API - https://www.flickr.com/services/api/ (opens new window)
Imgur, another public image sharing site, has a public API - https://api.imgur.com/endpoints (opens new window)
Google has lots of public APIs like the Google Maps API (opens new window) and the YouTube API (opens new window).
Twitter has an API - https://dev.twitter.com/ (opens new window).
Facebook has an API - https://developers.facebook.com/ (opens new window).
Yelp has an API - https://www.yelp.com/developers/getting_started (opens new window).
SoundCloud has an API - https://developers.soundcloud.com/ (opens new window).
NASA has a Picture of the Day
API. Start here to register for an API key https://api.nasa.gov/ (opens new window)
And here is a list of public apis https://github.com/toddmotto/public-apis (opens new window) This is an external link. and another list of popular APIs - http://www.programmableweb.com/apis/directory (opens new window).
As you can see there are many many APIs that you can use to fetch data for your apps.
# Bringing It All Together
Once you have your AJAX fetch( )
calls to the API of your choice working and you want to bring the data back and display some HTML then you need to be comfortable with the fetch( )
method as well as all the DOM methods for manipulating web pages.
Here is an example video showing how to turn JSON data from the jsonplaceholder into actual HTML in a web page.