Topic: API – basics of connecting + simple queries
API (Application Programming Interface): an application programming interface provided by many web services. API provides a set of procedures, protocols, and tools enabling sending and receiving content from a given service. Using an appropriate programming language, API allows sending access requests to services from one application to another. The 3 key types of API are: REST API, SOAP API, and RPC API.
REST API: (Representational State Transfer API) is primarily a part of web services designed for making requests and receiving feedback using HTTP functions. There are 4 main HTTP commands on which REST API is based, namely – GET, PUT, POST, DELETE.
SOAP API: (Simple Object Access Protocol), a protocol that adheres to specific standards. It depends on particular systems and programming based on XML. It is also worth mentioning that it requires more information to function properly than other types of this technology. SOAP API is most often used in application programming interfaces dedicated to financial institutions.
RPC API: (Remote Procedure Call) in short, is responsible for remote procedure calling. It was the earliest form of API designed to execute a block of code on another server. It is also worth mentioning that RPC used over HTTP can transform into WEB API.
Below is an example of using SOAP API with the Python language.
Required tools:
requests – One of the most popular Python libraries used for communication with APIs. To use the library, it must be imported in the code: