What Is The Api And What Is Its Use?
What Is The Api And What Is Its Use?
API or Application Programming Interface and the Application Programming Interface.
An API is simply the point of contact between a particular development environment and the developers, so that it allows these developers to take advantage of the services of this environment without having to build everything from scratch.
In general, the goal of the API is to hide the details , Encapsulation , and to highlight the way to take advantage of the code.
An example from reality to approximate the idea, when car engine companies produce a new engine, they package this engine and put it on the market for companies to benefit from it to build their own products such as cars, for example, and the company may use it without entering into the details of its manufacture. .
This is exactly what happens in programming when we use a class, function, or plugin in our project.
What really matters to us is how we use it to serve our project, not how it works.
Here are some examples of the API
There are many famous API's examples that we encounter every day, for example, Facebook, API allows websites to log in through it without the need to build a login system from scratch.
And there are plenty of other examples of APIs like Google Maps that allow developers to display parts of maps for a specific location on their app or website. Another example is when you buy something online from a specific site, this site uses the API of VISA to communicate with it and deduct the money from your card.
Another example, but this time from desktop applications, if you want to build a program and this program wants some control over the computer, it uses the API provided by the operating systems to control the device without the need for much work to obtain these powers and enter into programming at lower levels and you use Assembly language or assembly in order to do this process.
One last example , MySQL API in PHP , when you write a query like:
mysql_query('SELECT * FROM tablename'); All we care about is that the function is to query from the database but many details are hidden from the developers
API types
There are three approaches to API access policies.
√ private API
Is for internal use only.
This gives companies the most control over their API.
√ Partner
An API of this type is shared with select business partners.
√ Public
This type of API is publicly accessible and below is a list of some of these API's.
Practical examples of the API's Google API's:
Google provides a wide range of programming interfaces such as the Google Translate API, the Google Maps API, and the YouTube API.
√Facebook API's:
Facebook also provides a set of API's such as the Facebook social graph and is used to access a set of public data for users.
List of free API
Free API That you can use in your next project This great list on Github contains a lot of free API's that you can use in web development in your next projects.
REST API
Web services are primarily designed using SOAP, a protocol for communicating using HTTP and XML, although most modern web applications use the REST programming interface.
It was originally introduced in 2000 by Roy Fielding, and it is a set of structures and design principles used in building distributed systems and ensuring the communication of these systems and the exchange of any type of data (such as images, videos, etc.).
Building applications and the great flexibility that it enjoys.
In the REST API, the resource can be almost anything, for example a list of tweets on Twitter or the weather in a particular country.
Each of these resources is addressable, which in the case of web-based REST APIs is a URL, for example https://api.twitter.com/1.1/users/show?screen_name=twitterdev When the user of the API requests the address, the API will reply in any kind of format such as JSON, an image, or even a Web page.
The API provides the feature of sending data to other applications so that the application processes the data in the way it wants, which provides great flexibility in using the data, but this also has side effects as it is slower than the case of data processing and then sending the final product to the user.
List of free APIs And there are a lot of other examples, but these were famous examples, but the comprehensive API concept is not limited to these examples, but as we mentioned, it is generally hiding and encapsulating certain parts to be used in one way or another, and here the article ends and thank you.