Quick Start

  • All of the following examples assume that netflix.sh is in the system path and has been aliased to 'netflix' for simplicity.

    Before anything else happens, we're assuming you've read the Netflix API documentation, you know what the Netflix API can do for you, that you've signed up as a Netflix API developer and have been issued a consumer key and secret, and have installed and set up the client as per the setup page. If that's the case, let's get started!

    The first thing you have to do is log in. The nfcli does this by getting an OAuth token from Netflix and stashing it in the tokens directory. It will also echo back the token text to the console, in case you're performing any shell trickery. You log in by passing the email address of your Netflix account to the login method. The client will prompt you to enter your Netflix password (don't worry, it won't be echoed to the shell). Alternatively, you can specify the password with the -p param, but in this case it will be echoed on the command line:

    > netflix login -e foo@bar.com
    > Enter password for user foo@bar.com: 
    oauth_token=T1myE.IzHG.Pr76SdmPkdXnXK1Ae9ojG1pr1rgTqEZZePVNLfFLJtvEbzOAm_VCqy4--
    &user_id=T1lVtFibroPtZ4w8botFhruzqo-&oauth_token_secret=WqerzSEwDvAU

    Pretty much every call you make to Netflix is on behalf of your customer account (or someone's, anyway) and so every such call requires that you let the client know which account you want used when making the call. You can specify this by using the -e param for every call, but this can get tedious fast. So, you'll want to use the setdefault method to make a given user account the default:

    > netflix setdefault -e foo@bar.com

    The client will echo back the access token, indicating that the account was successfully set as the default. Now you won't have to use the -e param for any other calls (though of course you can anyway).

    Now that the preliminaries are out of the way, let's get to the good stuff. Let's take a look at your queue:

    > netflix view -q disc
    Paul Gilbert: Get Out of My Yard        http://api.netflix.com/users/T1RfqniVYAbzC31Pk4-/queues/disc/available/11/70072488      
            http://api.netflix.com/catalog/titles/movies/70072488
    The Warriors    http://api.netflix.com/users/T1RfqniVYAbzC31Pk4-/queues/disc/available/13/60004087   
            http://api.netflix.com/catalog/titles/movies/60004087

    Here, we're looking at a user's disc queue. We could have specified -q instant to see their instant queue, or we could have left of the -q parameter entirely, as it defaults to disc, but you get the idea. Three tab-delimited columns per result are returned. This first is obviously the title. The second is the title's queue ID, the ID that corresponds to that title and its position in your queue. This is the ID you act upon to move or delete the title from your queue. The third column is the title's catalog ID. This is what you'd use to get catalog title details, like cast information, or release year... that sort of thing.

    For more in-depth usage information, see the usage page.