This PHP library enables you to scrape data from IMDB.com., (*1)
This script is a proof of concept. It’s working, but you shouldn’t use it. IMDb doesn’t allow this method of data fetching. I do not use or promote this script. You’re responsible for using it., (*2)
The technique used is called “web scraping.”
Which means, if IMDb changes any of their HTML, the script is going to fail. I won’t update this on a regular basis, so don’t count on it to be working all the time., (*3)
License
The MIT License (MIT), (*4)
Example Usage
<?php
include_once 'imdb.class.php';
$IMDB = new IMDB('Movie Title or IMDB URL');
if ($IMDB->isReady) {
print_r($IMDB->getAll());
} else {
echo 'Movie not found. 😞';
}
Available Methods
Get all available data, (*5)
getAll(), (*6)
Also Known As, (*7)
getAka(), (*8)
All local names, (*9)
getAkas(), (*10)
Aspect Ratio, (*11)
getAspectRatio(), (*12)
Awards, (*13)
getAwards(), (*14)
Budget, (*15)
getBudget(), (*16)
Cast, (*17)
getCast($iLimit = 0, $bMore = true) - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed, (*18)
Cast Images, (*19)
getCastImages($iLimit = 0, $bMore = true, $sSize = 'small', $bDownload = false) - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed, $sSize defines the size of the cast image "small, mid and big", $bDownload if the cast image should be downloaded or not, (*20)
Cast (with links), (*21)
getCastAsUrl($iLimit = 0, $bMore = true, $sTarget = '') - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed, $sTarget defines a target, (*22)
Cast and Character, (*23)
getCastAndCharacter($iLimit = 0, $bMore = true) - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed, (*24)
Cast and Character (with links), (*25)
getCastAndCharacterAsUrl($iLimit = 0, $bMore = true, $sTarget = '') - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed, $sTarget defines a target, (*26)
Certification, (*27)
getCertification(), (*28)
Color, (*29)
getColor(), (*30)
Company, (*31)
getCompany(), (*32)
Company (with links), (*33)
getCompanyAsUrl($sTarget = '') - $sTarget defines a target, (*34)
Country, (*35)
getCountry(), (*36)
Country (with links), (*37)
getCountryAsUrl($sTarget = '') - $sTarget defines a target, (*38)
Creator, (*39)
getCreator(), (*40)
Creator (with links), (*41)
getCreatorAsUrl($sTarget = '') - $sTarget defines a target, (*42)
Description, (*43)
getDescription(), (*44)
Director, (*45)
getDirector(), (*46)
Director (with links), (*47)
getDirectorAsUrl($sTarget = '') - $sTarget defines a target, (*48)
Distributor, (*49)
getDistributor($iLimit = 0, $bMore = true) - $iLimit defines the maximum amount of distributors returned, $bMore if "…" should be added to the string if needed, (*50)
Distributor (with links), (*51)
getDistributorAsUrl($sTarget = '') - $sTarget defines a target, (*52)
Episode, (*53)
getEpisodeTitle() - returns the episode title of the tv show, (*54)
Genre, (*55)
getGenre(), (*56)
Genre (with links), (*57)
getGenreAsUrl($sTarget = '') - $sTarget defines a target, (*58)
Gross, (*59)
getGross() to get cumulative worldwide gross, (*60)
Language, (*61)
getLanguage(), (*62)
Language (with links), (*63)
getLanguageAsUrl($sTarget = '') - $sTarget defines a target, (*64)
Location, (*65)
getLocation(), (*66)
Location (with links), (*67)
getLocationAsUrl($sTarget = '') - $sTarget defines a target, (*68)
MPAA, (*69)
getMpaa(), (*70)
Metacritics, (*71)
getMetaCritics() - returns all critic reviews, (*72)
Metascore, (*73)
getMetaScore() - returns the average score and number of votes based on metacritic., (*74)
Music Composer, (*75)
getMusic(), (*76)
Music Composer (with links), (*77)
getMusicAsUrl($sTarget = '') - $sTarget defines a target, (*78)
Plot, (*79)
getPlot($iLimit = 0) - $iLimit defines the maximum characters returned, (*80)
Plot Keywords, (*81)
getPlotKeywords(), (*82)
Poster, (*83)
getPoster($sSize = 'small', $bDownload = true) - $sSize defines small or big poster size, $bDownload if the poster should be downloaded or not, (*84)
Rating, (*85)
getRating(), (*86)
Release Date, (*87)
getReleaseDate(), (*88)
Release Dates, (*89)
getReleaseDates() returning all release dates for each country, (*90)
Runtime, (*91)
getRuntime(), (*92)
Seasons, (*93)
getSeasons(), (*94)
Seasons (with links), (*95)
getSeasonsAsUrl($sTarget = '') - $sTarget defines a target, (*96)
Sound Mix, (*97)
getSoundMix(), (*98)
Tagline, (*99)
getTagline(), (*100)
Title, (*101)
getTitle($bForceLocal = false) - $bForceLocal tries to return the original name of the movie, (*102)
Trailer, (*103)
getTrailerAsUrl($bEmbed = false) - $bEmbed defines if you want to link to player directly or not., (*104)
TVInfo, (*105)
getTVInfo() - returns an array of all season/episodes of a tv show (includes plot/rating/votes/airdate)., (*106)
Type, (*107)
getType() - returns the type of the title (movie, tv episode, tv series), (*108)
Url, (*109)
getUrl(), (*110)
User Review, (*111)
getUserReview(), (*112)
Votes, (*113)
getVotes(), (*114)
Writer, (*115)
getWriter(), (*116)
Writer (with links), (*117)
getWriterAsUrl($sTarget = '') - $sTarget defines a target, (*118)
Year, (*119)
getYear(), (*120)
Bugs?
If you run into any malfunctions, feel free to submit an issue. Make sure to enable debugging: const IMDB_DEBUG = true; in imdb.class.php., (*121)