Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
/ hive-js Public archive

Javascript library for easy use of the hive.one API

Notifications You must be signed in to change notification settings

hive-one/hive-js

Repository files navigation

Test Suite

Hive JS

⚠️This is deprecated. See https://www.borgapi.com/ ⚠️

Install

  1. Sign up for an Account at hive.one
  2. Get an API Key here
  3. Install via npm
npm install --save hiveone-js

Usage

Import into your project using the relevant method:

const hive = require('hiveone-js').default;
const api = hive({ apiKey: 'APIKEYHERE' });
import hive from 'hiveone-js';
const api = hive({ apiKey: 'APIKEYHERE' });
// Default
let response = await api.availableInfluncers();

// Requesting twitter_id's
let response = await api.availableInfluncers({ format: 'id' });

Argument Required Default Options Purpose
format No screenName screenName, id Change the format of the influencer ID
// Default
let response = await api.topInfluencers();

// BTC with pagination
let response = await api.topInfluencers({ cluster: 'BTC', after: 50 });
Argument Required Default Options Purpose
cluster No Crypto Crypto, BTC, ETH, XRP Specify the cluster you want the top influencers for
after No 0 Multiples of 50 Used for pagination
// Default
let response = await api.influencerDetails({ influencerId: 'jack' });

// Personal Rank Type
let response = await api.influencerDetails({ influencerId: 'jack', rankType: 'personal' });

// Include Followers
let response = await api.influencerDetails({ influencerId: 'jack', includeFollowers: 1 });

// Request using twitter_id
let response = await api.influencerDetails({ influencerId: '12', format: 'id' });
Argument Required Default Options Purpose
influencerId Yes Unique ID (Screen Name or Twitter ID) for the influencer you are requesting.
format No screenName screenName, id Change the format of the influencer ID
rankType No all all, personal People are treated differently from other types of influencers (Companies, bots, etc.), if you request all an influencers rank/score will reflect their influence across the entire cluster, if you request personal their rank/score will reflect their influence across other people in the cluster.
includeFollowers No 0 0, 1 Allows you to get top followers for the requested influencer.
// Default
let response = await api.influencerHistory({ influencerId: 'jack' });

// Personal Rank Type
let response = await api.influencerHistory({ influencerId: 'jack', rankType: 'personal' });

// Request using twitter_id
let response = await api.influencerHistory({ influencerId: '12', format: 'id' });
Argument Required Default Options Purpose
influencerId Yes Unique ID (Screen Name or Twitter ID) for the influencer you are requesting.
format No screenName screenName, id Change the format of the influencer ID
rankType No all all, personal People are treated differently from other types of influencers (Companies, bots, etc.), if you request all an influencers rank/score will reflect their influence across our entire dataset, if you request personal their rank/score will reflect their infulencer across other people.
// Default
let response = await api.influencerPodcasts({ influencerId: 'jack' });

// appearance_type
let response = await api.influencerPodcasts({ influencerId: 'jack', rankType: 'personal' });

// Pagination
let response = await api.influencerPodcasts({ influencerId: 'jack', after: 20 });

// Request using twitter_id
let response = await api.influencerPodcasts({ influencerId: '12', format: 'id' });
Argument Required Default Options Purpose
influencerId Yes Unique ID (Screen Name or Twitter ID) for the influencer you are requesting.
format No screenName screenName, id Change the format of the influencer ID
appearanceType No all all, host, guest Allows you to filter podcasts whether the requested influencer was a host or a guest
after No 0 Multiples of 20 Used for pagination
// Default
let response = await api.influencerHistory({ influencerIDS: [123, 123] });
Argument Required Default Options Purpose
influencerIDS Yes An array of twitter_ids for the influencers you want to retrieve.
rankType No all all, personal People are treated differently from other types of influencers (Companies, bots, etc.), if you request all an influencers rank/score will reflect their influence across our entire dataset, if you request personal their rank/score will reflect their infulencer across other people.
includeFollowers No 0 0, 1 Allows you to get top followers for the requested influencer.

Changing Defaults

You can change the defaults when initializing the library

You can change the default infleuncerID format like so:

const hive = require('hiveone-js').default;
const api = hive({ apiKey: 'APIKEYHERE', defaultFormat = 'id' });

You can also change the host the library connects to (Useful if you are caching hive.one data)

const hive = require('hiveone-js').default;
const api = hive({ apiKey: 'APIKEYHERE', host = 'https://hosthere' });

Contributions

  1. Reports for issues and suggestions can be made using the issue submission interface.
  2. Code contributions are submitted via pull requests

Developer Notes

Developer Install

Install the latest developer version with npm from github:

npm install git+https://github.com/hive-one/hive-js

Install from git cloned source:

  1. Ensure git is installed
  2. Clone into current path
  3. Install via npm
git clone https://github.com/hive-one/hive-js
cd hive-js
npm install

Tests

  1. Clone into current path git clone https://github.com/hive-one/hive-js
  2. Enter into folder cd hive-js
  3. Ensure devDependencies are installed and available
  4. Run tests
npm install
npm test

About

Javascript library for easy use of the hive.one API

Resources

Stars

Watchers

Forks