openapi: 3.0.0
info:
  title: Letterboxd Search API
  description: Search Letterboxd films, reviews, lists, members, and cast or crew. Film results include numeric Letterboxd IDs, LIDs, titles, release years, and directors. Each page contains up to 20 results.
  version: 1.0.0
servers:
- url: https://www.searchapi.io/api/v1
paths:
  "/search":
    get:
      summary: Letterboxd Search
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      parameters:
      - name: engine
        in: query
        required: true
        description: Search engine set to `letterboxd_search`.
        schema:
          type: string
          enum:
          - letterboxd_search
      - name: q
        in: query
        required: false
        description: Search query. Required for a new search.
        schema:
          type: string
          minLength: 1
          maxLength: 500
      - name: type
        in: query
        required: false
        description: Type of result to return.
        schema:
          type: string
          enum:
          - films
          - reviews
          - lists
          - members
          - cast_crew
          default: films
      - name: safe
        in: query
        required: false
        description: Film searches only. Use `off` to include adult-themed titles.
        schema:
          type: string
          enum:
          - active
          - 'off'
          default: active
      - name: next_page_token
        in: query
        required: false
        description: The previous response's `pagination.next_page_token`. Send it alone or with the original `q`, `type`, and `safe`.
        schema:
          type: string
          maxLength: 4096
      - name: zero_retention
        in: query
        required: false
        description: Set to true to disable logging and persistent storage for this request. Enterprise plans only.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/SearchResponse"
        '400':
          description: Validation Error. There is an issue with query parameters, such as missing required parameters or invalid values.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '401':
          description: Authentication Error. The API key is missing or invalid.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '403':
          description: Forbidden. Zero data retention is not available to the account, or the account requires `zero_retention=true`.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '429':
          description: Rate Limit Exceeded. The number of allowed requests has been exceeded. Consider upgrading your plan or waiting for the limit to reset.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '500':
          description: Server Error. Internal server error.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '503':
          description: Timeout. We could not retrieve results in 90 seconds.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use Bearer authentication. Format: "Bearer YOUR_API_KEY"'
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Pass API key as query parameter
  schemas:
    SearchResponse:
      type: object
      properties:
        search_metadata:
          "$ref": "#/components/schemas/SearchMetadata"
        search_parameters:
          "$ref": "#/components/schemas/SearchParameters"
        films:
          type: array
          description: Film search results in Letterboxd order.
          items:
            "$ref": "#/components/schemas/Film"
        reviews:
          type: array
          description: Review search results in Letterboxd order.
          items:
            "$ref": "#/components/schemas/Review"
        lists:
          type: array
          description: List search results in Letterboxd order.
          items:
            "$ref": "#/components/schemas/List"
        members:
          type: array
          description: Member search results in Letterboxd order.
          items:
            "$ref": "#/components/schemas/Member"
        cast_crew:
          type: array
          description: Contributor search results in Letterboxd order.
          items:
            "$ref": "#/components/schemas/Contributor"
        pagination:
          "$ref": "#/components/schemas/Pagination"
        error:
          type: string
          description: Message describing an empty search result.
    SearchMetadata:
      type: object
      required:
      - status
      - created_at
      properties:
        id:
          type: string
          description: Unique identifier for the search request
        status:
          type: string
          description: Status of the search request
        created_at:
          type: string
          format: date-time
          description: Timestamp when the search was created
        request_time_taken:
          type: number
          description: Time taken to make the request in seconds
        parsing_time_taken:
          type: number
          description: Time taken to parse the results in seconds
        total_time_taken:
          type: number
          description: Total time taken for the search in seconds
        request_url:
          type: string
          description: Letterboxd search page for this query.
        html_url:
          type: string
          description: URL to view the raw results
        json_url:
          type: string
          description: URL to view JSON results
    SearchParameters:
      type: object
      required:
      - engine
      - q
      - type
      properties:
        engine:
          type: string
          description: Search engine selected.
          enum:
          - letterboxd_search
        q:
          type: string
          description: Effective search query.
        type:
          type: string
          description: Effective result type.
          enum:
          - films
          - reviews
          - lists
          - members
          - cast_crew
        safe:
          type: string
          description: Effective film filter.
          enum:
          - active
          - 'off'
        next_page_token:
          type: string
          description: Token used to fetch this page.
        zero_retention:
          type: boolean
          description: Whether zero data retention was requested.
    Film:
      type: object
      required:
      - position
      - film_id
      - slug
      - title
      - link
      - lid
      - short_link
      - has_poster
      - is_adult
      properties:
        position:
          type: integer
          description: Position in the result set, continuing across pages.
          minimum: 1
        film_id:
          type: integer
          description: Numeric Letterboxd film ID.
        slug:
          type: string
          description: Letterboxd film slug.
        title:
          type: string
          description: Display title.
        year:
          type: integer
          description: Release year.
        link:
          type: string
          description: Letterboxd film URL.
          format: uri
        lid:
          type: string
          description: Alphanumeric Letterboxd ID.
        short_link:
          type: string
          description: Shareable Letterboxd URL.
          format: uri
        original_title:
          type: string
          description: Original title of the film.
        alternative_titles_text:
          type: string
          description: Alternative titles as displayed by Letterboxd.
        directors:
          type: array
          description: Film directors.
          items:
            "$ref": "#/components/schemas/Director"
        has_poster:
          type: boolean
          description: Whether the film has a default poster.
        is_adult:
          type: boolean
          description: Whether Letterboxd marks the film as adult-themed.
    Director:
      type: object
      required:
      - name
      - slug
      - link
      properties:
        name:
          type: string
          description: Display name.
        slug:
          type: string
          description: Letterboxd URL slug.
        link:
          type: string
          description: Letterboxd page URL.
          format: uri
    Review:
      type: object
      required:
      - position
      - review_id
      - link
      - author
      - film
      properties:
        position:
          type: integer
          description: Position in the result set, continuing across pages.
          minimum: 1
        review_id:
          type: integer
          description: Numeric Letterboxd review ID.
        link:
          type: string
          description: Letterboxd review URL.
          format: uri
        rating:
          type: number
          description: Rating given by the reviewer.
          minimum: 0.5
          maximum: 5
          multipleOf: 0.5
        snippet:
          type: string
          description: Excerpt from the review.
        likes:
          type: integer
          description: Number of likes.
        author:
          "$ref": "#/components/schemas/Author"
        film:
          "$ref": "#/components/schemas/ReviewedFilm"
    ReviewedFilm:
      type: object
      required:
      - film_id
      - slug
      - title
      - link
      properties:
        film_id:
          type: integer
          description: Numeric Letterboxd film ID.
        slug:
          type: string
          description: Letterboxd film slug.
        title:
          type: string
          description: Display title.
        year:
          type: integer
          description: Release year.
        link:
          type: string
          description: Letterboxd film URL.
          format: uri
    Author:
      type: object
      required:
      - username
      - name
      - link
      properties:
        username:
          type: string
          description: Letterboxd username.
        name:
          type: string
          description: Display name.
        link:
          type: string
          description: Letterboxd profile URL.
          format: uri
    List:
      type: object
      required:
      - position
      - list_id
      - title
      - link
      - author
      - films_count
      properties:
        position:
          type: integer
          description: Position in the result set, continuing across pages.
          minimum: 1
        list_id:
          type: integer
          description: Numeric Letterboxd list ID.
        title:
          type: string
          description: Display title.
        link:
          type: string
          description: Letterboxd list URL.
          format: uri
        author:
          "$ref": "#/components/schemas/Author"
        films_count:
          type: integer
          description: Number of films in the list.
        likes:
          type: string
          description: Displayed like count.
        extracted_likes:
          type: integer
          description: Numeric value of the displayed like count.
        comments:
          type: string
          description: Displayed comment count.
        extracted_comments:
          type: integer
          description: Numeric value of the displayed comment count.
        films:
          type: array
          description: Letterboxd slugs of the preview films.
          items:
            type: string
    Member:
      type: object
      required:
      - position
      - username
      - name
      - link
      - is_pro
      - is_patron
      properties:
        position:
          type: integer
          description: Position in the result set, continuing across pages.
          minimum: 1
        username:
          type: string
          description: Letterboxd username.
        name:
          type: string
          description: Display name.
        link:
          type: string
          description: Letterboxd profile URL.
          format: uri
        thumbnail:
          type: string
          description: Profile avatar URL.
          format: uri
        is_pro:
          type: boolean
          description: Whether the profile displays the Pro badge.
        is_patron:
          type: boolean
          description: Whether the profile displays the Patron badge.
    Contributor:
      type: object
      required:
      - position
      - name
      - slug
      - link
      - role
      properties:
        position:
          type: integer
          description: Position in the result set, continuing across pages.
          minimum: 1
        name:
          type: string
          description: Display name.
        slug:
          type: string
          description: Letterboxd URL slug.
        link:
          type: string
          description: Letterboxd page URL.
          format: uri
        role:
          type: string
          description: Letterboxd contributor role.
        films_count:
          type: integer
          description: Number of credited films shown in the result.
        known_for:
          type: array
          description: Letterboxd slugs of selected films.
          items:
            type: string
        also_known_as_text:
          type: string
          description: Other contributor names as displayed by Letterboxd.
    Pagination:
      type: object
      required:
      - next_page_token
      properties:
        next_page_token:
          type: string
          description: Token to retrieve the next page.
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
