Skip to content

Instantly share code, notes, and snippets.

@konstantinfarrell
Last active June 14, 2016 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konstantinfarrell/5855403cdf8e5e1e228404ea0164aa17 to your computer and use it in GitHub Desktop.
Save konstantinfarrell/5855403cdf8e5e1e228404ea0164aa17 to your computer and use it in GitHub Desktop.
Query a stock symbol with the python requests library
import requests
API_URL="http://finance.yahoo.com/d/quotes.csv"
symbol="AMZN"
params="sopc"
querystring = API_URL + "?s=" + symbol + "&f=" + params
result = requests.get(querystring)
print(result.text)
# for more info on params
# https://ilmusaham.wordpress.com/tag/stock-yahoo-data/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment