Skip to content

A mock-up API of a music streaming service so you can learn how scraping and APIs work

Notifications You must be signed in to change notification settings

thierrylahaije/apis-to-scrape

 
 

Repository files navigation

Music-to-scrape

We’re music-to-scrape, a fictitious music streaming service with a real website and API. Built for educational purposes, you can use us to learn web scraping!

Getting started

We'll post a link to the website and API here eventually.

Running this project

Using Docker

The easiest way to run our project is using Docker.

  • Install Docker and clone this repository.
  • Open the terminal at the root of the repository and run the following command: docker compose up.
  • Wait a few moments for the website and API to be launched.
  • Once these are launched, you can access them at these addresses:
    • API: http://localhost:8080
    • Front end: http://localhost:8000
  • Press Ctrl + C in the terminal to quit.

Manual setup (i.e., not using Docker)

Install packages and simulate data

  • Clone this repository
  • Ensure you have R installed, and run simulate.R in src/simulate to generate the ficitious data.
  • Install required Python packages
pip install fastapi
pip install fastapi_utils
pip install sqlalchemy
pip install pydantic
pip install uvicorn
pip install gunicorn
pip install flask
pip install flask_sqlalchemy

Start the API

  • Open terminal
  • Go to the sql_app folder inside the repository
  • Run the following command: uvicorn main:app --port 8080
    • If you want to the FastAPI connection, press Ctrl + C in the terminal to quit.
    • If you want to check the documentation, you can go to following address when uvicorn is started:
      • http://127.0.0.1:8080/docs
      • uvicorn will show you which link is used when running the application.

Start the front end

  • Open terminal
  • Go to the flask_app folder inside the repository
  • Run the following command: gunicorn app:app --bind 127.0.0.1:8000
  • If you want to the Flask connection, press Ctrl + c in the terminal to quit.

Changing the data

  • Open the simulate.R file within the src/simulate folder
  • Make your adjustments
  • Run the complete file top-down, and the databases will be updated.

Acknowledgements

About

A mock-up API of a music streaming service so you can learn how scraping and APIs work

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 95.3%
  • HTML 3.0%
  • Python 1.2%
  • Other 0.5%