python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
cd api
python3 manage.py migrate
python3 manage.py runserver
This project was created as part of the FamPay Backend assignment.
An API to fetch latest videos sorted in reverse chronological order of their publishing date-time from YouTube for a given tag/search query in a paginated response.
- Server calls the YouTube API continuously in background (async) with a interval of 5 minutes for fetching the latest videos for predefined search query "football". Then it stores the data of videos in a database with proper indexes.
- A GET API which returns the stored video data in a paginated response sorted in descending order of published datetime.
- Added support for supplying multiple API keys so that if quota is exhausted on one, it automatically uses the next available key.
- Optimized to store only unique videos in the database.
i. Get Videos
API to fetch latest videos sorted in reverse chronological order of their publishing date-time from YouTube for "youtube" query in a paginated response.
Endpoint : /videos
ii. Add Youtube API Key
API for adding a new Youtube Data API Key in the database.
Endpoint : /addYoutubeKey
-
Direct to /addYoutubeKey and add one youtube data api key. You can read here on how to get the api key.
-
Redirect to /videos to see the videos fetched by the server.
-
Wait 5 mins to get new videos if there are any.
- Python
- Django
- SQLite
Give a ⭐️ if you like the project!