Make 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.
- Django
- DB - sqlite3 (inbuilt)
-
GET API which returns the stored video data in a paginated response sorted in descending order of published datetime
Access this endpoint by typing http://127.0.0.1:8000/get/?page=1
Demo Output
-
A basic Search API to search the stored videos using their title and description (Optimised)
Access this endpoint by typing http://127.0.0.1:8000/search/?query=india&page=1
If you want to try different search queries then replace it with india. For more than 1 word concatenate them with '%20'.
Eg. Search Query = New Zealand then the endpoint will look like this http://127.0.0.1:8000/search/?query=new%20zealand&page=1 Demo Output
Note: The default search query is for music. You can change it by going inside Worker folder and opening fetch_youtube_metadata.py file and change it on line 14.
Note: Before moving forward please get your own API KEY from here. You can place this API KEY by going inside Worker folder and opening fetch_youtube_metadata.py file and change place it on line 15. Remember to place it inside quotes.
git clone https://github.com/Manthan109/youtube_api.git
cd youtube_api
sudo docker build -t fampay .
sudo docker run -d -p 8000:8000 fampay
- And you are good to go! You can type in the endpoints and look at the results