Context card
SDK vs. API
What is the difference between an SDK and an API?
The short answer
An API is an interface: the contract of operations, data formats and rules through which one piece of software uses another. An SDK is a kit built around one or more APIs — libraries in a given programming language, authentication helpers, samples, tools and documentation — that makes the API easier and safer to use. An API can exist without an SDK; an SDK always rests on some interface.
For: Technical writers and developers documenting APIs and SDKs
Key points
- The API defines what can be called, with which data and which responses.
- The SDK implements calls to it in a programming language and handles authentication, retries, pagination and errors.
- Several SDKs in different languages can wrap the same API; many are generated from a machine-readable interface description.
- Versioning concerns both: an API version changes the contract, an SDK version changes the library.
The context
Contract and kit
An application programming interface is a contract. For a REST API it lists endpoints, methods, parameters, data formats and error codes. The interface contract holds whether or not any client library exists.
A software development kit is built on top: software libraries that turn API calls into functions of a programming language, helpers for authentication, handling of limits and errors, samples and reference documentation.
Why the difference matters
Documentation for an API describes the contract; documentation for an SDK describes how to use the library — installation, configuration, idiomatic calls. Both need versions: semantic versioning of the SDK does not replace versioning of the API it calls.
See the encyclopedia article Developer SDKs.
Questions readers ask next
- Can I use an API without its SDK?
- Usually yes, by sending the requests directly. The SDK saves work and reduces mistakes, for example in token handling or retries.
- Is a client library the same as an SDK?
- A client library is the core of a developer SDK. The SDK usually adds tools, samples and documentation around it.
Sources
- OpenAPI Specification — OpenAPI Initiative
- RFC 6749: The OAuth 2.0 Authorization Framework — IETF, October 1, 2012
Review log and changes
Every context card is checked against its sources before it is published, and again whenever it changes; the date under the byline is the last review. Corrections (something was wrong) and additions (something was missing) are logged below with date and time (Berlin time). Typos, formatting and link fixes are not listed.
Reviewed
No corrections or additions since publication.