Skip to content

Commit

Permalink
Merge pull request #460 from NelsonDane/master
Browse files Browse the repository at this point in the history
Allow Get All Account Profile Info (Including IRA Numbers)
  • Loading branch information
jmfernandes authored May 11, 2024
2 parents b4a5172 + f490a2e commit cec0854
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions robin_stocks/robinhood/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@


@login_required
def load_account_profile(account_number=None, info=None):
def load_account_profile(account_number=None, info=None, dataType="indexzero"):
"""Gets the information associated with the accounts profile,including day
trading information and cash being held by Robinhood.
:param acccount_number: the robinhood account number.
:type acccount_number: Optional[str]
:param info: The name of the key whose value is to be returned from the function.
:type info: Optional[str]
:param dataType: Determines how to filter the data. 'regular' returns the unfiltered data. \
'results' will return data['results']. 'pagination' will return data['results'] and append it with any \
data that is in data['next']. 'indexzero' will return data['results'][0].
:type dataType: Optional[str]
:returns: The function returns a dictionary of key/value pairs. \
If a string is passed in to the info parameter, then the function will return \
a string corresponding to the value of the key whose name matches the info parameter.
Expand Down Expand Up @@ -65,7 +69,7 @@ def load_account_profile(account_number=None, info=None):
if account_number is not None:
data = request_get(url)
else:
data = request_get(url, 'indexzero')
data = request_get(url, dataType)
return(filter_data(data, info))


Expand Down
2 changes: 1 addition & 1 deletion robin_stocks/robinhood/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def account_profile_url(account_number=None):
if account_number:
return('https://api.robinhood.com/accounts/'+account_number)
else:
return('https://api.robinhood.com/accounts/')
return('https://api.robinhood.com/accounts/?default_to_all_accounts=true')


def basic_profile_url():
Expand Down

0 comments on commit cec0854

Please sign in to comment.