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

ParameterTypeRequiredDescription
qstringYesSearch 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

  1. Reads q from the query string
  2. Calls TMDB search/movie through fetchTmdb(...)
  3. Filters out rows with no poster, no release date, or vote_average === 0
  4. 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

  • 400 invalid or missing q
  • 429 TMDB rate limit exceeded
  • 500 missing TMDB API key or upstream/internal failure
  • 502 unexpected TMDB response format
Copyright © 2026