Description: This project uses the iTunes API to collect data on 200 tracks by The Beatles (from the US iTunes store). Information collected of each track include their artist's names, collection and track names, track ID, respective iTunes URL, track price, and more. Collected data was saved to a CSV file.
Language(s): Python
Package(s): Requests, JSON, Pandas
Software: Jupyter Notebooks
Motivation: This project was created to demonstrate skills in collecting data from APIs (that do not require authentication).
The main file for this project is located in root of the repository named iTunes API Data Collection.ipynb. If you have Jupyter Notebooks installed, you can download the .ipynb file and view it there. If not, you can view the project using Google Colaboratory here.
Note: Executing all cells in the project file will create a CSV file of collected data.
Documentation for the iTunes API can be found here.
Note: Data was collected on 12/27/21.
Python's Requests module was used to send a GET request to the iTunes API with the specified parameters:
- term = "the+beatles"
- country = "US"
- media = "music"
- limit = 200
These parameters were used to search the US iTunes store for up to 200 songs by The Beatles.
Python's json module was used to retrieve the data sent by the API. Each of the 200 results shared a similar structure:
A subset of this information (8 fields) was collected for each result including:
- artistName,
- collectionName,
- trackName,
- trackViewUrl,
- trackPrice,
- releaseDate,
- currency,
- and primaryGenreName
List comprehension was used to contain data relating to these fields.
Python's Pandas module was used to combine the lists of collected data into a single Data Frame.
That data was then saved as a CSV file (see iTunes_API_Data.csv).