Introduction to APIs
In today’s highly connected, highly competitive world, where the efficacy of processes can mean the difference between success and failure, one of the most important players, from a technology standpoint, is application programming interfaces (APIs). They help us connect our systems, automate processes in those systems, and adapt those systems to our needs instead of our needs to those systems. All that is done thanks to APIs.
This book will explore how to build APIs in Go from scratch. We’ll start with the basics of an API and how to explore it. Then, we’ll go through the incremental process of creating an API, from adding the basic endpoints to incorporating things such as security and telemetry. As an optional exercise, we’ll use a web framework instead of the standard library and an ORM instead of SQL queries.
In this chapter, we’ll cover the following topics:
- The different kinds of APIs
- The basic concepts around REST APIs
- How to build a very basic API in Go
But let’s start from the beginning. What exactly is an API? Let’s talk about this.