Data sharing commonly occurs by sending files over shared drives or email or providing direct access to a database. APIs (which stand for application programming interfaces) are becoming the best practice of making data more accessible for developers and third parties. Google Maps, for instance, created an API that allows third-party developers to embed maps into their product or complement other companies that are location-based like Yelp and Twitter. This improves Google Map’s brand recognition while also providing revenue streams from their users. Smaller companies can create APIs to provide data to a client via a dashboard or to allow access to data across internal teams. In an engineering setting, available APIs that are used every day include NOAA for retrieval of historical weather data and NREL PVWatts to retrieve solar generation outputs.
The most common type of API uses HTTP (Hypertext Transfer Protocol) as its data transfer protocol. This is the same protocol we use every day to request data from web servers, which then render the data into webpages where we view our news and emails. An HTTP works by sending a request to a server and receiving a response. A HTTP API request is comprised of a Method, API URL + Endpoint, Header, and Body. Below is a list of typical values for each component:
A company’s API typically includes documentation that describes the interactions and expected responses with each API endpoint. The endpoint is commonly human-readable to give an indication of the type of data that it provides and the values of parameters being passed. Here is an API request example using Google Maps:
With both JSON and XML, responses can be parsed to transform the data into a tabular format for processing in Excel or Python. Thus, APIs enable developers to programmatically access data and easily integrate it into existing workflows. The enhanced data accessibility from API also exposes the data to a broader audience, which may lead to new and exciting applications.