Member-only story
How to Get Data from APIs with Python 🐍
A data scientist needs data. Without data, you don’t have a model, a dashboard, or an app. In this article, you’ll learn how to query APIs to get the data you need to build cool stuff! 🚀
It’s a bit of a cliche to say that data is the new oil. I like to think of it more as a renewable resource like wind.💨 Whatever energy source you choose as your metaphor, you want to harness some of its power! ⚡️
Ideally, you have direct access to the data you want in a file or a database you control. When that’s not the case, if you’re lucky, the data will be available through a public-facing an API. ☘️
In this article, I’ll show you the steps to get the data from a public API using Python. 🐍 First I’ll show you how and where to look for a Python API wrapper and share the largest repository of Python API wrappers. 🎉
Then I’ll show you how to use the requests library to get the data you want from an API that doesn’t have a Python wrapper.
If the data you want is on a website, but not available through a public-facing API, there are several options for scraping it. When to use which scraping package is a whole other article I have in the works. Follow me to make…