Closed aixuedegege closed 7 months ago
Your code doesn't work:
NameError: name 'start' is not defined
It does look like the code is being blocked. You can get a Yahoo finance API and run that
import requests
url = "https://yahoo-finance15.p.rapidapi.com/api/v1/markets/options"
querystring = {"ticker":"CVX"}
headers = { "X-RapidAPI-Key": "REDACTED", "X-RapidAPI-Host": "yahoo-finance15.p.rapidapi.com" }
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
Your code doesn't work:
NameError: name 'start' is not defined
sorry, i forgot it, you can define it by:
start='2023-12-11', end='2023-12-12'
It does look like the code is being blocked. You can get a Yahoo finance API and run that import requests
url = "https://yahoo-finance15.p.rapidapi.com/api/v1/markets/options"
querystring = {"ticker":"CVX"}
headers = { "X-RapidAPI-Key": "REDACTED", "X-RapidAPI-Host": "yahoo-finance15.p.rapidapi.com" }
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
thank you ! but where should i get the information about "CVX"?
The information about the stock is returned in the json file, and you have to extract it... You can log onto rapidapi and get your own api for free. https://rapidapi.com/sparior/api/yahoo-finance15/pricing
ok thks a lot
@JennyCon You should remove or mask the API key when you post that.
@JennyCon You should remove or mask the API key when you post that.
I've removed it.
Thanks!!!
Dr. Jennifer I Considine
221A Casale Place
Canmore, AB
Canada
403 807 6894
[University of Dundee shield logo]http://uod.ac.uk/sig-home
Jennifer Considine Senior Research Fellow School of Social Sciences, University of Dundee @.*** | +44(0)1382 384300<mailto:+44(0)1382%20384300>
[University of Dundee Facebook]http://uod.ac.uk/sig-fb [University of Dundee Twitter] http://uod.ac.uk/sig-tw [University of Dundee LinkedIn] http://uod.ac.uk/sig-li [University of Dundee YouTube] http://uod.ac.uk/sig-yt [University of Dundee Instagram] http://uod.ac.uk/sig-ig [University of Dundee Snapchat] http://uod.ac.uk/sig-sc We're Scottish University of the Year again!http://uod.ac.uk/sig-strapline The Times / Sunday Times Good University Guide 2016 and 2017
From: ValueRaider @.> Sent: April 15, 2024 7:42 AM To: ranaroussi/yfinance @.> Cc: JennyCon @.>; Mention @.> Subject: Re: [ranaroussi/yfinance] how to download CVOL-USD data (Issue #1902)
CAUTION: This email originated from outside the University of Dundee. Do not click links or open attachments unless you recognise the sender's email address and know the content is safe.
@JennyConhttps://github.com/JennyCon You should remove or mask the API key when you post that.
I've removed it.
— Reply to this email directly, view it on GitHubhttps://github.com/ranaroussi/yfinance/issues/1902#issuecomment-2056891561, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5OKTM5IO5D73OTZCFIDESDY5PKL5AVCNFSM6AAAAABF7T3DFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJWHA4TCNJWGE. You are receiving this because you were mentioned.Message ID: @.***>
The University of Dundee is a registered Scottish Charity, No: SC015096
Can I download CVOL data from this link? https://finance.yahoo.com/quote/CVOL-USD/ I hava tried this code:
but i got Exception('%ticker%: No price data found, symbol may be delisted ?