- Clone the repository:
git clone https://github.com/jhitesh/youtube_api_experiment.git - Install the dependencies:
go mod download - Set up the PostgreSQL Database and fill details in
database_credentials.yamlfile - Create the relevent table in the database using following command:
CREATE TABLE videos (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
description TEXT NOT NULL,
published_at timestamp NOT NULL
);
CREATE INDEX videos_title_description_index ON videos (title, description);
- Enter the number of videos that you want to get per page from the APIs in file
app_constants.yaml - Provide API Key and the
queryfor YouTube API in filequery_params_values.yaml - Enter the time interval values to fetch data from YouTube in file
youtube_fetch_worker_values.yaml - Start the server
go run main/main.go
All the details about the API Endpoints and the system can be found here