Netflix API 1.0
by Aziz S. Hussain
azizsaleh@gmail.com
http://azizsaleh.com

Usage Requirements:

  1. PHP 5.3 or higher
  2. CURL Enabled
  3. hash_hmac Enabled with sha1 support
  4. json_decode Enabled
    Note: Having the last three enabled might work even for PHP versions under 5.3 (no guarantees)

Usage Examples:

  1. The following piece of code must be included before usage:

    define ('BASE_DIR', dirname(__FILE__) .'/');
    require_once ( BASE_DIR . 'Configuration.php');
    require_once ( BASE_DIR . 'includes/NetflixAPI.php');
    require_once ( BASE_DIR . 'includes/Request.php');
    require_once ( BASE_DIR . 'includes/OAuthSimple.php');

    require_once ( BASE_DIR . 'netflix/nonAuthenticatedCall.php');
    require_once ( BASE_DIR . 'netflix/protectedCall.php');
    require_once ( BASE_DIR . 'netflix/signedCall.php');
    require_once ( BASE_DIR . 'netflix/getToken.php');

  2. To make a call, do:

    $Netflix = new NetflixAPI();
    $results = $Netflix->getCatalogTitlesAutoComplete('Fun');
    // $results is now an array containing the results
      

Available Call List [For more detailed information regarding these calls click on this link]:

  1. Catalog Titles Autocomplete - Conducts a search of the catalog for titles of movies and television series by season. Currently, it is not possible to search for television shows by series.

    @param string term

    @return array

    public function getCatalogTitlesAutoComplete ($term)

  2. Catalog Titles - Searches the catalog for movies and television series whose title matches a partial search text. Returned title names can then be passed to the title search methods to conduct the actual search. The autocomplete method only applies to titles.

    @param string term
    @param int start_index = 0
    @param int max_result = 25

    @return array

    public function getCatalogTitles ($term, $start_index = 0, $max_result = 25)
  3. Catalog Titles Index - Returns an index of all titles in the catalog. The titles index is intended for partners with their own movie or TV catalogs who want to find corresponding titles in the Netflix catalog. The index data returned by the method includes titles, release dates (year of release), production studio name, and top cast members. You can use this data to interlink titles. In addition, the returned data includes Netflix title URLs, media formats, and availability windows. Each title entry in the returned data includes an update date, which indicates the last time the title data was updated.

    @param string include_amg = null
    @param string include_tms = null

    @return array

    public function getCatalogTitlesIndex ($include_amg = '', $include_tms = '')

  4. Get Title Details - Use these movie and television series season API, described in this section, to retrieve details for specific catalog titles. The API consists of a set of subresources within one resource URL type, catalog/titles, that returns all details for the requested title.

    Note: For each title, you can find the URLs to retrieve the title's details in the responses from other resource queries (e.g., search results, queue responses, and so forth) that reference titles. The links within those responses contain the URLs for retrieving a title's details.  You should never attempt to construct a title URL directly.

    @param string movie_id
    @param string type = movies (movies, series, programs, or discs)
    @param int season_id = null

    @return array

    public function getTitleDetails ($movie_id, $type = 'movies', $season_id = NULL)

  5. Titles Similars - This resources returns a list of titles similar to the parent title resource.  The similars resource URL can be found in the response of any title resource and will have a URL like the following :catalog/titles/12345678/similars.

    @param string title_id
    @param int start_index = 0
    @param int max_result = 25

    @return array

    public function getTitlesSimilars ($title_id, $start_index = 0, $max_result = 25)

  6. Searching for People - This section covers the resources used to retrieve details about cast members and others in the Catalog.

    @param string term
    @param int start_index = 0
    @param int max_result = 25

    @return array

    public function getSearchForPeople ($term, $start_index = 0, $max_result = 25)

  7. Person Details - You can retrieve detailed information for a person in the Catalog, using that person's ID, including a bio, featured titles, and a complete list of titles.

    @param string person_id

    @return array

    public function getPersonDetails ($person_id)


  8. Users - Returns information about the specified user.

    @return array

    public function getUsersInfo ()

  9. Current User (reflection) - This resource returns a link to the currently authenticated user. You can access the active user's associated API resource without extracing the user ID from the OAuth access token response.

    @return array

    public function getCurrentUser ()


  10. Get Current User Item List - This resource will return a list of user's specific URLS for any of the following:queues, rental_history, recommendations, title_states, ratings, reviews, at_home, feeds.

    @param string list_Type

    @return array

    public function getUserSpecificList ($list_Type)


  11. Feeds - This function will return the feed info based on a feed URL and feed token (returned by the above function getUserSpecificList(). Feed url is either "recommendations", "ratings/title/actual", "reviews", "at_home", "rental_history/returned", "rental_history/watched", "rental_history/shipped", "rental_history", "queues/instant", or "queues/disc".

    @param string feed_url
    @param string feed_token
    @param string sort

    @return array

    public function getFeeds ($feed_url, $feed_token, $sort = 'date_added')


  12. Title States - Use this resource to help determine a subscriber's rental options. Each user response contains a link to a to the user's title states.

    @param array title_refs

    @return array

    public function getTitleStates ($title_refs)

  13. Managing Queues - Use the queue management API to retrieve and manipulate the contents of a user's queue.

    @param timestamp updated_min

    @param string search_type [disc, instant]
    @param string sort = alphabetical [queue_sequence, date_added, alphabetical]
    @param string search_method [available, saved]
    @param int entry_id = null
    @param int start_index
    @param int max_results

    @return array

    public function getQueues ($updated_min, $search_type = 'disc', $sort = 'alphabetical', $search_method = NULL,
    $entry_id = NULL,$start_index = 0, $max_results = 25)


  14. Updating a Queue - You use a subset of the queue management API resources to add titles to a queue, change the queue order, or remove titles from a queue.

    @param string title_ref
    @param string format [DVD, Blue-ray]
    @param int position
    @param string etag

    @param string search_type [disc, instant]
    @param string search_method [available, saved]
    @param int entry_id = null

    @return array

    public function updatingAQueue ($title_ref, $format, $position, $etag, $search_type = 'disc',
    $search_method = NULL, $entry_id = NULL, )


  15. Tracking Discs - This API keeps track of discs that have been sent to a subscriber's home and not yet received back to the Netflix distribution center.

    @param timestamp updated_min
    @param int start_index = 0
    @param int max_results = 25

    @return array

    public function getTrackingDiscs ($updated_min, $start_index = 0, $max_results = 25)

  16. Managing Rental History - Use the rental_history resource and its subresources to retrieve a user's rental history. You can retrieve information about titles (discs) shipped to the user for viewing at home, discs returned to Netflix, or titles the user has watched instantly.

    @param timestamp updated_min

    @param string history_type = NULL [shipped, returned, watched]
    @param int start_index = 0
    @param int max_results = 25

    @return array

    public function managingRentalHistory ($updated_min, $history_type = NULL, $start_index = 0, $max_results = 25)

  17. Get User Title Ratings - You use the user title rating resources to retrieve a subscriber's rating for an individual movie or television series season. You can retrieve the user's actual rating and predicted rating for the title. You also use these resources to create new ratings for a user.

    @param string title_refs
    @param string rating_type = NULL [actual, predicted]
    @param int rating_id = NULL

    @return array

    public function getUserRatings ($rating_type, $title_refs, $rating_id = NULL)

  18. Create User Title Rating - Use this resource to create a new rating for a subscriber or to access subscriber ratings.

    @param string title_ref
    @param string rating [1,2,3,4,5,not_interested,no_opinion]

    @return array


    public function createUserRating ($title_ref, $rating)

  19. Update User Title Rating - Use this resource to update an existing rating for a subscriber or to access a specific subscriber rating.

    @param int rating_id
    @param string rating [1,2,3,4,5,not_interested,no_opinion]

    @return array

    public function updateUserRating ($rating_id, $rating)

  20. Retrieving Reviews - This resource returns a subscriber's reviews and related title URLs.

    @param int title_refs
    @param timestamp updated_min
    @param int start_index
    @param int max_results

    @return array

    public function retrieveReviews ($title_refs, $updated_min, $start_index = 0, $max_results = 25)

  21. Retrieving Recommendations - You use the recommendations resource to see suggested catalog title recommendations for that user. These are recommendations that Netflix makes based on a user's viewing history.

    @param int start_index = 0
    @param int max_results = 25

    @return array

    public function retrieveRecommendations ($start_index = 0, $max_results = 25)