Intermediate Importing Data in Python
Learn to import web files, scrape HTML, request data from APIs as JSON and stream tweets into Python for analysis, in interactive exercises.
The web is a rich source of data, held in files at a URL, inside HTML pages or behind APIs that answer in JSON. Getting it into Python means sending HTTP requests, parsing what comes back and reshaping it into structures you can work with. You practice each step in code, then collect live tweets through a streaming API, load them into a DataFrame and run a first text analysis with plots.
What You Will Achieve
- Pull flat and non-flat files hosted on the web straight into a Python session
- Send HTTP requests in code and turn an HTML page into its text and hyperlinks
- Load JSON returned by an API into a Python dictionary and explore its keys and values
- Authenticate, stream tweets and build a DataFrame to analyze and plot them
Program Overview
Importing Files and Scraping Pages from the Web
Fetching data stored online as files or HTML, plus the basics of scraping and parsing web pages in Python.
- Flat and non-flat files at a URL
- urllib and the requests package
- Web scraping basics
- Parsing HTML with BeautifulSoup
Working with APIs and JSON
What APIs and JSON are, why APIs matter for getting data, and how to make API requests and handle the JSON they return.
- JSON structure and loading
- How APIs relate to the web
- Making API requests
- Querying the Wikipedia API
Streaming and Analyzing Twitter Data
A closer look at one streaming API: connecting with authentication, collecting live tweets and examining them in Python.
- Twitter API authentication
- Collecting a stream of tweets
- Tweets in a DataFrame
- Simple text analysis and plotting
Certificate Awarded (Paid)
Job Outlook
Bringing web and API data into Python is routine work in data analysis, data science and research, wherever projects draw on online sources such as web pages, public APIs and live feeds.
Good for: Analysts and data scientists who need to collect data from websites and APIs as part of their own Python work.
Keep in mind: Despite the Beginner label, it expects some Python first. The final chapter is built on the Twitter streaming API; Twitter is now X, so those steps may work differently today.
Bottom line: A focused follow-on in web data collection that pairs HTTP and scraping basics with practical API and JSON work.
Frequently Asked Questions
Which Python libraries handle the web requests?
The first chapter performs HTTP requests with both urllib and the requests package, printing the results of each, and then uses BeautifulSoup to parse HTML and pull out a page's text and hyperlinks.
Which APIs do the exercises query?
The second chapter introduces APIs and JSON and makes API requests, including to the Wikipedia API. The third chapter works with the Twitter streaming API: authentication, streaming tweets, then loading and plotting them.
What happens to the tweets after they are collected?
Once streamed, the tweets are loaded and explored, converted into a DataFrame, put through a small piece of text analysis and finally plotted, so the chapter runs through collection, structuring and a first look at the results.
Are transcripts available for the videos?
Yes. Each video carries a transcript you can reveal with the Show transcript control at its bottom left, and a course glossary is available in the resources section beside the lessons.


There are no reviews yet.