Created: 2011-07-12 03:13
Updated: 2018-06-23 02:04


UPDATE 2014-02-01: Rdio now has an official Node.js client library, which can be found at https://github.com/rdio/rdio-simple/tree/master/node. The library in this repo is no longer maintained, and is here for archival purposes.


Rdio-Node is an Rdio API client library for Node.js. It is based off of the Rdio API Python client (https://github.com/rdio/rdio-python).

How to install

npm install rdio-node

How to use

// Include the library
var Rdio = require('rdio-node').Rdio;

// Create a new instance
var r = new Rdio({
  consumerKey: '<YOUR RDIO KEY>'
, consumerSecret: '<YOUR RDIO SECRET>'

// Make an unauthenticated request
r.makeRequest('search', {query: 'Archers of Loaf', types: 'Artist'}, function() {

// Make an authenticated request (with OAuth flow)
r.beginAuthentication(function(error, loginUrl) {
    if (error) {

    var stdin = process.stdin, stdout = process.stdout;
    stdout.write('visit: ' + loginUrl + '\nEnter your pin: ');
    stdin.once('data', function(data) {
      data = data.toString().trim();
      r.completeAuthentication(data, function() {

        // Notice how unlike the call to 'search' above,
        // 'getPlaylists' doesn't need any parameters.
        r.makeRequest('getPlaylists', function() {

See the examples/ directory for more examples.

Storing OAuth-related information

The library includes a MemoryStore object that stores OAuth request and access tokens in memory. You can pass in your own datastore object if you wish to store this data elsewhere. Just follow the same interface as MemoryStore, and pass it to the Rdio constructor as the 'dataStore' parameter. Note that the datastore currently does not support async operations (i.e. it doesn't take callbacks), so all loading/saving of data should be done outside the Rdio object.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more