Perform any bitly API request using a method name and passed data object
The method name to be called on the API
The data object to be passed. Keys should be query paramaters
The bitly request return data
Request to get clicks for urls and hashes
A string or array of strings of short urls and hashes.
Request to get clicks by day for urls and hashes
A string or array of strings of short urls and hashes.
Request to get clicks by minute for urls and hashes
A string or array of strings of short urls and hashes.
Request countries for a single url
Request to expand urls and hashes
A string or array of strings of short urls and hashes.
The results of the request
This is used to return the page title for a given Bitlink.
An array of short urls or hashes
The results of the request
Lookup a single url
The url to look up
Request referrers for a single url
Used to shorted a url
The URL to be shortened
The results of the request
Generated using TypeDoc
This is the main Bitly module that returns an object of methods. You need to pass in your OAuth access token, as well as an optional config object. You are returned several helper methods, as well as access to a method to pass any bitly api request to.
For information on the data returned from the API, see the docs at https://dev.bitly.com/api.html
node-bitly
{function}
The access token, this from an OAuth session
Optional config object
const BitlyClient = require('bitly'); const bitly = BitleyClient('');
const myFunc = async(uri = 'https://github.com/tanepiper/node-bitly') => {
try {
return await bitly.shorten(uri);
} catch(e) {
throw e;
}
}