https://github.com/rimo02/youtube-fetch-api
Fetch youtube videos details periodically, featuring bulk write and also displays results in a paginated format.
https://github.com/rimo02/youtube-fetch-api
bulk-operation go-fiber pagination youtube-api-v3
Last synced: about 1 month ago
JSON representation
Fetch youtube videos details periodically, featuring bulk write and also displays results in a paginated format.
- Host: GitHub
- URL: https://github.com/rimo02/youtube-fetch-api
- Owner: rimo02
- License: mit
- Created: 2024-11-13T18:56:37.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-11-28T18:02:17.000Z (10 months ago)
- Last Synced: 2025-04-08T22:22:25.969Z (6 months ago)
- Topics: bulk-operation, go-fiber, pagination, youtube-api-v3
- Language: Go
- Homepage:
- Size: 13.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YouTube Videos Fetcher
This project is a Golang-based server designed to interact with the YouTube API. It fetches video data periodically, stores it in a database asynchronously, and provides an endpoint to retrieve stored videos in a paginated format.
## Features
1. **YouTube API Integration**:
- Periodically fetches video data.
- Uses Etag headers to detect changes and updates the database in bulk.2. **Database Operations**:
- Supports asynchronous updates for efficiency.
- Provides paginated video retrieval.3. **Endpoints**:
- Set YouTube API key for fetching video data.
- Fetch paginated video data from the database.## Optimization
- **Etag Header**: Utilizes Etag headers from YouTube API responses to efficiently detect and update only modified video records.
- **Bulk Updates**: Ensures optimized database operations by performing updates in bulk for changed records.### Run the code
1. Get your youtube api from Google cloud console
2. Clone this repository
3. Change the environment variables in `.env` as per your need
4. Run this code
```bash
docker-compose up --build
```
5. Follow the examples given below to run the code### Examples
1. Add Api
```bash
curl -X Get -H "Content-Type: application/json" http://localhost:3000/api/set_api?key=
```

2. Search Videos
```bash
curl -X Get -H "Content-Type: application/json" http://localhost:3000/api/get_videos?page=1
```

3. Database
