Skip to content

Instantly share code, notes, and snippets.

@akhan118
Created July 27, 2018 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save akhan118/0daf12fbc5ffb7e9fb5c4cb02e5271ba to your computer and use it in GitHub Desktop.
Save akhan118/0daf12fbc5ffb7e9fb5c4cb02e5271ba to your computer and use it in GitHub Desktop.
Get Quote
def get_quotes(self,symbol):
access_token = self.get_access_token().json()
access_token = access_token['access_token']
headers={'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer {}'.format(access_token)}
data = { 'symbol': symbol, 'apikey': self.apikey}
authReply = requests.get('https://api.tdameritrade.com/v1/marketdata/quotes',
headers=headers, params=data)
# print(authReply)
return (authReply.json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment