📺 Chromecast API within your local network
API Endpoint | API Documentation | Swagger UI
The idea of this project was to play a bit with the awesome PyChromecast Python library and move its functionalities to a the black box concept of an API.
Currently the implemented API, at port 8321
, is able to list all the available devices within the local network and cast a source given the device name and a URL with some media. Optionally, you can set source_url=random
for being surprised with one of the gallery videos.
http:https://localhost:8321/play?source=CHROMECAST_NAME&source_url=random
Apart from its functionality, an API documentation (using ReDoc) and the typical Swagger UI are available at the following URLs.
- API documentation: http:https://localhost:8321/docs
- Swagger UI: http:https://localhost:8321/ui
- Python 3.7+
Usage of virtualenv is recommended for package library / runtime isolation.
To run the API, please execute the following commands from the root directory:
-
Setup virtual environment
-
Install dependencies
pip3 install -r requirements.lock
-
Run the server as a uWSGI server with the given bash script
./run.sh
or as a Python module
python3 -m src
MIT © Chromecast API