API types & real‑world use cases – deep dive - IndianTechnoEra
Latest update Android YouTube

API types & real‑world use cases – deep dive

“Most developers use APIs every day – but very few actually understand the different types of APIs and when to use them.”


1. The big picture: APIs are everywhere

Whether you are fetching weather data, processing a bank transfer, or validating a login token, you interact with an API. The image attached lists concrete examples – from product fetch to insurance claims and government records. But each of those scenarios uses a different architectural style or visibility level

API types & real‑world use cases – deep dive

Below we structure the two main dimensions: types by architecture (REST, GraphQL, SOAP, etc.) and types by accessibility (internal, partner, open). Then we map the examples from the image to the right category.

2. Who can use the API? (accessibility & visibility)

🔒 Internal API (private / backend‑only)

Used within a company – never exposed to external consumers. Typical flows:

  • Backend‑to‑backend communication (microservices talking to each other).
  • Frontend‑to‑backend for the same product (the UI calls internal endpoints).
  • Service‑to‑database (though often abstracted via a DAL, still internal).
  • Examples from the image: login system, token verify, stock update, payment sync – all usually happen via internal APIs before any external exposure.

🤝 Partner API (B2B / affiliate / data sharing)

Exclusively given to trusted business partners. Not public, but accessible outside the company firewall.

  • Affiliate integration – e‑commerce partners fetch product feed.
  • B2B integration / B2B portal – a supplier updates inventory via your API.
  • Commission tracking – ad networks share click/conversion data.
  • Healthcare records (FHIR APIs) shared with partner clinics.
  • Finance data – accounting software connects to bank APIs (often via partner agreements).
  • Logistics tracking – shipment status shared with retailers.

🌐 Open API (public / external)

Available for any developer (often with rate limits or API keys). Image examples that fit here:

  • Weather data – OpenWeatherMap or similar.
  • Product fetch – e‑commerce public catalog.
  • Govt records – open data APIs (data.gov style).
  • Sometimes bank transfer or payment sync if offered as open banking (PSD2).

📊 B2B / data sharing (overlaps with partner but broader)

The image explicitly lists “Data Sharing API” and “B2B Integration”. These are often contracted integrations where two companies exchange data – e.g., an insurance claim API used by hospitals, or a finance data feed used by accounting firms.

3. How does the API communicate? (architectural styles)

The image also lists: REST API, SOAP API, GraphQL API. Let’s detail each with use cases.

📡 REST API (Representational State Transfer)

Most common style – uses HTTP methods (GET, POST, PUT, DELETE) and stateless operations.

When to use: general CRUD, web services, mobile backends. Image examples: weather data, product fetch, stock update, login system are almost always REST.

⚙️ SOAP API (Simple Object Access Protocol)

XML‑based, highly structured, with built‑in error handling and security (WS‑Security).

When to use: enterprise scenarios, banking, telecom, government records where strict contracts are needed. Image examples that often use SOAP: bank transfer, insurance claim, govt records, finance data (legacy systems).

📊 GraphQL API

Query language where the client requests exactly the data it needs.

When to use: complex UIs, multiple data sources, mobile apps (bandwidth optimisation). Image examples: product fetch (if frontend needs custom fields), click analytics (aggregations), healthcare records (fetch only required patient fields).

🔁 other styles implied (but not explicitly named)

  • Backend‑to‑backend – often uses gRPC or message queues, but also REST.
  • Service‑to‑database – not a web API, but internal database drivers (excluded from web API styles).

4. Use‑case matrix: every example from the image classified

The image contains two sections: the left list (plain examples) and the right list (more technical categories). We unify them below.

Example / use case Typical API type (access) Typical architectural style Explanation
Weather dataOpen APIREST (often)Public data, simple GET requests.
Login systemInternal / partnerREST or GraphQLUsually internal, sometimes exposed as OAuth2.
Product fetchOpen / internalREST / GraphQLE‑commerce catalogue – can be public or internal.
Bank transferPartner (B2B) / internalSOAP or REST (ISO 20022)High security, often SOAP in legacy banks.
Insurance claimPartner (B2B)SOAP / REST / EDIIndustry‑specific, strict contracts.
Govt recordsOpen / partnerREST / SOAPOpen data portals (REST) or legacy (SOAP).
Payment syncInternal / partnerREST / webhooksBetween payment gateway and merchant.
Token verifyInternal (auth server)REST / OAuth2Introspection endpoint, internal or semi‑internal.
Stock updateInternal / partnerREST / message queueInventory sync – often real‑time.
Affiliate integrationPartner APIREST / XML‑RPCCommissions, product feeds.
Data Sharing APIPartner / B2BREST / GraphQL / SOAPGeneral term for controlled data exchange.
B2B IntegrationPartnerSOAP / REST / EDICompany‑to‑company automated workflows.
B2B PortalPartner (UI + API)REST / GraphQLWeb portal for partners, backed by APIs.
Healthcare recordsPartner / internalFHIR (REST) / legacy SOAPStrict compliance (HIPAA).
Finance dataPartner / open (open banking)REST / SOAPAccount aggregation, trading data.
Logistics TrackingPartner / openREST / webhooksShipment status – often real‑time.
Commission trackingPartner (affiliate)REST / postbacksAd networks, track conversions.
Click analyticsInternal / partnerGraphQL / RESTAggregated event data.

Note: The image also mentions “Internal API” as a category – we already covered it above, and “Open API” is the public face.

5. Deeper: internal communication patterns

The image lists three specific internal patterns:

  • Backend to Backend – microservices communicating synchronously (REST, gRPC) or asynchronously (message queues).
  • Frontend to Backend – the classic web/mobile app talking to its own server. Often REST or GraphQL.
  • Service to Database – not an API in the web sense, but a data layer (JDBC, ORM). Mentioned to show the full stack.

These are all internal API flavors, even if the last one is not a network API.

6. Real‑world scenarios – explained

  • Click analytics – an internal API collects page views, then a partner API might share aggregated reports with advertisers.
  • Insurance claim + Govt records – often require SOAP due to legal/validation requirements.
  • Payment sync – uses webhooks (a kind of API) to notify merchants about transaction status changes.

7. Summary: choosing the right API type

Internal APIs prioritise speed and internal contracts; 

partner APIs need strong security and SLAs; 

open APIs focus on developer experience. Architecturally, 

REST rules the web, 

GraphQL empowers flexible frontends, and 

SOAP remains in finance/insurance. The image captured a wide spectrum – from weather data (simple REST) to healthcare records (complex, regulated). Use this outline as your cheat sheet.


Post a Comment

Feel free to ask your query...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.