I was looking through various APIs and SDKs, when I realized that I couldn't really tell the difference between something called an API and something called an SDK.

Both of them are, conceptually, a way for your program to interface with and control the resources provided by another piece of software, whether that other software is a web service, an end-user app, an OS service or daemon, or a kernel device driver.

11 Answers
11

I think it rather falls along the lines of "All SDKs are/contain APIs but not all APIs are SDKs".

An SDK seems to be a complete set of APIs that allow you to perform most any action you would need to for creating applications. In addition an SDK may include other tools for developing for the platform/item that it is for.

An API on the other hand if just a series of related methods that may be good for a specific purpose.

As an example, the JDK (Java Development Kit) contains the API as well as the compilers, runtimes, and other miscellaneous tools. The Java API is simply all the libraries that make up the core language that you can work with out of the box.

I'd like to add that an SDK is just a sample of how you would interact with said API.
–
The Muffin ManAug 17 '11 at 20:55

7

I think you may've inverted that Nick. An SDK is a superset of things, that contains (among other things) API's to interact with it's libraries (not the library itself, but the interface to the library that a coder using the library would use).
–
Danny StapleAug 17 '11 at 22:26

2

An SDK can include an API, tools, documentation, samples, and everything else that's needed.
–
gregmacAug 18 '11 at 2:02

In practical terms, would it be fair to say that an API most likely will just contain interface definitions that classes should implement, while an SDK would contain base classes with most of the standard functionality already programmed in?
–
BenMar 14 at 10:50

So the real difference is, that an API is no more or less than an interface to "some service", while an SDK is a set of tools/components/classes for a specific purpose. An SDK in fact presents you with an API to interface with. But you might use an API without having the underlying components, for example when the API is provided through a web service.

You typically find only one SDK to cover an entire platform. There's one MacOS X SDK and one iOS SDK, for example, and those each contain the API's for many different areas of functionality.

"API" was originally used as a collective term as well, and it's still often used that way (MAPI, WSAPI, etc.), but it's usually limited to some particular technology. The scope implied by the "API" seems to have diminished over the years; people used to talk about the "Mac Toolbox API" or the "Windows API," both of which obviously contained a lot of functionality. These days, it's not uncommon to hear "API" used to mean a single system function; a new version of an operating system might be said to contain hundreds of new API's, and what's meant is hundreds of new system calls.

@Pacerier ...absolutely not. Examples might be part of an API documentation, but the sheer interface might be "undocumented", (i.e. the documentation regarding it is kept secret to the outside world: think... idk, microsoft) while still being an API. It's just the interface. Functions, classes, calls, maybe a protocol, maybe a file format, but nothing more.
–
ZJRAug 28 '14 at 12:40

API is an interface that allows software programs to interact with each other. It defines a set of rules that should be followed by the programs to communicate with each other. APIs generally specify how the routines, data structures, etc. should be defined in order for two applications to communicate. APIs differ in the functionality provided by them. There are general APIs that provide library functionalities of a programming language such as the Java API. There are also APIs that provides specific functionalities such as the Google Maps API. There are also language dependent APIs, which could only be used by a specific programming language. Furthermore, there are language independent APIs that could be used with several programming languages. APIs needs to be implemented very carefully by exposing only the required functionality or data to the outside, while keeping the other parts of the application inaccessible. Usage of APIs has become very popular in the internet. It has become very common to allow some of the functionality and data through an API to the outside on the Web. This functionality can be combined to offer an improved functionality to the users.

What is SDK?

SDK is a set of tools that can be used to develop software applications targeting a specific platform. SDKs include tools, libraries, documentation and sample code that would help a programmer to develop an application. Most of the SDKs could be downloaded from the internet and many of the SDKs are provided free to encourage the programmers to use the SDK‘s programming language. Some widely used SDKs are Java SDK (JDK) that includes all the libraries, debugging utilities, etc., which would make writing programs much easier in Java. SDKs make the life of a software developer easy, since there is no need to look for components/ tools that are compatible with each other and all of them are integrated in to a single package that is easy to install.

What is the difference between API and SDK?

API is an interface that allows software programs to interact with each other, whereas a SDK is a set of tools that can be used to develop software applications targeting a specific platform. The simplest version of a SDK could be an API that contains some files required to interact with a specific programming language. So an API can be seen as a simple SDK without all the debugging support, etc.

Everything mentioned before is true, but about SDK I would like to add that a software development kit is (or should be) a really complete package with (almost) all the necessary tools for the development process, while API is "just" an interface to interact with.

Although kind of an awkward name, it means it's an interface. So an application might have an API to allow other applications to communicate with it. And a piece of software (e.g. a class in an OO system) might offer an API to allow other modules in the system to communicate with it.

However often the term API is used as a synonym of "library". I don't think that's a correct use of the word. Part of the library is an API to allow code to use it, but the library isn't an API.

And an SDK is a kind of library, so that's where the confusion might be.

As applications are developed and enhanced by interfacing them with other applications there is a need
to allow other applications (logic) to interface with the core logic - this is done via a defined set of APIs.
SDK is used to create / craft code that uses APIs to interact with other applications.