Node.js module for the Yourls API
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test Added support for dbstats and stats. Sep 12, 2014

node-yourls - Yourls API for nodejs

This module provides hooks into the Yourls API for Nodejs. For more information about Yourls and what it can do, visit their API docs.


YOURLS is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL). You can make it private or public, you can pick custom keyword URLs. This means you will need the URL of your, or someone else's, YOURLS installation as well as an API Signature token for that install.

Works over both http and https.


with Node.js

yourls.js is available on NPM

You can install it with the following command:

npm install yourls


var Yourls = require('./node-yourls/yourls');

var yourls_url = '';
var yourls_api = '1a40d1e654';

var yourls = new Yourls(yourls_url, yourls_api);

yourls.shorten('', function(error, result) {
    if (error) {
        throw error;


To run tests type npm test

Yourls Features

  • shorten
  • vanity
  • expand
  • urlstats
  • stats
  • dbstats