The robot wants to know if you have an API for it to use.
As 2018 winds down at Coord, one of the things we’re most thankful for are APIs. Not only do we offer them in our transportation data platform, we rely on them constantly for all sorts of purposes, whether for live toll data, bike share, parking meter rates, or trip planning.
But why are they so important?
Helping Programs Communicate
API stands for Application Programming Interface. It’s an interface — a way of interacting with the outside world — that helps programmers add a new kind of functionality to their application.
For example, say I have a program, and I want it to send text messages. I could write some code to do that, and add it to my program. But then, imagine my friend Julie tells me that she wants her program to be able to send text messages, too. I could share my code with her. But how would her program talk to my code?
My code needs a way for Julie to tell it what texts to send and who to send them to. It also needs a way to tell Julie whether the text message was sent successfully. Then I’d need to describe this way to Julie so she could make her program talk to my code in the right way. I’d need an API!
Ultimately, this is what an API is: an interface to a program that lets other programs talk to it. APIs are essential to modern software. They’re how the mapping app on your phone asks the operating system for your current location, or how Netflix tells your browser to play a movie.
Not every program has to have an API. Some programs don’t need other programs to talk to them. Video games, for instance, don’t need APIs: the only interface they need is one for humans. But increasingly, more and more different kinds of software are seeing the benefit of communicating with each other.
Curing Data Headaches
At some point in your life, you’ve probably had to do some data entry. This is one of the most tedious tasks of modern life: looking at a screen and copying words or numbers from one place to another.
For me, these tasks add insult to injury for one simple reason: the data’s already in a computer! Having people take information from one program just to put it into another is one of the most disrespectful wastes of time. Data entry is often slow, expensive, and error prone. It sometimes isn’t always feasible. For enormous datasets, or those that change constantly, it’s impossible for a human to even examine all of the data in a reasonable amount of time. Why can’t the programs just exchange data with each other?
The more data computers store, the more uses we see for that data, and the more often we want to get that data from one place to another. This is why APIs are becoming ubiquitous. When programs can communicate, it multiplies the number of things you can do with your data. Instead of being locked into a single application, your data is free to go wherever it is the most useful.
APIs and Data Standards
Data standards, like GTFS, are also about helping computers talk to each other, so it’s worth understanding the way that they work with APIs.
Data standards make sure that when lots of different programs share data with each other, they do so in the same way. As a result any of these programs can exchange data with each other without having to know which exact program they’re talking to. For instance, they might use a standard file format, standard units, or a standard geographical reference system. Data standards can even be as simple as URLs, which define a standardized way of talking about a location on the Internet.
You can have data standards without APIs: an example is the JPEG file format, which lets different programs open the same images but not talk to each other directly. You can also have APIs without standardization: Apple’s and Google’smaps APIs look different from each other even though they perform similar functions. But data standards and APIs work best together.
It’s easy to see why APIs work better when they share data in standard ways: this means that when your program talks to one program, it can talk very easily to other programs too. This is why we leverage standards like GeoJSONin our APIs here at Coord. But data standards also work better when they come with APIs. Good APIs don’t just share data back and forth: they help you work with it. Our Toll API, for instance, is more than just a catalog of toll roads in a standardized format. Instead of just showing you where tolls are, it also lets you discover which tolls you’ll pay on a particular route. Our Curb API let you find out curb regulations at particular times for particular vehicles. With an API, you also know where you can go to get the latest and most up-to-date version of a particular dataset.
Do you need an API?
APIs have lots of benefits, but they also come with an cost to implement them. It takes more time to connect your program to an API than to download a data file and upload it manually. If your organization offers APIs, it takes work to get the most out of them. So when are they useful?
It all comes down to who’s using your data, and how. If many of the people who want your data want to put it into another program, especially if the data changes frequently or is complex, you need an API. If the ultimate consumers of your data are fine visiting your website or downloading your app to get your data, you might not.
One reason we’re so focused on APIs at Coord is because we understand how interconnected the world of transportation is. There’s a lot of complicated stuff that people want to understand in order to figure out how to get around, from the rules of the road, to points of interest, to traffic, to parking. When it comes to logistics and fleet management, data management only gets more complex. Unless our services can be connected seamlessly to all this other information and the programs they are in, our services won’t be usable.
If you are like us and provide information or services, it’s important to understand not just the people in your audience, but the programs, too. By building APIs and connecting computer programs to each other, we can help people manage the increasing amount of data and complexity the world has to offer.