- Fundamentals
Market data for the given equity, such as market cap, dividend yield, P/E ratio, description, and more.
- Instrument
Represents a security traded on Robinhood.
- Market
Represents an exchange on which securities are traded.
- OptionInstrument
Represents an option traded on Robinhood.
- OptionOrder
Represents and executes an order for the given option contract.
- Order
Represents and executes an order for the given instrument.
- Portfolio
Represents all of the user's holdings on Robinhood and allows for various queries.
- User
Represents the user that is logged in while accessing the Robinhood API.
Market data for the given equity, such as market cap, dividend yield, P/E ratio, description, and more.
Kind: global class
- Fundamentals
- new Fundamentals(object)
- instance
- .getOpen() ⇒
Number
- .getHigh() ⇒
Number
- .getLow() ⇒
Number
- .getVolume() ⇒
Number
- .getAverageVolume() ⇒
Number
- .get52WeekHigh() ⇒
Number
- .get52WeekLow() ⇒
Number
- .getMarketCap() ⇒
Number
- .getDividendYield() ⇒
Number
- .getPERatio() ⇒
Number
- .getDescription() ⇒
String
- .getHeadquarters() ⇒
String
- .getOpen() ⇒
- static
- .getBySymbol(symbol) ⇒
Promise.<Fundamentals>
- .getBySymbolArray(array) ⇒
Promise.<Array>
- .getByURL(url) ⇒
Promise.<Fundamentals>
- .getBySymbol(symbol) ⇒
Creates a new Fundamentals object.
Param | Type |
---|---|
object | Object |
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Fundamentals.getBySymbol(symbol) ⇒ Promise.<Fundamentals>
Returns a fundamentals object for the given symbol.
Kind: static method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
Returns an array of fundamentals objects for the symbols in the given array.
Kind: static method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
array | Array |
Fundamentals.getByURL(url) ⇒ Promise.<Fundamentals>
Returns a fundamentals object for the given URL.
Kind: static method of Fundamentals
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
url | String |
Represents a security traded on Robinhood.
Kind: global class
- Instrument
- new Instrument(object)
- instance
- .populate(user) ⇒
Promise.<Array>
- .getMarket() ⇒
Promise.<Market>
- .getFundamentals() ⇒
Promise.<Fundamentals>
- .getQuote(user) ⇒
Promise.<Quote>
- .getSplits() ⇒
Promise.<Object>
- .getEarnings() ⇒
Promise.<Object>
- .getPricesPaid() ⇒
Promise.<Object>
- .getPopularity() ⇒
Promise.<Number>
- .getRatings() ⇒
Promise.<Object>
- .getName() ⇒
String
- .getSimpleName() ⇒
String
- .getSymbol() ⇒
String
- .getListDate() ⇒
Date
- .getCountry() ⇒
String
- .getType() ⇒
String
- .getBloombergID() ⇒
String
- .getState() ⇒
String
- .getID() ⇒
String
- .getMarginInitialRatio() ⇒
Number
- .getDayTradeRatio() ⇒
Number
- .getMaintenanceRatio() ⇒
Number
- .isTradeable() ⇒
Boolean
- .isActive() ⇒
boolean
- .isStock() ⇒
Boolean
- .isETP() ⇒
Boolean
- .isADR() ⇒
Boolean
- .equals(otherInstrument) ⇒
Boolean
- .populate(user) ⇒
- static
- .getAll() ⇒
Promise.<Array>
- .getBySymbol(symbol) ⇒
Promise.<Instrument>
- .getByID(id) ⇒
Promise.<Instrument>
- .getByURL(instrumentURL) ⇒
Promise.<Instrument>
- .getTopMoving(direction) ⇒
Promise.<Instrument>
- .getByIdArray(ids) ⇒
Promise.<Array>
- .getCategories() ⇒
Array.<String>
- .getByCategory(category) ⇒
Promise.<Array>
- .getMostPopular() ⇒
Promise.<Array>
- .getUpcomingEarnings() ⇒
Promise.<Array>
- .getRecommendations(user) ⇒
Promise.<Array>
- .getAll() ⇒
Creates a new Instrument object.
Param | Type |
---|---|
object | Object |
Fills the instrument object with market, fundamental, quote, and split data. Returns an array of Market, Fundamentals, Quote, and Splits objects.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
user | User |
Authenticated user object |
instrument.getMarket() ⇒ Promise.<Market>
Returns an object with information on the market that this instrument trades on.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
instrument.getFundamentals() ⇒ Promise.<Fundamentals>
Returns a new Fundamentals object with information such as open, high, low, close, volume, market cap, and more, on this instrument.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Returns an object with a real-time quote on this instrument.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Author: Colin Gillingham https://github.com/Gillinghammer (Added user authentication after Robinhood API update - issue #11)
Param | Type | Description |
---|---|---|
user | User |
Authenticated user object |
Returns an object containing details on past stock splits.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Returns an object containing this company's past and future earnings data.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Returns the high, low, and average prices paid for the instrument by other Robinhood users.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Author: rclai (Discovered API endpoint)
Returns the total amount of open positions on this instrument among all Robinhood users.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Author: rclai (Discovered API endpoint)
Returns an object containing buy hold, and sell ratings from major financial institutions, along with text describing the rating.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Author: rclai (Discovered API endpoint)
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Checks if the instrument is able to be traded.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Checks if the instrument is a stock.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Checks if the instrument is an exchange traded product.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Checks if the instrument is an American Depositary Receipt. Typically applies to foreign companies. https://www.investopedia.com/terms/a/adr.asp
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Check whether another instance of Instrument equals this instance.
Kind: instance method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
otherInstrument | Instrument |
Returns an array of all available instruments. WARNING: this will take a while!
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Instrument.getBySymbol(symbol) ⇒ Promise.<Instrument>
Returns an instrument object for the specified symbol.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
Instrument.getByID(id) ⇒ Promise.<Instrument>
Returns an instrument object for the specified Robinhood instrument ID.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
id | String |
Instrument.getByURL(instrumentURL) ⇒ Promise.<Instrument>
Returns an instrument object for the specified instrument URL.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
instrumentURL | String |
Instrument.getTopMoving(direction) ⇒ Promise.<Instrument>
Returns an array of Instruments for 10 of the top moving S&P 500 equities.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
direction | String |
Possible options: [up, down] |
Returns an array of instrument objects for the specified array of IDs.
Note: large arrays will take longer to process and are capped at 50 per request, so multiple requests will be sent as the function iterates through the array.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
ids | Array |
Returns an array of known categories that can be used with getByCategory(). This list is non-exhaustive.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of Instruments related to the given category.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
category | String |
For possible options see getCategories(). |
Returns an array of Instruments for the top 100 most popular equities on Robinhood.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of Instruments that have upcoming earnings.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of instruments for stocks from Robinhood's recommendations for the given user.
Kind: static method of Instrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
user | User |
Authenticated user object |
Represents an exchange on which securities are traded.
Kind: global class
- Market
- new Market(object)
- instance
- .getNextTradingHours() ⇒
Promise.<Object>
- .getPreviousTradingHours() ⇒
Promise.<Object>
- .getHoursOn(date) ⇒
Promise.<Object>
- .isOpenOn(date) ⇒
Promise.<Boolean>
- .getNextOpen() ⇒
Promise.<Date>
- .getNextClose() ⇒
Promise.<Date>
- .getWebsite() ⇒
String
- .getCity() ⇒
String
- .getName() ⇒
String
- .getCountry() ⇒
String
- .getCode() ⇒
String
- .getAcronym() ⇒
String
- .getHours() ⇒
Object
- .getClose() ⇒
Date
- .getOpen() ⇒
Date
- .getExtendedClose() ⇒
Date
- .getExtendedOpen() ⇒
Date
- .isOpenToday() ⇒
Boolean
- .isOpenNow() ⇒
Boolean
- .isExtendedOpenNow() ⇒
Boolean
- .getNextTradingHours() ⇒
- static
Creates a new Market object.
Param | Description |
---|---|
object | Created using this class' static methods. For example, use 'getByMIC("XNAS")' to create an instance of the Nasdaq. |
Returns an object with hours on the next trading period.
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Returns an object with hours on the previous trading period.
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Returns an object with hours for the given date.
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
date | Date |
Checks whether the market is open on the given date.
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
date | Date |
Returns the next date and time that the market will be open.
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Returns the next date and time that the market will close.
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of Market
Author: Torrey Leonard https://github.com/Ladinn
Returns a Market object for the given Market Identifier Code (MIC). See ISO 10383: https://www.iso20022.org/10383/iso-10383-market-identifier-codes
Kind: static method of Market
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
code | String |
Returns a Market object for the given market URL.
Kind: static method of Market
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
url | String |
Represents an option traded on Robinhood.
Kind: global class
- OptionInstrument
- new OptionInstrument(object)
- instance
- .getTradability() ⇒
String
- .getStrikePrice() ⇒
Number
- .getState() ⇒
String
- .getType() ⇒
String
- .getInstrumentURL() ⇒
String
- .getSymbol() ⇒
String
- .getMiniumumTicks() ⇒
Object
- .getChainID() ⇒
String
- .getOptionID() ⇒
String
- .getExpiration() ⇒
Date
- .isPut() ⇒
boolean
- .isCall() ⇒
boolean
- .getTradability() ⇒
- static
- .getAll(user) ⇒
Promise.<Array>
- .getChain(user, instrument, side) ⇒
Promise.<any>
- .getPrices(user, instruments) ⇒
Promise.<any>
- .getExpirations(user, instrument) ⇒
Promise.<Array.<Date>>
- .getByURL(user, url) ⇒
Promise.<Instrument>
- .getPositions(user) ⇒
Promise.<Array>
- .getAll(user) ⇒
Param |
---|
object |
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of all option instruments. Note: this may take an eternity - no need to use this.
Kind: static method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
user | User |
Returns an array of all option instruments for the given expiration date and side. Ordered from lowest to highest strike price.
Kind: static method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Author: hbeere (Issue #10)
Param | Type | Description |
---|---|---|
user | User |
|
instrument | Instrument |
|
side | String |
Can be either 'call' or 'put' |
Returns an array prices arranged by strike price. Make sure to only send a maximum of about 50 instruments.
Kind: static method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
user | User |
instruments | Array.<OptionInstrument> |
Returns an array of expiration dates for the given Instrument.
Kind: static method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
user | User |
instrument | Instrument |
OptionInstrument.getByURL(user, url) ⇒ Promise.<Instrument>
Returns an options instrument object for the specified instrument URL.
Kind: static method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
user | User |
url | String |
Returns an array of the user's open option contracts.
Kind: static method of OptionInstrument
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
user | User |
Represents and executes an order for the given option contract.
Kind: global class
- OptionOrder
- new OptionOrder(user, object)
- instance
- .submit() ⇒
Promise.<OptionOrder>
- .getLegs() ⇒
Array
- .getDirection() ⇒
String
- .getPremium() ⇒
Number
- .getProcessedPremium() ⇒
Number
- .getTimeInForce() ⇒
String
- .getReferenceID() ⇒
String
- .getPrice() ⇒
Number
- .getTrigger() ⇒
String
- .getType() ⇒
String
- .getQuantity() ⇒
Number
- .getQuantityPending() ⇒
Number
- .getQuantityCanceled() ⇒
Number
- .getChainID() ⇒
String
- .getSymbol() ⇒
String
- .getDateCreated() ⇒
Date
- .isExecuted() ⇒
Boolean
- .isCredit() ⇒
Boolean
- .isDebit() ⇒
Boolean
- .submit() ⇒
- static
- .getOrders(user) ⇒
Promise.<Array.<OptionOrder>>
- .getOrders(user) ⇒
Creates a new OptionOrder.
Param | Type |
---|---|
user | User |
object | Object |
optionOrder.submit() ⇒ Promise.<OptionOrder>
Submits the OptionOrder to Robinhood and returns the executed OptionOrder.
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Kind: instance method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of executed OptionOrders. NOTE: See OptionInstrument.getPositions for an array of open positions.
Kind: static method of OptionOrder
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
user | User |
Represents and executes an order for the given instrument.
Kind: global class
- Order
- new Order(user, object)
- instance
- .submit() ⇒
Promise.<Object>
- .cancel() ⇒
Promise.<Object>
- .getResponse() ⇒
Object
|Null
- .submit() ⇒
- static
- .getByOrderID(user, orderID) ⇒
Promise.<Order>
- .getRecentOrders(user) ⇒
Promise.<Array>
- .cancelOpenOrders(user) ⇒
Promise.<any>
- .getByOrderID(user, orderID) ⇒
Creates a new Order object.
Param | Type |
---|---|
user | User |
object | Object |
Submits an order to Robinhood to be executed by the exchange.
Kind: instance method of Order
Author: Torrey Leonard https://github.com/Ladinn
Attempts to cancel an order.
Kind: instance method of Order
Author: Torrey Leonard https://github.com/Ladinn
If an order has been executed, this will return the response object.
Kind: instance method of Order
Author: Torrey Leonard https://github.com/Ladinn
Order.getByOrderID(user, orderID) ⇒ Promise.<Order>
Returns a new order object for the specified order ID, if found.
Kind: static method of Order
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
user | User |
orderID | String |
Returns an array of recent orders for the given user object.
Kind: static method of Order
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
user | User |
Kind: static method of Order
Author: Torrey Leonard https://github.com/Ladinn
Param |
---|
user |
Represents all of the user's holdings on Robinhood and allows for various queries.
Kind: global class
- Portfolio
- new Portfolio(user, array)
- .sellAll() ⇒
Promise.<(Boolean|Error)>
- .setQuantity(symbol, targetQuantity) ⇒
Promise.<Order>
- .getStockValue() ⇒
Promise.<Number>
- .getInstrumentArray() ⇒
Array
- .getSymbols() ⇒
Array
- .getBuyPrice(symbol) ⇒
Number
- .getQuantity(symbol) ⇒
Number
- .getSharesHeld(symbol) ⇒
Number
- .getPurchaseDate(symbol) ⇒
Date
- .getLastTradeDate(symbol) ⇒
Date
- .getBySymbol(symbol) ⇒
Object
- .getBySymbols(array) ⇒
Array.<Object>
- .getQuantityGreaterThan(size) ⇒
Array.<Object>
- .getQuantityLessThan(size) ⇒
Array.<Object>
- .getQuantityEqualTo(size) ⇒
Array.<Object>
- .getPurchasedAfter(date) ⇒
Array.<Object>
- .getPurchasedBefore(date) ⇒
Array.<Object>
- .getPurchasedOn(date) ⇒
Array.<Object>
- .getPriceGreaterThan(amount) ⇒
Array.<Object>
- .getPriceLessThan(amount) ⇒
Array.<Object>
- .getPriceEqualTo(amount) ⇒
Array.<Object>
Creates a new Portfolio object.
Param | Type | Description |
---|---|---|
user | User |
|
array | Array |
Created via User.getPortfolio() |
Sells all positions in the user's portfolio at the market price.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
portfolio.setQuantity(symbol, targetQuantity) ⇒ Promise.<Order>
Executes a new order to reduce or increase the user's position in the given symbol by the given amount.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
targetQuantity | Number |
Returns the total market value of all stocks held by the user.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of all instruments in the user's portfolio.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of all symbols in the user's portfolio.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Returns the average buy price for the given symbol.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
Returns the quantity owned of the given symbol.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
Get total shares held for the given symbol.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
Returns the date of original purchase for the given symbol.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
Returns the date of last trade for the given symbol.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
Returns an object containing the user's position in the given symbol.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
symbol | String |
Returns an array of objects containing the user's positions in the given symbols.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
array | Array |
Returns an array of all positions greater than the given amount.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
size | Number |
Returns an array of all positions less than the given amount.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
size | Number |
Returns an array of all positions equal to than the given amount.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
size | Number |
Returns an array of all positions opened after the given date (UTC).
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
date | Date |
Compared with UTC time. |
Returns an array of all positions opened before the given date (UTC).
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
date | Date |
Compared with UTC time. |
Returns an array of all positions opened on the given date (UTC).
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
date | Date |
Compared with UTC time. |
Returns an array of all positions with an average buy price greater than the given amount.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
amount | Number |
Returns an array of all positions with an average buy price less than the given amount.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
amount | Number |
Returns an array of all positions with an average buy price equal to the given amount.
Kind: instance method of Portfolio
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
amount | Number |
Represents the user that is logged in while accessing the Robinhood API.
Kind: global class
- User
- new User(username, password)
- instance
- .authenticate(password, mfaFunction) ⇒
Promise.<User>
- .reauthenticate() ⇒
Promise.<User>
- .logout() ⇒
Promise.<Boolean>
- .serialize() ⇒
string
- .save() ⇒
Promise.<Boolean>
- .isAuthenticated() ⇒
boolean
- .getAuthToken() ⇒
null
|string
- .getAccountNumber() ⇒
null
|string
- .getUsername() ⇒
null
|string
- .getAccount() ⇒
Promise
- .getBalances() ⇒
Promise.<Object>
- .getBuyingPower() ⇒
Promise
- .getUserInfo() ⇒
Promise.<Object>
- .getUID() ⇒
Promise.<String>
- .getTaxInfo() ⇒
Promise.<Object>
- .getDisclosureInfo() ⇒
Promise.<Object>
- .getEmployerInfo() ⇒
Promise.<Object>
- .getInvestmentProfile() ⇒
Promise.<Object>
- .getRecentDayTrades() ⇒
Promise.<Object>
- .getRecentOrders() ⇒
Promise.<Array.<Order>>
- .cancelOpenOrders() ⇒
Promise
- .getOptionOrders() ⇒
Promise.<Array>
- .getPortfolio() ⇒
Promise.<Object>
- .getOptionPositions() ⇒
Promise.<any>
- .getHistoricals() ⇒
Promise.<Object>
- .getLinkedBanks() ⇒
Promise.<Object>
- .addDeposit(bankID, amount, frequency) ⇒
Promise.<Object>
- .getDocuments() ⇒
Promise.<Array>
- .downloadDocuments(folder) ⇒
Promise
- .authenticate(password, mfaFunction) ⇒
- static
- .deserialize(data) ⇒
Promise.<User>
- .load() ⇒
Promise.<User>
- .isUser(object) ⇒
boolean
- .deserialize(data) ⇒
Creates a new User object.
Param | Type | Description |
---|---|---|
username | String |
|
password | String |
Optional. If not provided the user will be prompted via CLI. |
user.authenticate(password, mfaFunction) ⇒ Promise.<User>
Authenticates a user using the inputted username and password.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
password | String | Undefined |
Optional if not provided in constructor or re-authenticating a saved user. |
mfaFunction | function | Undefined |
Optional function that is called when prompted for multi-factor authentication. Must return a promise with a six-character string. If not provided the CLI will be prompted. |
user.reauthenticate() ⇒ Promise.<User>
Re-authenticates a user with the the expired authentication token using the refresh token.
Kind: instance method of User
Author: Egor Verbitskiy https://github.com/egorio
Logout the user by expiring the authentication token and removing any saved data.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Converts a user object to a string to be securely stored.
Note that serialized object contains refreshToken and it's subject to strict storage requirements to ensure that they are not leaked
Kind: instance method of User
Author: Egor Verbitskiy https://github.com/egorio
Save the user to disk. Prevents having to login and logout each run.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Checks if the current user is authenticated and authentication is not expired.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns an auth token.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns an account number.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns a username.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns vital information about balances and enabled features.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns an object containing details on the user's cash and margin balance.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns the amount of money available to be spent.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns information like username, first / last name, creation date, id, and more.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns the user's unique ID.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns information like address, citizenship, SSN, date of birth, and more.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns information on the user pertaining to SEC rule 405.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns information on the user's employment.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns the user's answers to basic questions regarding investment experiences.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns arrays of recent option and equity day trades.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of recent orders.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Cancels all open orders.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of option orders.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns a Portfolio object containing all open positions in a user's portfolio.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns an array of options that the user holds.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns an object that can be used to create a chart, show total return, etc.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Returns an object representing the user's linked bank account. If the user has linked multiple, this returns an array.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Deposits money into the user's account. If frequency is not empty, this becomes an automatic deposit.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Param | Type | Description |
---|---|---|
bankID | String |
This ID can be found from getLinkedBanks(). |
amount | String |
How much money should be deposited, represented as a string. |
frequency | String |
Empty string if one-time deposit, otherwise: 'weekly,' 'biweekly,' 'monthly,' or 'quarterly.' |
Returns an array of account documents (taxes, statements, etc). Use 'downloadDocuments()' to view them.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Downloads all account documents to the given folder path. Note that, because of Robinhood's connection throttling, this will take a while for accounts with high activity. Downloads will be attempted every second and will wait for any connection throttling to end before continuing.
Kind: instance method of User
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
folder | String |
User.deserialize(data) ⇒ Promise.<User>
Restores a user from the serialized object.
Kind: static method of User
Author: Egor Verbitskiy https://github.com/egorio
Param | Type | Description |
---|---|---|
data | String |
serialized data |
User.load() ⇒ Promise.<User>
If a saved user exists, this will load it into system memory. Recommended if using multi-factor authentication.
Kind: static method of User
Author: Torrey Leonard https://github.com/Ladinn
Checks if the provided object an instance of User object.
Kind: static method of User
Author: Torrey Leonard https://github.com/Ladinn
Param | Type |
---|---|
object | Object |