What is an API? Reading Assignment – Questions
1) What is an API?
An API is an application of “pre-loaded code and instructions” that helps programmers to construct software and the client to communicate with the server. It is the interface that users communicate with as it abstracts away the complexity of the program to allow it to be more user-friendly.
2) In the article the author compares Java API to Twitter API. What is the main difference between these two APIs?
Java API:
A list of all classes that are part of the Java development kit (JDK). It includes all Java packages, classes, and interfaces, along with their methods, fields, and constructors. Similar to a user interface, which facilitates interaction between humans and computers. These prewritten classes provide a tremendous amount of functionality to a programmer.
Twitter API:
Twitter offers two APIs. The REST API allows developers to access core Twitter data and the Search API provides methods for developers to interact with Twitter Search and trends data.
–> Twitter has the search API, for interacting with search and trends, and REST API, for core data
In other words, the Java API is more a set of rules (manual) that allows you to transcribe code to work with Java while the Twitter API is a set of rules on how to interact with Twitter’s database coming from platforms on the outside.
3) The section in the article about abstraction is important, try to understand it and write down an abstraction from your daily life.
APIs are essentially anything that makes life easier. For example, password managers automatically store our passwords such that we need not remember them every time and they can be pulled out automatically if needed.
Other examples of API abstraction include remotely connected door locks that can be opened at the push of a screen button at a distance; QR codes that automatically pull up specific information or execute a particular action by simply capturing it with our phone’s camera; Spotify playlists, that automatically compile lists of songs based on our personal preferences; Push/Start buttons in certain cars that allow them to turn off without manually doing so with a key and ignition; bank standing orders or direct debits; Etc.