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

#!/usr/bin/python3
import requests

tic = "ibm.us"
url = "https://stooq.com/q/l/?f=sd2t2ohlcv&h&e=csv&s=" + 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:
Symbol,Date,Time,Open,High,Low,Close,Volume IBM.US,2019-05-23,22:02:00,135,135.13,130.44,132.39,5343437
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