Search code examples
rubyapihttpnetflix

Accessing entire netflix catalog via API v1.5


Netflix recently updated their API methods for obtaining the full Netflix catalog. I'm curious if anyone has had any success accessing these new xml documents and downloading them via API v1.5 (9/2012). Previously, you could download the entire Netflix catalog via one API call (which I had working perfectly). Now, there are supposedly two calls to make: one for dvd's and one for streaming movies.

I cannot make these calls return anything except for an empty array. Please don't offer an answer unless you have personally downloaded the entire catalog via these new API's.

Bonus points if you can tell me how to do it in Ruby.

http://developer.netflix.com/blog/read/Update_Changes_for_the_Public_API


Solution

  • This did it for me (download the netflix instant cat)...it's in php but can prob be easily rewritten in ruby..this is using JR Collings OAuthsimple

    args = Array(
        max_results=> 20,
        start_index=>0
    
    );
    //args don't matter, netflix doesn't listen here
    // this is the URL path (note the lack of arguments.)
    $rpath = "http://api-public.netflix.com/catalog/titles/streaming";
    
    // Create the Signature object.
    $roauth = new OAuthSimple();
    $rsigned = $roauth->sign(Array(path=>$rpath,
                    parameters=>$args,
                    signatures=> Array('consumer_key'=>YOURKEY,
                                        'shared_secret'=>YOURSECRET,
    
                                        )));
    
    
    
    $getxml = file_get_contents($rsigned['signed_url']);
    file_put_contents("streaming.xml", $getxml);