@stonksjs/robinhood-collections
Get the stock symbols for any Robinhood collection
Installation
npm install --save @stonksjs/robinhood-collections
Usage
const robinhoodCollections = require('@stonksjs/robinhood-collections');
// get all valid Robinhood collections
console.log(robinhoodCollections.collections); // [{ id: '100-most-popular', name: '100 Most Popular'}, ...]
const symbols = await robinhoodCollections.getCollection('reit'); // returns array of ticket symbols
API
object
@stonksjs/robinhood-collections :
Array.<object>
robinhoodCollections.collections : An array of Robinhood collections, including the name and id
Kind: static property of
@stonksjs/robinhood-collections
Example
[
{ id: '100-most-popular', name: '100 Most Popular' },
{ id: 'upcoming-earnings', name: 'Upcoming Earnings' },
{ id: 'new-on-robinhood', name: 'New On Robinhood' },
{ id: 'technology', name: 'Technology' },
{ id: 'oil-and-gas', name: 'Oil and Gas' },
{ id: 'finance', name: 'Finance' },
{ id: 'software-service', name: 'Software Service' },
{ id: 'energy', name: 'Energy' },
{ id: 'manufacturing', name: 'Manufacturing' },
{ id: 'consumer-product', name: 'Consumer Products' },
{ id: 'etf', name: 'ETF' },
{ id: 'video-game', name: 'Video Games' },
{ id: 'social-media', name: 'Social Media' },
{ id: 'health', name: 'Health' },
{ id: 'entertainment', name: 'Entertainment' },
{ id: 'internet', name: 'Internet' },
{ id: 'electronics', name: 'Electronics' },
{ id: 'semiconductor', name: 'Semiconductors' },
{ id: 'pharmaceutical', name: 'Pharmaceutical' },
{ id: 'retail', name: 'Retail' },
{ id: 'automotive', name: 'Automotive' },
{ id: 'reit', name: 'REIT' },
{ id: 'banking', name: 'Banking' },
{ id: 'food', name: 'Food' },
{ id: 'material', name: 'Materials' },
{ id: 'aerospace', name: 'Aerospace' },
];
Promise
robinhoodCollections.getCollection ⇒ Get the ticker symbols from a given Robinhood collection
Kind: static property of
@stonksjs/robinhood-collections
Returns: Promise
- - array of ticket symbols from the
collection Fulfil: object
- company financial data Reject:
Error
Param | Type | Description |
---|---|---|
collection | string |
the id of a robinhood collection |
Example
const robinhoodCollections = require('@stonksjs/robinhood-collections');
const symbols = await robinhoodCollections.getCollection('reit');