Giter VIP home page Giter VIP logo

robinhood-google-sheets's Introduction

Robinhood for Google Sheets

Google Apps Script custom functions that retrieve stock and options data from the Robinhood API and return data in a tabular format for use in Google Sheets.

The Robinhood API is not publicly available but has been explored extensively and is accessible after authenticating.

Script "installation"

  1. Create or open a spreadsheet in Google Sheets.
  2. Select the menu item Tools > Script editor. If you are presented with a welcome screen, click Blank Project on the left to start a new project.
  3. Delete any code in the script editor.
  4. Copy and paste all code in robinhood.gs into the script editor.
  5. IMPORTANT: Replace robinhoodUsername and robinhoodPassword with your own Robinhood credentials. e.g.
var robinhoodUsername = 'janedoe';
var robinhoodPassword = 'passw0rd';
  1. (As of 1/19/20) Log into Robinhood on the Web to [https://stackoverflow.com/questions/55902967/is-there-any-way-to-get-a-bearer-token-now-since-robinhood-has-changed-the-api/56841942](obtain a device_id) and add it to your payload to get past RH's Oauth flow.
  2. Select the menu item File > Save. Give the script project a name and click OK.
  3. Refresh the spreadsheet. You will now be able to use custom functions to retrieve your Robinhood data!

Custom functions

  • Get ACH transfers data
  • Columns returned:
    • scheduled_achTransfers, direction_achTransfers, url_achTransfers, created_at_achTransfers, state_achTransfers, updated_at_achTransfers, amount_achTransfers, early_access_amount_achTransfers, fees_achTransfers, cancel_achTransfers, account_ach_relationship, verification_method_ach_relationship, verify_micro_deposits_ach_relationship, url_ach_relationship, bank_account_nickname_ach_relationship, created_at_ach_relationship, bank_account_holder_name_ach_relationship, bank_account_number_ach_relationship, bank_account_type_ach_relationship, unlinked_at_ach_relationship, initial_deposit_ach_relationship, withdrawal_limit_ach_relationship, verified_ach_relationship, unlink_ach_relationship, bank_routing_number_ach_relationship, id_ach_relationship, expected_landing_date_achTransfers, status_description_achTransfers, id_achTransfers
  • Get dividends data
  • Columns returned:
    • account_dividends, url_dividends, amount_dividends, payable_date_dividends, min_tick_size_instrument, type_instrument, splits_instrument, margin_initial_ratio_instrument, url_instrument, quote_instrument, tradability_instrument, bloomberg_unique_instrument, list_date_instrument, name_instrument, symbol_instrument, fundamentals_instrument, state_instrument, country_instrument, day_trade_ratio_instrument, tradeable_instrument, maintenance_ratio_instrument, id_instrument, market_instrument, simple_name_instrument, rate_dividends, record_date_dividends, position_dividends, withholding_dividends, id_dividends, paid_at_dividends
  • Get documents data. Download URLs for trade confirmations, account statements, and 1099s
  • Columns returned:
    • account_documents, url_documents, created_at_documents, updated_at_documents, download_url_documents, insert_3_url_documents, insert_4_url_documents, insert_1_url_documents, insert_6_url_documents, date_documents, insert_2_url_documents, insert_5_url_documents, type_documents, id_documents
  • Get options orders data
  • Columns returned:
    • direction_optionsOrders, premium_optionsOrders, time_in_force_optionsOrders, processed_premium_optionsOrders, updated_at_optionsOrders, created_at_optionsOrders, pending_quantity_optionsOrders, ref_id_optionsOrders, state_optionsOrders, processed_quantity_optionsOrders, id_optionsOrders, price_optionsOrders, cancel_url_optionsOrders, trigger_optionsOrders, chain_id_optionsOrders, response_category_optionsOrders, chain_symbol_optionsOrders, adjusted_mark_price_marketData, ask_price_marketData, ask_size_marketData, bid_price_marketData, bid_size_marketData, break_even_price_marketData, high_price_marketData, instrument_marketData, last_trade_price_marketData, last_trade_size_marketData, low_price_marketData, mark_price_marketData, open_interest_marketData, previous_close_date_marketData, previous_close_price_marketData, volume_marketData, chance_of_profit_long_marketData, chance_of_profit_short_marketData, delta_marketData, gamma_marketData, implied_volatility_marketData, rho_marketData, theta_marketData, vega_marketData, tradability_option, strike_price_option, url_option, expiration_date_option, created_at_option, chain_id_option, updated_at_option, state_option, type_option, chain_symbol_option, cutoff_price_option, below_tick_option, above_tick_option, id_option, side_marketData, position_effect_marketData, id_marketData, executions_marketData, ratio_quantity_marketData, type_optionsOrders, canceled_quantity_optionsOrders, quantity_optionsOrders
  • Get current and past options positions data
  • Columns returned:
    • intraday_average_open_price_optionsPositions, account_optionsPositions, intraday_quantity_optionsPositions, adjusted_mark_price_marketData, ask_price_marketData, ask_size_marketData, bid_price_marketData, bid_size_marketData, break_even_price_marketData, high_price_marketData, instrument_marketData, last_trade_price_marketData, last_trade_size_marketData, low_price_marketData, mark_price_marketData, open_interest_marketData, previous_close_date_marketData, previous_close_price_marketData, volume_marketData, chance_of_profit_long_marketData, chance_of_profit_short_marketData, delta_marketData, gamma_marketData, implied_volatility_marketData, rho_marketData, theta_marketData, vega_marketData, tradability_option, strike_price_option, url_option, expiration_date_option, created_at_option, chain_id_option, updated_at_option, state_option, type_option, chain_symbol_option, cutoff_price_option, below_tick_option, above_tick_option, id_option, created_at_marketData, updated_at_marketData, average_price_marketData, chain_id_marketData, pending_expired_quantity_marketData, pending_buy_quantity_marketData, url_marketData, pending_sell_quantity_marketData, chain_symbol_marketData, type_marketData, id_marketData, quantity_marketData
  • Get stock orders data
  • Columns returned:
    • updated_at_orders, ref_id_orders, time_in_force_orders, fees_orders, cancel_orders, response_category_orders, id_orders, cumulative_quantity_orders, stop_price_orders, reject_reason_orders, min_tick_size_instrument, type_instrument, splits_instrument, margin_initial_ratio_instrument, url_instrument, quote_instrument, tradability_instrument, bloomberg_unique_instrument, list_date_instrument, name_instrument, symbol_instrument, fundamentals_instrument, state_instrument, country_instrument, day_trade_ratio_instrument, tradeable_instrument, maintenance_ratio_instrument, id_instrument, market_instrument, simple_name_instrument, state_orders, trigger_orders, override_dtbp_checks_orders, type_orders, last_transaction_at_orders, price_orders, executions_orders, extended_hours_orders, account_orders, url_orders, created_at_orders, side_orders, override_day_trade_checks_orders, shares_held_for_stock_grants_position, account_position, pending_average_buy_price_position, shares_held_for_options_events_position, intraday_average_buy_price_position, url_position, shares_held_for_options_collateral_position, created_at_position, updated_at_position, shares_held_for_buys_position, average_buy_price_position, instrument_position, intraday_quantity_position, shares_held_for_sells_position, shares_pending_from_options_events_position, quantity_position, average_price_orders, quantity_orders
  • Get portfolios data. Only one portfolio is returned (for now?)
  • Columns returned:
    • unwithdrawable_grants_portfolios, account_portfolios, excess_maintenance_with_uncleared_deposits_portfolios, url_portfolios, excess_maintenance_portfolios, market_value_portfolios, withdrawable_amount_portfolios, last_core_market_value_portfolios, unwithdrawable_deposits_portfolios, extended_hours_equity_portfolios, excess_margin_portfolios, excess_margin_with_uncleared_deposits_portfolios, equity_portfolios, last_core_equity_portfolios, adjusted_equity_previous_close_portfolios, equity_previous_close_portfolios, start_date_portfolios, extended_hours_market_value_portfolios
  • Get current and past stocks positions data
  • Columns returned:
    • shares_held_for_stock_grants_positions, account_positions, pending_average_buy_price_positions, shares_held_for_options_events_positions, intraday_average_buy_price_positions, url_positions, shares_held_for_options_collateral_positions, created_at_positions, updated_at_positions, shares_held_for_buys_positions, average_buy_price_positions, min_tick_size_instrument, type_instrument, splits_instrument, margin_initial_ratio_instrument, url_instrument, ask_price_quote, ask_size_quote, bid_price_quote, bid_size_quote, last_trade_price_quote, last_extended_hours_trade_price_quote, previous_close_quote, adjusted_previous_close_quote, previous_close_date_quote, symbol_quote, trading_halted_quote, has_traded_quote, last_trade_price_source_quote, updated_at_quote, instrument_quote, tradability_instrument, bloomberg_unique_instrument, list_date_instrument, name_instrument, symbol_instrument, open_fundamentals, high_fundamentals, low_fundamentals, volume_fundamentals, average_volume_2_weeks_fundamentals, average_volume_fundamentals, high_52_weeks_fundamentals, dividend_yield_fundamentals, low_52_weeks_fundamentals, market_cap_fundamentals, pe_ratio_fundamentals, shares_outstanding_fundamentals, description_fundamentals, instrument_fundamentals, ceo_fundamentals, headquarters_city_fundamentals, headquarters_state_fundamentals, sector_fundamentals, num_employees_fundamentals, year_founded_fundamentals, state_instrument, country_instrument, day_trade_ratio_instrument, tradeable_instrument, maintenance_ratio_instrument, id_instrument, market_instrument, simple_name_instrument, intraday_quantity_positions, shares_held_for_sells_positions, shares_pending_from_options_events_positions, quantity_positions
  • Get watchlist data
  • Columns returned:
    • watchlist_watchlist, min_tick_size_instrument, type_instrument, splits_instrument, margin_initial_ratio_instrument, url_instrument, ask_price_quote, ask_size_quote, bid_price_quote, bid_size_quote, last_trade_price_quote, last_extended_hours_trade_price_quote, previous_close_quote, adjusted_previous_close_quote, previous_close_date_quote, symbol_quote, trading_halted_quote, has_traded_quote, last_trade_price_source_quote, updated_at_quote, instrument_quote, tradability_instrument, bloomberg_unique_instrument, list_date_instrument, name_instrument, symbol_instrument, open_fundamentals, high_fundamentals, low_fundamentals, volume_fundamentals, average_volume_2_weeks_fundamentals, average_volume_fundamentals, high_52_weeks_fundamentals, dividend_yield_fundamentals, low_52_weeks_fundamentals, market_cap_fundamentals, pe_ratio_fundamentals, shares_outstanding_fundamentals, description_fundamentals, instrument_fundamentals, ceo_fundamentals, headquarters_city_fundamentals, headquarters_state_fundamentals, sector_fundamentals, num_employees_fundamentals, year_founded_fundamentals, state_instrument, country_instrument, day_trade_ratio_instrument, tradeable_instrument, maintenance_ratio_instrument, id_instrument, market_instrument, simple_name_instrument, created_at_watchlist, url_watchlist

NOTE: Columns returned will change if Robinhood API responses change

Refresh Data menu item

TL;DR: Calling a ROBINHOOD_GET function without changing the argument passed to function will not return new data. A Refresh Data custom menu item is implemented so that data can be refreshed.

Apps Script custom functions are deterministic and will only recalculate if their arguments change. All ROBINHOOD_GET functions have an optional datetime parameter so that the current datetime can be passed to the function in order to force recalculation. A Google Sheets custom menu with a Refresh Data item is implemented so that a current datetime value can be set in cell Refresh!$A$1. ROBINHOOD_GET functions that reference this cell will return non-cached, fresh results when Refresh Data is clicked. Stolen from https://stackoverflow.com/a/17347290. Example:

ROBINHOOD_GET_POSITIONS(Refresh!$A$1)

Examples of usage in Google Sheets

functions_list functions_help positions_function_1 positions_function_2

NOTE: These are examples of a dashboard created using data returned by the functions. Data can be consumed in whatever way you see fit!

positions_dashboard_1 positions_dashboard_2

Gotchas

  • Script does not support accounts set up with two-factor authentication.
  • Code may break unexpectedly as it depends on Robinhood's private API!
  • Some API fields are not returned in full. e.g. the /options/orders/ endpoint returns a legs field that might (I have yet to test) contain multiple components and executions if an options strategy contains multiple contracts. The code in its current state does not expand these results. Example response:
{
  "direction": "credit",
  "premium": "5.00000000",
  "time_in_force": "gfd",
  "processed_premium": "10.00000000000000000",
  "updated_at": "2018-04-18T17:11:38.981149Z",
  "created_at": "2018-04-18T17:11:38.315155Z",
  "pending_quantity": "0.00000",
  "ref_id": "CCBCE885-E41D-42A1-9EAE",
  "state": "filled",
  "processed_quantity": "2.00000",
  "id": "6822d0a2-737d-48de-8a24",
  "price": "0.05000000",
  "cancel_url": null,
  "trigger": "immediate",
  "chain_id": "57661a97-f7d4-470c-80c5",
  "response_category": "success",
  "chain_symbol": "ROB.N",
  "legs": [
    {
      "option": "https://api.robinhood.com/options/instruments/06717265-09c1-4e20-8f60/",
      "side": "sell",
      "position_effect": "open",
      "id": "66054ae1-5f30-4725-b203",
      "executions": [
        {
          "timestamp": "2018-04-18T17:11:38.581000Z",
          "price": "0.05000000",
          "settlement_date": "2018-04-19",
          "id": "8a49f0e9-52c9-4db3-ae2d",
          "quantity": "2.00000"
        }
      ],
      "ratio_quantity": 1
    }
  ],
  "type": "limit",
  "canceled_quantity": "0.00000",
  "quantity": "2.00000"
}
  • A custom function call must return within 30 seconds. If it does not, the cell will display an error: Internal error executing the custom function.

I have only been able to test this code with my own account; any PRs or issues created are welcome! ๐Ÿ˜Ž๐Ÿ“ˆ

robinhood-google-sheets's People

Contributors

dd-w avatar fkotsian avatar zameschua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robinhood-google-sheets's Issues

error on load

Getting an Error on load with the following tooltip output:

Cannot find method put(string,(class),(class)). (line 78).

I'm not seeing a call to api.robinhood.com in the loading sequence.

Perhaps this is failing because of MFA... investigating...

Custom list not accessible

hi, when i use the watchlists api, i get results from the default watchlist.
I'd like to query a custom watchlist.
i tried using the /watchlists/ end point instead of /watchlists/Default/ that's configured in the script, i only get back the default list in the result, however, i have a couple custom lists on Robinhood and have actually deleted the default list. Any clue?

Incorrect Authentication credentials. Error while running script.

HI

I followed the instructions and when i try to login , i get this error.

I have changed the username and password to the correct details. i confirmed using the same login credentials and they are correct.

Could you help please

Error Robinhood API request failed. 401: {"detail":"Incorrect authentication credentials."} (line 89).

Login Issue

Hi,

I had been using your code to trade until recently. Does your login still work? I have modified the code for the latest changes but I get an error. Could you please check the following code and see where it is going wrong?

Thanks

var deviceToken = generateDeviceToken();
var robinhoodApiBaseUrl = 'https://api.robinhood.com';

function generateDeviceToken(){
rands = []

for(i=0; i<16; i++){
r = Math.random()
rand = 4294967296 * r
rands.push((parseInt(rand) >> ((3 & i) << 3)) & 255)
}

hexa = []
for(i=0; i<256; ++i){
hexa.push((parseInt(i) + 256).toString(16).substring(1));
}

id = ""
for(i=0; i<16; i++){
id += hexa[rands[i]]
if ((i == 3) || (i == 5) || (i == 7) || (i == 9)){
id += "-"
}
}
Logger.log(id);
return id;
}

function getClassicToken() {
//Trying to login with the new device id for the first time. This is where I get a prompt to select sms or email. This part works.
var url = robinhoodApiBaseUrl + '/oauth2/token/';
var payload = {
'username': robinhoodUsername,
'password': robinhoodPassword,
'device_token': deviceToken,
'expires_in': 86400,
'grant_type': 'password',
'client_id': 'c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS',
'scope': 'internal'
};
var options = {
'method': 'post',
'payload': payload,
'muteHttpExceptions': true
};
var response = UrlFetchApp.fetch(url, options);
Logger.log(response);

Utilities.sleep(1000);

//This portion says I would like to receive the code by email. I am able to get the challenge id in resonse. This works too
var payload = {
'challenge_type': 'email',
'username': robinhoodUsername,
'password': robinhoodPassword,
'device_token': deviceToken,
'expires_in': 86400,
'grant_type': 'password',
'client_id': 'c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS',
'scope': 'internal'
};
var options = {
'method': 'post',
'payload': payload,
'muteHttpExceptions': true
};
var response = UrlFetchApp.fetch(url, options);
Logger.log(response);
var responseJson = JSON.parse(response.getContentText());
var id = responseJson["challenge"]["id"];
Logger.log('Challenge ID: ' + id);

Utilities.sleep(20000);

//This portion checks my email and gets extracts the code. This works too
var threads = GmailApp.search("subject:Your Email Verification Code");
Logger.log(threads.length);
threads = threads[threads.length-1];
var message = threads.getMessages();
Logger.log(message.length);
message = message[message.length-1];
var body = message.getPlainBody();
var ind = body.indexOf("you.");
var code = body.substring(ind+8, ind+14);
Logger.log(code);
threads.moveToTrash();

Utilities.sleep(10000);

//This portion posts the challenge id and I get the validated response. I also get an email saying that I have logged in from another device with the IP but the browser says Other and location United States
url = robinhoodApiBaseUrl + '/challenge/' + id + '/respond/';
var payload = {
'response': code
};
var options = {
'method': 'post',
'payload': payload,
'muteHttpExceptions': true
};
var response = UrlFetchApp.fetch(url, options);
Logger.log(response);

Utilities.sleep(10000);

//When I post the device id along with the challenge id, I do not get the token, instead I am getting Server Error 500
var url = robinhoodApiBaseUrl + '/oauth2/token/';
var payload = {
'challenge_type': 'email',
'username': robinhoodUsername,
'password': robinhoodPassword,
'device_token': deviceToken,
'expires_in': 86400,
'grant_type': 'password',
'client_id': 'c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS',
'scope': 'internal'
};

var options = {
'method': 'post',
'payload': payload,
'muteHttpExceptions': true,
'headers': {
'X-ROBINHOOD-CHALLENGE-RESPONSE-ID': id
}
};
Logger.log('Device Token: ' + deviceToken);
Logger.log('URL: ' + url);
var response = UrlFetchApp.fetch(url, options);
Logger.log(response);
var responseJson = JSON.parse(response.getContentText());
var classicToken = responseJson.access_token;
Logger.log('classic token: ' + classicToken);

return classicToken;
}

Refresh menu conflicts custom menus with onOpen(){ SpreadsheetsApp.getUi()

Hi Folks,
Thank you all for creating a maintaining this awesome repo. This is my crashcourse in Javascript/GAS, as well as Github, and I've only pulled out a little bit of my hair so far.

As you know, the existing repo has a section of code that among other things, creates a new menu item that refreshes the data from the Robinhood_get custom function calls by updating the time in a cell in the 'Refresh' sheet. A great feature, but it seems to interfere with an improvement I'm trying to make that would call for a different menu to be added.

I want to create a menu with userProperties, so end user can input their username, password, and device_token without having to do any scripting. I've gotten as far as creating the menu. However, once implemented into the robinhood-google-sheets script, I get this funny error that I haven't been able to troubleshoot on my own.

Basically, either one or the other custom menu will load in the menu bar, but not both.

Any help would be appreciated.

Here's the existing onOpen() code that is in the repo, which creates the "Refresh Data" menu:

function onOpen() { var cache = CacheService.getScriptCache(); cache.remove('accessToken'); var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); var refreshSheet = spreadsheet.getSheetByName('Params'); if (refreshSheet === null) { refreshSheet = spreadsheet.insertSheet('Params'); } var entries = [{ name: 'Refresh Data', functionName: 'refreshLastUpdate_' }]; spreadsheet.addMenu('Refresh Data', entries); }

This is my proposed additional menu:

`var scriptProperties = PropertiesService.getScriptProperties();
var userProperties = PropertiesService.getUserProperties();

function onOpen(){
SpreadsheetApp.getUi()
.createMenu('Azeem')
.addSubMenu(SpreadsheetApp.getUi().createMenu('Robinhood Credentials')
.addItem('Robinhood Username', 'userUsername')
.addItem('Robinhood Password', 'userPassword')
.addItem('Robinhood Device Token', 'userDeviceToken'))
.addSubMenu(SpreadsheetApp.getUi().createMenu('Show Credentials')
.addItem('Show All Robinhood User Keys', 'alertAllUserProperties'))
.addSubMenu(SpreadsheetApp.getUi().createMenu('Delete Credentials')
.addItem('Delete all Robinhood User Account Info', 'deleteAllUser'))
.addToUi();
}

function userUsername(){
var ui = SpreadsheetApp.getUi();
var userUsername = ui.prompt('Robinhood Username (usually an email address) ' , ui.ButtonSet.OK_CANCEL);
userProperties.setProperty('RH Username', userUsername.getResponseText());
}

function userPassword(){
var ui = SpreadsheetApp.getUi();
var userPassword = ui.prompt('Robinhood Password ' , ui.ButtonSet.OK_CANCEL);
userProperties.setProperty('RH Password', userPassword.getResponseText());
}

function userDeviceToken(){
var ui = SpreadsheetApp.getUi();
var userDeviceToken = ui.prompt('Robinhood Device_Token (See Instructions on the first Tab) ' , ui.ButtonSet.OK_CANCEL);
userProperties.setProperty('RH Device Token', userDeviceToken.getResponseText());
}

// ----------- Operations ---------------------------

function deleteAllUser(){
userProperties.deleteAllProperties();
}

function alertAllUserProperties(){
var ui = SpreadsheetApp.getUi();
var stringUserProperties = '';
var userdata = userProperties.getProperties();
for (var userkey in userdata){
stringUserProperties = stringUserProperties + '(userKey): ' + userkey + ' Value: ' + userdata[userkey] + '\n';
}
ui.alert(stringUserProperties);
}

function alertAllUserKeys(){
var ui = SpreadsheetApp.getUi();
var stringUserKeys= '';
var allUserKeys = userProperties.getKeys()
Logger.log('allUserKeys: ' + allUserKeys);
for (var userkey in allUserKeys){
stringUserKeys = stringUserKeys + '(userKey): ' + allUserKeys[userkey] + '\n';
}
ui.alert(stringUserKeys);
}
`

SyntaxError

I am getting this error when I try to run the script or use any function in my sheet.

SyntaxError: Unexpected token: < (line 41, file "Code")

Why is this and how do I fix it?

Volume data showing incorrectly?

Did I miss anything, it looks like =ROBINHOOD_GET_POSITIONS(0) function returns wrong volume data, including columns like the following:
volume_fundamentals | market_date_fundamentals | average_volume_2_weeks_fundamentals | average_volume_fundamentals

Anyone else has similar experiences?

Thanks!

Option quotes

Is this script able to pull option quotes / option chain for a given stock symbol?

Positions API request failed "due to inactive_instruments"

Hey, first off -- this is such a cool tool. I'm loving playing around here. Thank you so much for sharing @rghuckins !

I have a stock in my purchase history that is no longer active (TECS), so when I run "=ROBINHOOD_GET_POSITIONS()" I get the following error:

"Robinhood API request failed. 400: {"inactive_instruments":["TECS"]} (line 90)."

Screenshot: https://puu.sh/FBiad/83d12a0119.png

Is there anyway to edit the script, to have it exclude inactive_instruments? Big thanks in advance.

  • Sam

Retrieve data on Crypto assets?

Hi

Thanks for all the work on this! It's a great tool.

I've scoured the commands, run them all, and looked through the results, and I don't seem to see any way of retrieving info on crypto holdings in a given robinhood account. Any insight on how one might go about getting that info?

Thanks again for putting this code out there!

script not working

I've had a google spreadsheet with the script working for a year now, but haven't used it in a while when I opened the file nothing was loading so updated the device id but it still won't work

ROBINHOOD_GET_ACH_TRANSFERS returning numbers stored as text

The above-referenced function as well as all functions in this code are correctly pulling the data, but returns numbers stored as text for any and all data with numbers in it. Running a subsequent query command on another tab to pull in this data will not mitigate this scenario, as the numbers (i.e., column Y = amount_achTransfers) are still returned as text and not values. Nesting this within an arrayformula does not do it any justice either.

Skip stocks that no longer exist and/or are not tradable on Robinhood

Reporting an issue brought up by @xtego

a42df8e#commitcomment-29282798

I just stumbled across this code today and it's awesome. Thanks so much for your work that you put into this. However, I think i have uncovered a bug given certain scenarios using get positions and get orders. I am getting the following error : "Robinhood API request failed. 404: (line 107)"
Using google's debug tools, it looks like it's failing on a ticker that no longer exists.
For example, I used to own a position in RPRX which no longer exists in robinhood. This is causing robinhood_get_positions() and robinhood_get_orders() to error. Other functions like robinhood_get_portfolios() are working fine for me.
Unfortunately, that's about the best I can help. I'm not a good enough coder to fix it, but I was wondering if you or someone else had an easy fix to the code to skip over tickers that don't exist.

Creates new sheet called 'Refresh', cells keep moving

Just wanted a cell that'd display the full balance in the account, including cash. Saw no way to pull up that information directly (tried =ROBINHOOD_GET_PORTFOLIOS(equity_portfolios), it displayed all content), so I created a new sheet called RobinHood, put the reference to the full content displayed by ROBINHOOD_GET_PORTFOLIOS, then in my original sheet, I referenced the same cell that contained the value of 'equity_portfolios'. Displayed the desired info, great!

Then I hit refresh in browser to confirm the value updated to the latest balance value. That's when it broke. I saw a new sheet tab called "Refresh" with nothing in it, and when I looked at RobinHood sheet, instead of the function being in A1, it was now at A17. I'm not sure why it's creating new tab or moving the cells around.

dont understand step 6

(As of 1/19/20) Log into Robinhood on the Web to [https://stackoverflow.com/questions/55902967/is-there-any-way-to-get-a-bearer-token-now-since-robinhood-has-changed-the-api/56841942](obtain a device_id) and add it to your payload to get past RH's Oauth flow.

Can't change cell type to allow for manipulation of decimal points

I have the situation where I want the average cost in my excel sheet to display the average cost with a dollar sign down to the hundreds place. Something I think is being implemented preventing me from doing so.

When I have an excel sheet that says =Robinhood!BX2 it responds with 1.2345 but would like it to say $1.23. I changed the cell type to currency, and used the decimal format button (.0<--) and yet nothing changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.