Chapter 8. What Data Scientists Should Know About APIs
Working with APIs for data science is a necessary skill set for all data scientists.
Nate Rosidi, KDnuggets
API expertise is critical to being an effective data scientist. But a data scientist can’t become an expert in every API specialty—the field of APIs is nearly as wide as the field of data science. Thankfully, you don’t need to master every API specialty if you use the building-block approach: mastering one or two API-related skills at a time, and stacking additional skills on top of those as your skills grow. In my experience, the best way to acquire these building blocks is through hands-on coding projects that you share with the world for fast feedback. (That’s where the hands-on part of this book’s title comes from.)
The following are some of the most useful building-block skills for data scientists.
Using a Variety of API Styles
Out in the wild, there are a few major API architectural styles that you may come across. Chapter 2 discussed why an API provider might create a REST, GraphQL, or gRPC API. As an API consumer, you need to be flexible. This section explains how you can use whatever API style is available.
The most common API style is REST or RESTful. (For simplicity, I will use the terms interchangeably in this chapter.) A REST API has multiple endpoints, which are combinations of HTTP verbs and URLs. For example, to read league information from a football API, you might use an HTTP GET verb and the URL ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access