API
Movie Search API
Search movies through the current TMDB-backed search endpoint
GET /api/movies/search is used by the Search page to fetch movies by title. It returns lightweight result rows for list rendering. Use /api/movies/:id for full movie details.
Endpoint
GET /api/movies/search?q=<query>
Auth
No authentication required.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search query text |
If q is missing, not a string, or empty after trimming, the endpoint returns 400.
Response Shape
{
"results": [
{
"id": 550,
"title": "Fight Club",
"original_title": "Fight Club",
"poster_path": "/path.jpg",
"release_date": "1999-10-15",
"vote_average": 8.4,
"genre_ids": [18]
}
]
}
Behavior
- Reads
qfrom the query string - Calls TMDB
search/moviethroughfetchTmdb(...) - Filters out rows with no poster, no release date, or
vote_average === 0 - Returns normalized lightweight movie rows for the client grid
Rate Limiting
This route uses the shared TMDB helper, so it inherits the current TMDB limit:
- 40 requests per 1-second fixed window
- shared server-side limiter key:
tmdb:global - response headers:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset
Error Codes
400invalid or missingq429TMDB rate limit exceeded500missing TMDB API key or upstream/internal failure502unexpected TMDB response format