Traditional Culture Encyclopedia - Weather inquiry - What is API interface and what does it mean?

What is API interface and what does it mean?

As a software application, many resources and data are not necessarily provided by itself, and some functions still need to call services provided by third parties, which involves the call of API interfaces.

What is an API interface?

API refers to the application programming interface, through which we can realize specific functions without knowing its internal implementation details. The API interface can be understood as the encapsulation of a specific service, and the service is encapsulated for others to call, so that many functions do not need to be redeveloped.

For example, we want to know the weather in a week. It is difficult for us to realize this function ourselves, because only the meteorological department knows the weather data. So how do you know the weather information? The meteorological department provides data API for us to use. As long as we enter this area, we can know the weather situation in this area for a week, but we don't need to know how this weather forecast is realized.

In addition, data communication between different systems and programming languages often takes the form of API for data handover.

What are the common API forms?

As we mentioned above, API is actually the encapsulation of a kind of service. We can use different programming languages to write APIs, and different development habits and programming languages lead to different API styles. Common APIs have the following forms:

1, HTTP type interface

Based on the API provided by HTTP protocol, this kind of API is often provided in the form of "web address", for example, the mainstream RESTful now belongs to this kind of interface.

2.RPC interface

RPC refers to remote procedure call, which puts a part of code logic on a remote server and then calls it where needed (calling a remote method is like calling a local method). It is essentially a client/server model, which supports various protocols and data transmission methods.

3.web service interface

WEBService does not specifically refer to some kind of API. All the services we will provide in the form of Web are called Web services, and RESTful also belongs to Web services.