Skip to main content
The Platzi Viewer server exposes a REST API for managing courses, progress, and streaming Drive content.

Base URL

http://localhost:8080
The server runs on localhost:8080 by default. Configure with PORT and HOST environment variables.

Endpoint Categories

Course Data

Courses

Get complete course catalog with all details

Bootstrap

Get lightweight course summaries for fast initial load

Course Detail

Get detailed information for a specific course

Cache Meta

Get cache metadata and statistics

Progress Tracking

Get Progress

Retrieve saved user progress

Save Progress

Persist user progress data

File Streaming

Drive Proxy

Stream files from Google Drive with range request support

Compatible Video

Stream browser-compatible video using ffmpeg transcoding

System

MethodEndpointDescription
GET/api/healthHealth check with Drive and ffmpeg status
GET/api/refreshReload courses cache (localhost only)
GET/api/self-check-driveValidate cache contains only Drive IDs
POST/api/open-externalOpen video in external player (VLC)

Complete Endpoint List

Course Endpoints

GET  /api/courses                              # Full course catalog
GET  /api/bootstrap                            # Course summaries only
GET  /api/cache-meta                           # Cache metadata
GET  /api/course-detail/{cat}/{route}/{course} # Specific course

Progress Endpoints

GET  /api/progress    # Load progress
POST /api/progress    # Save progress

File Streaming Endpoints

GET  /drive/files/{fileId}              # Stream file from Drive
GET  /api/video-compatible/{fileId}     # Transcode video for compatibility

System Endpoints

GET  /api/health            # Health check
GET  /api/refresh           # Reload cache
GET  /api/self-check-drive  # Validate Drive IDs
POST /api/open-external     # Open in VLC

Authentication

All endpoints are unauthenticated and intended for localhost-only use. Some endpoints like /api/refresh are restricted to loopback addresses.

CORS Policy

The server implements strict CORS policies:
  • Only accepts requests from loopback origins (localhost, 127.0.0.1, ::1)
  • Supports GET, POST, and OPTIONS methods
  • Returns appropriate Access-Control-Allow-Origin headers for valid origins

Response Format

All API endpoints return JSON with UTF-8 encoding:
{
  "Content-Type": "application/json; charset=utf-8"
}
Responses are gzip-compressed when:
  • Client sends Accept-Encoding: gzip
  • Response payload is ≥1KB

Error Responses

Standard HTTP status codes are used:
CodeMeaning
200Success
206Partial content (range requests)
400Bad request (invalid parameters)
403Forbidden (non-localhost access)
404Resource not found
413Payload too large
416Range not satisfiable
502Bad gateway (Drive/ffmpeg errors)
503Service unavailable (Drive/ffmpeg not configured)

Rate Limiting

No rate limiting is enforced. The server is designed for local single-user access.

Next Steps

Course APIs

Learn about course data endpoints

Progress APIs

Track and save user progress

Drive Proxy

Stream files from Google Drive

Build docs developers (and LLMs) love