Yahoo Finance V7 API jetzt benötigt Kekse? (Python)Python

Python-Programme
Anonymous
 Yahoo Finance V7 API jetzt benötigt Kekse? (Python)

Post by Anonymous »

Code: Select all

url = 'https://query2.finance.yahoo.com/v7/finance/quote?symbols=TSLA&fields=regularMarketPreviousClose&region=US&lang=en-US'
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36'
}
data = requests.get(url,headers=headers)
prepost_data = data.json()
< /code>
Es scheint, dass Yahoo Finance ihre V7 -API so geändert hat, dass sie für jede Anfrage Cookies benötigt. Ausführen des obigen Code{"finance":{"result":null,"error":{"code":"Unauthorized","description":"Invalid Crumb"}}}

Dieses Problem scheint auch in diesem Github Repo bekannt zu sein: https://github.com/joshuaulrich/quantmo ... /tsues/p.p>
Sie scheinen ein Patch zu haben, das funktioniert: https://github.com/joshuaulrich/quantmo ... 83/commits
Aber der Code ist alles in r ... jemand weiß, wie man das in Python übersetzt?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post