Skip to content

TitleSearch

duck7000 edited this page Mar 15, 2026 · 11 revisions

Description of the working

You can use this class to search on imdb GraphQL API
Search on specific titleTypes is also supported like MOVIE or TV
Search on exact match is supported through a parameter
Results are sorted on exact match first
$types default: null (search within all supported titleTypes
Only $searchTerm is mandatory, the rest of the parameters are optional

Calling the class

$imdb = new \Imdb\TitleSearch();
$results = $imdb->search("$searchTerm", "MOVIE,TV", "1955-01-01", "2000-01-01", true);

Config Option:

  • $titleSearchAmount: 10 (this limits the search results, default: 10)

Search parameters

  • $searchTerm: input search string including double quotes
  • $types: input wanted titleTypes like MOVIE or MOVIE,TV (separate by comma)
    $types default: null (search within all supported titleTypes)
    $types values:
  MOVIE
  MUSIC_VIDEO
  PODCAST_EPISODE
  PODCAST_SERIES
  TV
  TV_EPISODE
  VIDEO_GAME
  • ReleaseDate: Search on specific start and/or end date. Dates must be in iso form like this: '1950-01-01' (year-month-day)
         $startDate: if provided search start at this date until present date (1950 - present date)
         $endDate: if provided search start at this date and earlier (1955 - older)
         If both $startDate and $endDate are provided search will be limited within this date period
         If no $startDate or $endDate is provided search within all dates is used<br>
  • $exactMatch: boolean true:only return results if exactly match searchTerm, default: false

Results

@return Title[] array of Titles
array[]

      ['imdbid']             string      imdbid from the found title
      ['originalTitle']      string      originalTitle from the found title
      ['title']              string      title from the found title
      ['year']               string      year or year span from the found title
      ['movietype']          string      titleType from the found title
      ['imgUrl']             string      image url from the found title
      ['titleSearchObject']  object      This returns a Title object with search results included

Clone this wiki locally