Giter Club home page Giter Club logo

imdb-php-api's Introduction

IMDb PHP API

How To Use

Create an instance

// IMDb ( [bool $anonymise = false [, bool $summary = true [, int $titlesLimit = 0]]] )
$imdb = new IMDb(true, true, 0);	// anonymise requests to prevent IP address getting banned, summarise returned data, unlimited films returned

Search for a movie by title

// Returns an array containing objects of matching titles
$movies = $imdb->find_by_title("The Godfather"); 

// $movies[0]->title => "The Godfather"
// $movies[0]->year => "1972"
// $movies[0]->tconst => "tt0068646"
// ... 
// $movies[1]->title => "The Godfather: Part II"
// ...

Get a movie by its imdb_id

// Returns an object containing the movie's data
$movie = $imdb->find_by_id("tt0068646");

// $movie->title => "The Godfather"
// $movie->rating => "8.1"
// $movie->year => "1972"

Search for a person by name

// Returns an array containing objects of matching names
$people = $imdb->person_by_name("Christian Bale"); 

// $people[0]->name => "Christian Bale"
// $people[0]->nconst => "nm0000288"
// ... 

Get a person by their imdb_id

// Returns an object containing the person's data
$person = $imdb->person_by_id("nm0000288");

// $person->name => "Christian Bale"
// $person->birthday_datestamp => "1974-01-30"
// $person->birthplace => "Haverfordwest, Pembrokeshire, Wales, UK"

Charts

// Returns an array containing objects of of the top 250 films
$movies = $imdb->chart_top();
// Or for the Bottom 100...
$movies = $imdb->chart_bottom();

// $movies[0]->title => "The Shawshank Redemption"
// $movies[0]->year => "1994"
// $movies[0]->tconst => "tt0111161"
// ... 
// $movies[1]->title => "The Godfather"
// ...

// Similarly, the following function will return the Box Office (US) respectively.
// Note that the format of the data returned differs slightly from the above 2 charts
$movies = $imdb->boxoffice();

imdb-php-api's People

Contributors

chrisjp avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.