While refactoring a previous project, I found that one of the organizations I used an API from previously also provides whats called an SDK, or Software Development Kit. In an effort to continue expanding my knowledge, I attempted to use the SDK, and found that it can be confusing to distinguish at first glance the difference between SDKs and APIs. Hopefully, this post will help clear up some of the confusion.
As I mentioned in previous posts, API stands for Application Programming Interface, and allow an application to contact and interact with an external service. Most of my experience is with whats called RESTful APIs, which use specific commands and requests (in HTTP syntax) to interact with the API. SDKs, on the other hand, are much more robust systems, as they can include many different tools for use, including APIs (hence some of the confusion between the two). These tools can include documentation, any number of APIs, code samples, libraries, and many more. It should be noted that while APIs can be called in a number of coding languages, SDKs work within one specific language.
An example that may be helpful for visualization is one that ties to the card game Magic: The Gathering. The website https://magicthegathering.io/ allows developers access to the vast number of cards and sets that have been put out for this game, through both an API and many SDKs. Within the documentation on the site, the API has a number of endpoints to link to within your code, or there are links to a number of SDKs, depending on the language being used. Each of the SDKs are housed within their own Github repositories, which also lays out the tools within the documentation.
Some other confusion can come up when to use each. As mentioned above, an SDK can hold an API within its contents, so when would it be best to use them? Much of this is determined by how you will be using the application you’re building. If you are looking to add a specific feature, or if you want a larger control over the features, the API may be the better choice in those cases. However, if you are anticipating using many of the tools already built in, it can save a lot of time to use the SDK. As always start with the documentation, and make sure to have a solid plan in place before starting work on a new application to determine your needs.