- Problem Statement
- Steps to run
- API endpoints
- 1. /api (API status & Search Query info)
- 2. /api/videos (Get Videos in reverse chronological order)
- 3. /api/videos/s (Search videos)
To 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.
NOTE: Multiple API keys can be used by concatinating them using |
in between each like KEY1|KEY2|KEY3
.
Use docker-compose
to test the app locally. Make sure to make relevant changes to the environment variables in docker-compose.yml
file. Use the following command to build and start the app:
docker-compose up --build
The package.json
file contains dependencies needed to run the project.
npm install
The package.json
file contains script start
for running locally, run it using.
npm start
URL: /api
Request type: GET
URL: /api/videos:page?
Example: /api/videos?page=2
Request type: GET
Optional data parameters: page (default: 1)
NOTE: The page
parameter is optional and defaults to page 1.
URL: /api/videos/s:q?:page?
Example: /api/videos/s?q=cricket?page=2
Request type: GET
Data parameters: searchString (q)
Optional data parameters: page (default: 1)
NOTE: The q
parameter if having multiple words then seperate it by -
(example: "hello world" -> q=hello-world
).