npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

al-papi

v0.0.4

Published

AuthorityLabs Partner API wrapper.

Downloads

13

Readme

Node.js AuthorityLabs Partner API Package

A wrapper around the Partner API calls. Allows post, priority post and get calls.

  • Github: http://github.com/mtchavez/node-al-papi
  • endorse

Install

npm install al-papi

Usage

Make a request object using your api key:

// Require al-papi
var al = require('al-papi');

// Configure using your api-key
al.AlConfig('yRR2tB39jStovMy6y6xP');

// Make request object to make api calls
var req = new al.AlRequest();

POST

Post your keyword-engine-locale combination to the API:

req.post({'keyword' : 'Centaur Soirée'}, function(response) {

  console.log(response.statusCode);
  console.log(response.url);
  console.log(response.params);
  
  if (response.success) {
    console.log(response.body);
  }
  else {
    console.log(response.errorMessage);
  }
});

Priority POST

Post your keyword to the priority queue if you need results in a more timely manner:

req.priority_post({'keyword' : 'Centaur Soirée'}, function(response) {

  console.log(response.statusCode);
  console.log(response.url);
  console.log(response.params);
  
  if (response.success) {
    console.log(response.body);
  }
  else {
    console.log(response.errorMessage);
  }
});

GET

When you are ready to get your results you can do a GET request for your keyword-engine-locale combo:

req.get({'keyword' : 'Centaur Soirée'}, function(response) {

  console.log(response.statusCode);
  console.log(response.url);
  console.log(response.params);
  
  if (response.success) {
    console.log(response.body);
  }
  else {
    console.log(response.errorMessage);
  }
});

Response

When making an API request a response object is returned with any errors, http response code and http reponse body.

req.get({'keyword' : 'Centaur Soirée'}, function(response) {

  console.log(response.statusCode); // Status code of response
  console.log(response.url);        // The URL used for your request
  console.log(response.params);     // Original params given
  
  // success is a true/false of if the request received a 200 response code
  if (response.success) {
    // Body will be the parsed JSON response
    console.log(response.body);
  }
  else {
    // Error message if one exists
    console.log(response.errorMessage);
  }
});

Web Insight

Description

Web Insight queue takes a URL for the Partner API to scrape and parse out high level insight about the page and return the results to your callback URL passed in or set for your account.

POST

Post the URL of the page you want to gain insight into and the callback URL knowing when your results are ready to get.

req = new al.AlWebInsight();
req.post({'url' : 'http://www.qwiki.com', 'callback' : 'http://api.authoritylabs.com/callbacks?from=node'}, function(response) {

  console.log(response.statusCode);
  console.log(response.url);
  console.log(response.params);
  
  if (response.success) {
    console.log(response.body);
  }
  else {
    console.log(response.errorMessage);
  }
});

GET

When your results are ready to get you will receive a callback that contains the information on how to get the insight on your URL. In the callback you should receive a date_created and time_created to use in your get request. You will also use your original URL posted.

req = new al.AlWebInsight();
req.get({'url' : 'http://www.qwiki.com', 'date_created' : '2012-06-14', 'time_created' : '01:50'}, function(response) {

  console.log(response.statusCode);
  console.log(response.url);
  console.log(response.params);
  
  if (response.success) {
    console.log(response.body);
  }
  else {
    console.log(response.errorMessage);
  }
});

License

Written by Chavez

Released under the MIT License: http://www.opensource.org/licenses/mit-license.php