This project provides a RESTful API for various functionalities, including YouTube video management, WebSocket connections, and Bitcoin price retrieval. It is designed to serve as a backend for applications requiring these services.
To start the API server, use the following command:
$ source .env
$ pm2 start --name api-v3 run.shThe server runs on 127.0.0.1:1239 and is accessed via a reverse proxy.
- YouTube API: Fetch subscription videos and download YouTube content (video/audio).
- WebSocket API: Establish and manage WebSocket connections for real-time communication.
- Bitcoin API: Retrieve the current Bitcoin price from blockchain.info.
- Go 1.18 or later
- Gin framework
- Swaggo for API documentation
- Additional dependencies listed in
go.mod
To generate Swagger documentation, run:
$ swag init- YouTube API
GET /youtube/subscriptions/:token: Fetch subscription videos.GET /youtube/download/:type/:id: Download YouTube video or audio.
- WebSocket API
GET /webconnect/new/:channel: Create a new WebSocket connection.GET /webconnect/connect/:id: Connect to an existing WebSocket.
- Bitcoin API
GET /bitcoin/price: Retrieve the current Bitcoin price.