Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Pragyat-Nikunj/VidTube/llms.txt

Use this file to discover all available pages before exploring further.

Every VidTube API endpoint is reachable under a single base URL, and every request follows the same content-type rules. JSON bodies power most operations; multipart uploads handle media. Endpoints that return lists support consistent pagination and sorting query parameters, so you can page through results and control ordering with the same pattern across resources.
The live demo API is hosted on Render’s free tier at https://vidtube-ke5w.onrender.com. The instance may spin down after inactivity and take up to 30 seconds to cold-start on the first request.

Base URL

https://vidtube-ke5w.onrender.com/api/v1
Every endpoint path in this documentation is relative to this URL. All routes are prefixed with /api/v1 — you never need to add a version segment yourself.

Content types

JSON requests

For all non-file requests, set Content-Type: application/json and send a JSON body. The server enforces a 16 kb body size limit.
curl -X POST https://vidtube-ke5w.onrender.com/api/v1/users/login \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "username": "johndoe", "password": "secret"}'

File uploads

Endpoints that accept binary files — video, thumbnail, avatar, or cover image — require Content-Type: multipart/form-data. The field names expected by each endpoint are documented in the respective resource reference.
curl -X POST https://vidtube-ke5w.onrender.com/api/v1/videos/publishVideo \
  -H "Authorization: Bearer <token>" \
  -F "title=My First Video" \
  -F "description=A short demo" \
  -F "video=@/path/to/video.mp4" \
  -F "thumbnail=@/path/to/thumb.jpg"
When using a client library, set the form fields using the library’s multipart API rather than manually constructing a boundary — this prevents encoding errors with binary data.

Pagination

Endpoints that return lists (such as GET /videos/getAllVideos and GET /comments/videoComments/:videoId) support standard page-based pagination via query parameters.
ParameterTypeDefaultDescription
pageinteger11-indexed page number to retrieve.
limitinteger10Number of items per page. Maximum is 100 for video listings.
The response data object includes metadata alongside the items:
  • totalPages — total number of pages given the current limit.
  • totalVideos — total number of matching records (on video endpoints).

Sorting

The GET /videos/getAllVideos endpoint supports sorting via two additional parameters:
ParameterOptionsDefaultDescription
sortBycreatedAt, views, likescreatedAtField to sort results by.
sortTypeasc, descdescSort direction.

Filtering

You can narrow video listings with these filter parameters on GET /videos/getAllVideos:
ParameterDescription
querySearches video title and description using a case-insensitive regex.
userIdRestricts results to videos uploaded by a specific user (owner ID).

Paginated request example

GET /api/v1/videos/getAllVideos?page=2&limit=20&sortBy=views&sortType=desc&query=tutorial
This request fetches the second page of 20 videos, sorted by view count (highest first), where the title or description contains “tutorial”.

Paginated response example

{
  "statusCode": 200,
  "data": {
    "videos": [...],
    "totalVideos": 150,
    "totalPages": 8
  },
  "message": "Video fetched successfully.",
  "success": true
}

Build docs developers (and LLMs) love