API (Application Programming Interface)
Definition
An API is a set of rules, protocols, and tools for building software applications. It defines how different software components communicate with each other — specifying the methods, data formats, and conventions for requesting and receiving services.
In modern infrastructure, APIs are the primary interface for managing cloud resources, containers, automation tools, and microservices.
API Types
- REST (Representational State Transfer): HTTP-based, resource-oriented, stateless. Most common for web APIs.
- GraphQL: Query language for APIs, clients request exactly the data they need.
- gRPC: Google’s high-performance RPC framework using Protocol Buffers and HTTP/2.
- SOAP: XML-based protocol, older enterprise standard with strict contracts (WSDL).
- WebSocket: Persistent, bidirectional communication channel.
API Concepts
- Endpoint: URL where the API is accessed
- Method: HTTP verb (GET, POST, PUT, DELETE, PATCH)
- Authentication: API keys, OAuth, JWT, mTLS
- Rate Limiting: Throttling to prevent abuse
- Versioning:
/v1/,/v2/prefixes or header-based - Webhook: Server pushes data to a client URL on events
API in Infrastructure
- Cloud APIs: AWS EC2 API, Azure REST API, GCP Cloud API
- Container APIs: Docker Engine API, Kubernetes REST API
- Automation APIs: Ansible modules, Terraform providers
- Monitoring APIs: Prometheus metrics, Grafana API
Related Terms
- REST — most common API architecture style
- GraphQL — alternative query-based API style
- gRPC — high-performance RPC framework
- OAuth — authentication for API access
- CI/CD — automation tools use APIs extensively
References
- Wikipedia: https://en.wikipedia.org/wiki/Application_programming_interface
- RESTful API guidelines: https://restfulapi.net/
- GraphQL: https://graphql.org/