Usage Reference

Basic Invocation

The client is invoked by calling the appropriate script netflix.sh>> or <<<netflix.bat, specifying a method and any necessary call parameters. (If you're using a *nix system, we suggest aliasing netflix.sh to 'netflix' or 'nfc' or something else convenient). You can also get basic usage information by sending the -h flag:

> netflix -h
usage: netflix [search, add, delete, detail, view, login, revoke,
               setdefault, lolomo, athome, history, init] <args>
 -h,--help      Show usage information and quit.  Use netflix [method] -h
                for more specific help.
 -t,--test      Runs in test environment, defaults to false.
 -v,--verbose   Show all process output 

Method Reference

search

Searches the catalog of titles for the given term.
The -s parameter's argument should be quoted if it contains whitespace.
This method returns two columns, the title and the catalogID.

usage: netflix search -s <search term>
 -s,--searchterm <term>   Title term to search the catalog for.

Example:

> netflix search -s "Pee Wee's Big Adventure"
Pee-Wee's Big Adventure http://api.netflix.com/catalog/titles/movies/848396
Big Top Pee-Wee http://api.netflix.com/catalog/titles/movies/70000266
...

add

Adds the specified title_ref to the user's queue.
Returns an XML response containing success/failure message, queue
position, title refs, and the like.

usage: netflix add -i <item> -q <target queue>
 -e,--email <address>      Email address of user
 -i,--item <href>          href of item to add to queue
 -q,--queue <queue name>   Specific queue to add item to (disc or instant)

Example:

> netflix add -i http://api.netflix.com/catalog/titles/movies/848396 -q instant
<status>
  <etag>174984626602</etag>
  <message>success</message>
  <status_code>201</status_code>
  <resources_created>
    <queue_item>
      <id>http://api.netflix.com/users/foo-/queues/instant/available/73/848396</id>
      <position>73</position>
      <link href="http://api.netflix.com/users/foo-/queues/instant/available" 
                rel="http://schemas.netflix.com/queues.available" title="available queue"></link>
      <category scheme="http://api.netflix.com/categories/queue_availability" 
                label="available now" term="available now">Available Now</category>
      <updated>1255210400</updated>
      <category scheme="http://api.netflix.com/categories/title_formats" 
                label="Instant" term="Instant"></category>
      <link href="http://api.netflix.com/catalog/titles/movies/848396" 
        rel="http://schemas.netflix.com/catalog/title" 
        title="Pee-Wee's Big Adventure"></link>
    </queue_item>
  </resources_created>
</status>

delete

Removes the specified item from the user's queue.
Returns an XML response containing success/failure message.

usage: netflix delete -i <item>
 -e,--email <address>   Email address of user
 -i,--item <href>       href of item to delete from queue

Example:

> netflix delete -i http://api.netflix.com/users/786r3-/queues/instant/available/73/848396
<?xml version="1.0" standalone="yes"?>
<status>
  <status_code>200</status_code>
  <message>Title deleted from queue</message>
</status>

detail

Shows a variety of title detail.
The detail method is quite extensive. In its simplest form, it returns and XML representation of the given title's catalog data; however, since this was designed for machines to read, this is not very useful for most humans. Therefore detail offers a clean mode, which strips away the markup.
Additionally, the -f flag puts timestamps and other numbers in a human-friendly format (i.e., '1 hour, 37 minutes' instead of '5820').
Specifiying -x followed by a comma-separated list of expansion elements will result in only those elements being returned, e.g.:
-x "@title, @runtime"
...will return only the title and runtime.
By default, all items are expanded except for the similars list, which is typically quite large. The allowed expansions are:
"@title", "@web page", "@runtime", "@formats", "@release year",
"@box art", "@synopsis", "@synopsis.short", "@screen formats",
"@cast", "@directors", "@languages and audio", "@genres", "@similars"
You can also specify "all" as a shortcut, or even "all-items,to,eliminate" from the results, e.g.:
-x "all-@synopsis,@directors"
...will return everything except for synopsis and directors information.

usage: netflix detail -i <item> 
 -c,--clean                      Strips the results of all markup
 -e,--email <address>            Email address of user
 -f,--friendly                   writes times and numbers in
                                 human-readable form
 -i,--item <href>                href of item to show detail
 -x,--expands <expansion list>   optional expansions of title data

Example:

> netflix detail -i http://api.netflix.com/catalog/titles/movies/425791 -c -f
Title:
Dead Alive

Web Page:
http://www.netflix.com/Movie/Dead_Alive/425791

Runtime:
1 hour, 37 minutes

Formats:        Availability Dates:
[DVD]   Available From: 1998-09-14

Release Year:
1992

Box Art Link:
http://api.netflix.com/catalog/titles/movies/425791/box_art

Synopsis:
Although it's easy to admire the maniacal glee of director Peter Jackson's bloodfest,
Dead Alive is nonetheless intense and profoundly disturbing. When a Sumatran rat-monkey
bites Lionel Cosgrove's mother, she's transformed into a zombie. She begins killing
(and transforming) the entire town while Lionel races to keep things under control.
Events culminate at a house party that turns into a blood-drenched zombie buffet.

Short synopsis:
null

Screen Formats:
DVD     Widescreen 1.66:1

Cast:
Timothy Balme   http://api.netflix.com/catalog/people/20001411
Elizabeth Moody http://api.netflix.com/catalog/people/65156
Diana Penalver  http://api.netflix.com/catalog/people/72442
Ian Watkin      http://api.netflix.com/catalog/people/97597

Directors:
Peter Jackson   http://api.netflix.com/catalog/people/45248

Languages and Audio:
DVD     English  Dolby Digital 2.0 Stereo

Genres:
Horror
Zombies
Dark Humor & Black Comedies
Lionsgate Home Entertainment

view

Views the contents of the user's specified queue.
Returns three tab-delimited columns. The first is the title, the second is the
title queue ID, and the third is the title's catalog ID.

usage: netflix view -q <target queue>
 -e,--email <address>      Email address of user
 -q,--queue <queue name>   Specific queue to view (disc or instant, defaults to disc)

Example:

> netflix view
Primus: Animals Should Not Try to Act Like People
        http://api.netflix.com/users/g08Xmo-/queues/disc/available/1/60031732
                http://api.netflix.com/catalog/titles/movies/60031732
I, Claudius: Disc 3     
        http://api.netflix.com/users/g08Xmo-/queues/disc/available/2/60022927
                http://api.netflix.com/catalog/titles/discs/60022927
...

login

Logs a user into the system, and writes an access token to the filesystem.
Echoes the token text to the console.

usage: netflix login -e <email> -p <password>
 -e,--email <address>      Email address of user
 -p,--password <passval>   user password.  If not supplied you will be prompted for one.

Example:

> 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

revoke

Removes a user's token from the local store.
Additionally, if the specified user is set as the
default, then that user will be removed as the default user.
This method echose nothing to the console. --- usage: netflix revoke -e email -e,--email address Email address of user token to remove ---

Example:

> netflix revoke -e foo@bar.com
>

setdefault

Sets a user as the default, thereby avoiding
having to specify a user for each command.
Echoes the access token to the console.

usage: netflix setdefault -e <email>
 -e,--email <address>   Email address of user to set to default

Example:

> netflix setdefault -e foo@bar.com
oauth_token=T1myE.IzHG.Pr76SdmPkdXnXK1Ae9ojG1pr1rgTqEZZePVNLfFLJtvEbzOAm_VCqy4--
&user_id=T1lVtFibroPtZ4w8botFhruzqo-&oauth_token_secret=WqerzSEwDvAU

lolomo

Retrieves the List Of Lists Of MOvies for the given user.
Returns two columns. The first is the list name (e.g., "Comedy")
and the second is the lolomo list URI.

usage: netflix lolomo -e <email>
 -e,--email <address>   Email address of user

Example:

> netflix lolomo 
Recently Watched        http://api.netflix.com/catalog/titles?filters=http://...
New Arrivals: Movies    http://api.netflix.com/catalog/titles?filters=http://...
...

athome

Shows what the given user has at home.
Returns four columns: title, title queue ID,
shipped date, and estimated arrival date.

usage: netflix athome -e <email>
 -e,--email <address>   Email address of user

Example:

> netflix athome
I, Claudius: Disc 1     http://api.netflix.com/users/g08Xmo-/at_home/60022925    2009-08-25      2009-08-26
I, Claudius: Disc 2     http://api.netflix.com/users/g08Xmo-/at_home/60022926    2009-10-06      2009-10-07

history

Displays user's recent rental history.
Returns three columns: title, title queue ID,
and the subresource type (shipped, watched, or returned). 

usage: netflix history -e <email>
 -e,--email <address>             Email address of user
 -s,--subresource <subResource>   Show only subresource [shipped, watched, returned]

Example:

>  netflix history
Happy Tree Friends   http://api.netflix.com/catalog/titles/programs/153864/70125145  Watched
Journey to 10,000 BC    http://api.netflix.com/catalog/titles/movies/70093409   Returned
Werewolf  http://api.netflix.com/catalog/titles/movies/70106078   Watched
Slayer: War at the Warfield     http://api.netflix.com/catalog/titles/movies/70004020   Shipped
The Venture Bros.: Season 3     http://api.netflix.com/catalog/titles/series/70048442/seasons/70113721  Returned
...

init

Sets up the client environment. Most users will only have to call this
method once, but you can call it as often as needed.
Each call to init will create a record for a given environment.
If you specify the same environment name, the old environment
will be overwritten.
The init method is interactive, prompting the user for
needed information. Some fields have defaults; these are
shown in square brackets. Simply hit return to use them.

usage: netflix init

Example:

> netflix init
API Base URI: [http://api.netflix.com] 
Login Path: [http://api-user.netflix.com/oauth/login] 
Consumer Key (no default value): 6734673142
Consumer Secret (no default value): hr383
Application Name (no default value): My Super App
Save environment as...: [prod] foobar
Wrote configuration for environment foobar to file /Users/edgarfrog/netflix/nfcli-properties.groovy.