Skip to main content

🚀 API Reference

The core of this project is a serverless API endpoint that allows you to get a view count prediction based on video metadata.

Predict Endpoint

  • HTTP Method: POST
  • Endpoint URL: https://3bd5z76vu0.execute-api.us-east-1.amazonaws.com/v1/predict
  • Description: Sends video feature data to the model and returns a predicted view count.

Request Body (JSON)

The POST request must include a JSON body with the following structure and data types.

ParameterTypeDescriptionExample
like_countintegerThe total number of likes on the video.5000
comment_countintegerThe total number of comments on the video.200
duration_secondsintegerThe length of the video in seconds.300
tag_countintegerThe number of tags associated with the video.15
category_idintegerThe numerical ID for the YouTube category (e.g., 24 is Entertainment).24
publish_hourintegerThe hour of the day the video was published (0-23).14
publish_day_of_weekintegerThe day of the week (0=Monday, 6=Sunday).3
channel_titlestringThe name of the YouTube channel."Some Channel"

Example Request Body

{
"like_count": 5000,
"comment_count": 200,
"duration_seconds": 300,
"tag_count": 15,
"category_id": 24,
"publish_hour": 14,
"publish_day_of_week": 3,
"channel_title": "Some Channel"
}

Responses

Successful Response (200 OK)

If the request is successful, the API will return a JSON object with the predicted view count.

{
"predicted_views": 1234567.89
}

Error Response (400 Bad Request)

If the input data is missing or invalid, the API may return an error.

{
"error": "Invalid input provided. Please check your JSON payload."
}