0.1.2 • Published 13 years ago
linkscape v0.1.2
SeoMOZ Linkscape API Library
Node-linkscape is a node.js module for asynchronously communicating with the seoMOZ linkscape APIs. It supports the url-metrics, links, anchor-text, and top-pages APIs.
Installation
Use npm to install node-linkscape
npm install linkscapeUsage
var Linkscape = require('linkscape').Linkscape;
var seomoz = new Linkscape('your-access-id', 'your-secret');
seomoz.urlMetrics('www.google.com', ['url', 'links'], function(err, res) {
if (err) {
console.log(err);
return;
}
console.log(res);
});Methods Available
###urlMetrics
seomoz.urlMetrics(url, cols, callback)urlThe URL you want metrics for, ex:'www.google.com'colsAn array of strings for the columns you want in the response (seeLinkscape.URL_METRICS_FLAGS). Ex:['title', 'url', 'links']callbackA function to be called asynchronously once the response comes back from the API. The function should accept 2 arguments in the following order:error, resultwhere error will either be an object or null, and result will be an object containing the response from seoMOZ.
###links
seomoz.links(url, scope, options, callback)urlThe URL you want to get links for, ex:www.google.comscopeThe scope of the results as per the seoMOZ API docs, ex:page_to_pageoptionsAn object with any of the following:sortAs per the seoMOZ API docs, ex:page_authorityfilterAn array of strings, ex:['internal', external', 'nofollow']targetColsArray of strings for the columns returned for the target of the link, seeLinkscape.URL_METRICS_FLAGSsourceColsArray of strings for the columns returned for the source of the link, seeLinkscape.URL_METRICS_FLAGSlinkColsArray of strings for the columns for the link itself, seeLinkscape.LINK_FLAGS
callbackSame as urlMetrics.
###anchorText
seomoz.anchorText(url, scope, cols, callback)urlThe URL you want to get anchor texts for, ex:www.google.comscopeScope of the link as per the seoMOZ API docs, ex:phrase_to_pagecolsArray of strings for the columns returned, seeLinkscape.ANCHOR_TEXT_FLAGScallbackSame as urlMetrics.
###topPages
seomoz.topPages(url, cols, options, callback)urlThe subdomain you want results forcolsAn array of strings for the columns you want in the response (seeLinkscape.URL_METRICS_FLAGS). Ex:['title', 'url', 'links']optionsAn object with any of the following:offsetReturn starting at the nth resultlimitHow many results to return (max 1000)
callbackSame as urlMetrics