Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exchange Quotes
#3
Quotes from alphavantage.co:

#!/usr/bin/python3
import requests
key = "xxxxxxxxx" # key is free (5 requests per minute, 500 requests per day)

tic = "ibm"
url = "https://www.alphavantage.co/query?apikey="+key+"&function=TIME_SERIES_DAILY&symbol="+ tic

rsp = requests.get(url)
if rsp.status_code in (200,):
    ustr = rsp.text.strip()
    print(ustr)
else:
    print("ERROR:", rsp.status_code)
    print(rsp.text)
Output:
{ "Meta Data": { "1. Information": "Daily Prices (open, high, low, close) and Volumes", "2. Symbol": "ibm", "3. Last Refreshed": "2019-05-23", "4. Output Size": "Compact", "5. Time Zone": "US/Eastern" }, "Time Series (Daily)": { "2019-05-23": { "1. open": "135.1300", "2. high": "135.1300", "3. low": "130.4400", "4. close": "132.3900", "5. volume": "5342570" }, "2019-05-22": { "1. open": "136.0000", "2. high": "136.7500", "3. low": "135.7116", "4. close": "136.3500", "5. volume": "1849821" }, "2019-05-21": { "1. open": "136.1200", "2. high": "137.0600", "3. low": "135.7900", "4. close": "136.4500", "5. volume": "2503504" } } }
Reply


Messages In This Thread
Exchange Quotes - by heiner55 - May-24-2019, 06:34 AM
RE: Exchange Quotes - by heiner55 - May-24-2019, 11:14 AM
RE: Exchange Quotes - by heiner55 - May-24-2019, 12:41 PM
RE: Exchange Quotes - by heiner55 - May-26-2019, 04:27 AM
RE: Exchange Quotes - by OstermanA - May-26-2019, 07:58 AM
RE: Exchange Quotes - by heiner55 - May-26-2019, 08:10 AM
RE: Exchange Quotes - by snippsat - May-26-2019, 05:04 PM
RE: Exchange Quotes - by heiner55 - May-26-2019, 05:13 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020