Web, Mobile and Software Consulting from a Cornell Bred, Intel Vetted Senior Software Engineer

What is an API and an SDK?

In web and mobile development you will encounter the terms API and SDK frequently. The term API will come into play more often during mobile development when your app is built on code native to your mobile device vs. being a mobile web app. I talk about these differences in Websites, web apps, mobile sites, mobile apps, desktop apps, etc.. In general, you will encounter APIs whenever your app, web or mobile, needs to talk to server-side code that is hosted separately from the app. You will encounter the term SDK less frequently as it deals more with internal coding practices and less with the application architecture.

API Definition

API stands for Application Programming Interface. It is a library of instructions living outside of your application. The API could be in a form accessible via HTTP (a URL endpoint, or, put simply, a link) or written directly for a specific server-side language and accessible via TCP protocol. If the API is developed to be accessible over HTTP, http-apiany server-side languages can call and access the API’s methods provided they have the correct authorization and know the appropriate URL endpoints to call. If written for a specific language, only that language has the ability to access the API’s methods and use them to carry out necessary transactions.

SDK Definition

SDK is a term that non-technical people will encounter less often. SDK stands for Software Development Kit. It is very similar to an API in that it is a stand-alone set of instructions. SDK’s can be accessed the same way that APIs can although more steer in the direction of being language-specific. Coming from the software engineering world, we refer to an SDK as any set of libraries we can use in our code to help speed up our development. For example, say you’re coding an application that calculates the fibonacci sequence. Instead of writing the function itself, you can utilize any number of SDKs available publically to do the calculations for you. All you will need to develop is a method that calls the SDK’s method and passes the required parameters. SDKs help prevent you from re-inventing the wheel each time you sit down to develop and therefore speed up development drastically. For many tasks in coding, chances are other developers have already worked on similar efforts and at least one of them made it a point to develop a publically available SDK. Since publically available SDKs aim to be used by many developers, they are much more thoroughly tested and polished than a single developer can do with newly created functions in a few days; yet another reason to utilize SDKs vs writing your own solutions from scratch wherever possible.

API Uses

When should you consider building an API instead of welding the set of logical instructions straight in the server-side of your app? This questions is really meant for web apps and mobile sites. This is because only apps hosted on a server have a server-side. Your native app, iOS, Android or other, does not have a server-side since it’s hosted on your own mobile device. In order to access the database or perform calculations that cannot be performed on your device (due to their memory intensive nature), your native app will have to call an outside set of instructions – an API.
However, you might also want to consider building an API even when you’re building a web-based app. If, for example, your business strategy is to focus first on the web app and build a mobile version that performs similar actions second, it is best to consider building an API that both your web and your mobile versions will use. One set of instructions will be used by two apps. This approach is much cleaner than coding separate set of similar instructions for the two different apps. It takes less coding, is easier to maintain and update, and makes for a more elegant architecture.

More questions about APIs or SDKs? Let me know below.