208

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.

So, what is the semantic difference between an SDK and an API?

2
  • 3
    SDK is a Development Kit, usually a client side library that facilitates usages of an API. An API is just the library/service definition and or documentation.
    – dietbuddha
    Aug 21, 2011 at 5:50
  • see also" Library vs. framework vs API?
    – gnat
    Jan 9, 2016 at 6:27

12 Answers 12

199

I think it rather falls along the lines of "All SDKs are 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 is 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.

5
  • 9
    I'd like to add that an SDK is just a sample of how you would interact with said API. Aug 17, 2011 at 20:55
  • 11
    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). Aug 17, 2011 at 22:26
  • 8
    An SDK can include an API, tools, documentation, samples, and everything else that's needed.
    – gregmac
    Aug 18, 2011 at 2:02
  • 4
    @gregmac Did I not convey that fact?
    – user7007
    Aug 18, 2011 at 2:12
  • 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?
    – Ben
    Mar 14, 2015 at 10:50
96
  • API = Application Programming Interface
  • SDK = Software Development Kit

So the real difference is: an API is no more nor less than an interface to "some service", while an SDK is a set of tools, components and/or 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.

Examples of APIs:

Examples of SDKs:

1
  • 3
    +10 for "you might use an API without having the underlying components". Btw, second link is down.......
    – Pacerier
    Aug 27, 2014 at 4:10
26

API → documented interface (at a certain point in time, and for a certain audience. Documentation might be incomplete and/or unavailable to the general public and this might be on purpose, but this does not dimish the fact it was meant to be documented for third parties to use it.)

SDK → interface documentation ( + examples & tools )

4
  • 4
    Finally someone that mentions documentation!
    – gregmac
    Aug 18, 2011 at 2:02
  • 4
    Not all API's are documented - sometimes you just have to inspect/reflect the interface. Aug 3, 2014 at 18:12
  • Isn't "examples" part of API?
    – Pacerier
    Aug 27, 2014 at 4:15
  • 1
    @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.
    – ZJR
    Aug 28, 2014 at 12:40
20

"SDK" is collective in a larger sense than "API".

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.

Neither term is very precise without some context.

1
  • haha----this is my stance exactly. what a broad term and it indeed needs full context since we can implement software to do virtually anything we want it to do via any mechanism or medium necessary---everything has an api and is an api (even an sdk has a command line interface which is in of itself---an api under the hood and at the syntax /argument level---each layer delegates to some compiled binary or a script which is still a binary---e.g. the /bin folder in most project).
    – A-Dubb
    Oct 4, 2020 at 20:08
16

What is API?

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.

1
  • I share your sentiment as well as that of @Caleb---it's such a massive and meta term like the indefinite amount of dev roles we have in any given engineering firm.
    – A-Dubb
    Oct 4, 2020 at 20:10
7

An SDK could be nothing but an API (files to help interface with another app), but usually includes other code to help with debugging and other pieces for your IDE.

I'm all out of acronyms.

2
  • 8
    Quick, get yourself some more TLAs! Aug 17, 2011 at 22:19
  • 4
    I'm about ready for EIEIO.
    – JeffO
    Aug 18, 2011 at 1:10
5

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.

2

Lots of the other answers explain that an SDK is tooling, but none of them directly comes out and says that an API is a specification.

The API for compoonent X is all the information that you need in order to write some other component that will interact with X. An SDK for component X may contain library routines that make it easier for you to write that component, but the libraries are not the API: They are merely an embodiment of the API.

4
  • is this merely your opinion or you can back it up somehow?
    – gnat
    Aug 29, 2016 at 17:24
  • "the API describes and prescribes the expected behavior while the library is an actual implementation of this set of rules" en.wikipedia.org/wiki/… Aug 29, 2016 at 17:45
  • per my reading this is not related to point you're trying to make: "that an API is a specification"
    – gnat
    Aug 29, 2016 at 17:47
  • I know this is an old thread but In the context of An API and its SDK, what Solomon is saying makes perfect sense to me.
    – Lost
    Feb 20, 2021 at 18:23
1

My two cents: I believe the term API is often used incorrectly.

An API is an Application Programming Interface.

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.

1
  • 1
    I agree. I'd probably stop short of saying that it's "incorrect". This ship has sailed and use of "API" has shifted. But I do agree that "library" is often a better word for what people are calling "API"
    – Harry Wood
    Jun 1, 2016 at 0:59
-3

I would like to compare this way.

If you are a Developer using Microsoft Tools:

API = Microsoft.Net Framework Vs SDK = Visual Studio

If you are a Developer using Java:

API = Java RunTime Vs SDK = Any tool that would provide the Development Kit (JDK)

I guess an SDK would necessarily have to rely on a corresponding API - there is no SDK without an API.

2
  • I think what you're talking about in terms of Visual Studio is an IDE, which can provide access to one or more SDKs and/or APIs.
    – KeithS
    Aug 18, 2011 at 16:58
  • 1
    Visual Studio is not an SDK but some editions include the Windows or .NET SDK as you're likely to develop for them using VS. Aug 3, 2014 at 18:18
-3

Here is a simple analogy... APIs are like words that you can use, and SDKs are like sentences that have been put together for you.

-4

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.

1
  • 1
    this doesn't seem to offer anything substantial over points made and explained in prior 11 answers
    – gnat
    Aug 2, 2014 at 14:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.