APIs (Application Programming Interface)
API is a way to communicate between the server and the client like sharing the data. It provides a bridge to communicate. There are generally on 2 basis APIs are categorized , first by access level (who can use it ) and by architectural style / protocol style.
On the basis of Access level, there are 4 types:
1. Public APIs : these can be accessed by anyone. they are publicly available for ex: Open Weather API, Google Maps API etc.
2. Private APIs: These can be accessed by only internal members. these are used for internal company communications.
3. Partner APIs : These can be used by authorized partners means if an api is associate with one company and another company is a partner of that company, it can be used by both companies if have authority.
4. Composite APIs: These are those in which only on single request data aggregate krke send krti hai ya multiple endpoints hote hai. Jisse microservices me latency kam hoti hai.
Get Aarya Rastogi’s stories in your inbox
Join Medium for free to get updates from this writer.
On the basis of Architectural Style:
- REST API(Representational State Transfer APIs):
These are state-less, uses HTTP methods and JSON data to communicate. More-popular, light-weight and human-readable. - GraphQL:
Meta Facebook made this style. It basically gives only those fields which are requesting. It removes the problem of under fetching and over fetching data. It runs only on single end-point. - gRPC (Google Remote Procedural Call):
It is created by google . it uses protocol buffers instead of JSON data which makes it not human-readable. it is fast/ high latency etc. Best for internal microservices communication. - Web sockets:
these are used for real-time communication. It gives / updates real time data , full-duplex, persistent two way communication. Bina request bheje real-time data bhej skti hai. Used for livechat apps/ stock market apps etc. - SOAP (Simple Object Acess Protocol)
it uses XML data format and WSDL schema . used for enterprise bank applications and support ACID properties. - Web hooks :
in normal api, client baar baar data mangta hai but in web hooks server par jab koi event hota hai to ye automatically api ki post request ko trigger krdeta hai.



