Open bman393 opened 3 months ago
Please add the logs (instead of attaching them) in a code block.
Passing client fetch log:
`schwab-api version 0.0.0a29 Loading token from file /mnt/c/Users/Brogan/Documents/tickerStats/schwab-py/token.json Req 1: GET to https://api.schwabapi.com/marketdata/v1/$SPX/quotes, params={} Req 1: GET response: 200, content={"$SPX":{"assetMainType":"INDEX","realtime":true,"ssid":1819771877,"symbol":"$SPX","fundamental":{"avg10DaysVolume":0.0,"avg1YearVolume":0.0,"divAmount":0.0,"divFreq":0,"divPayAmount":0.0,"divYield":0.0,"eps":0.0,"fundLeverageFactor":0.0,"peRatio":0.0},"quote":{"52WeekHigh":5325.49,"52WeekLow":4103.78,"closePrice":5308.13,"highPrice":5324.32,"lastPrice":5321.41,"lowPrice":5297.87,"netChange":13.28,"netPercentChange":0.25018227,"openPrice":5298.69,"securityStatus":"Closed","totalVolume":1974738504,"tradeTime":1716325754901},"reference":{"description":"S\u0026P 500 INDEX","exchange":"0","exchangeName":"Index"}}} {'$SPX': {'assetMainType': 'INDEX', 'realtime': True, 'ssid': 1819771877, 'symbol': '$SPX', 'fundamental': {'avg10DaysVolume': 0.0, 'avg1YearVolume': 0.0, 'divAmount': 0.0, 'divFreq': 0, 'divPayAmount': 0.0, 'divYield': 0.0, 'eps': 0.0, 'fundLeverageFactor': 0.0, 'peRatio': 0.0}, 'quote': {'52WeekHigh': 5325.49, '52WeekLow': 4103.78, 'closePrice': 5308.13, 'highPrice': 5324.32, 'lastPrice': 5321.41, 'lowPrice': 5297.87, 'netChange': 13.28, 'netPercentChange': 0.25018227, 'openPrice': 5298.69, 'securityStatus': 'Closed', 'totalVolume': 1974738504, 'tradeTime': 1716325754901}, 'reference': {'description': 'S&P 500 INDEX', 'exchange': '0', 'exchangeName': 'Index'}}}
[debug.py:151:_enable_bug_report_logging] schwab-api version 0.0.0a29 [auth.py:36:load_token] Loading token from file /mnt/c/Users/Brogan/Documents/tickerStats/schwab-py/token.json [synchronous.py:17:_get_request] Req 1: GET to https://api.schwabapi.com/marketdata/v1/$SPX/quotes, params={} [base.py:64:_log_response] Req 1: GET response: 200, content={"$SPX":{"assetMainType":"INDEX","realtime":true,"ssid":1819771877,"symbol":"$SPX","fundamental":{"avg10DaysVolume":0.0,"avg1YearVolume":0.0,"divAmount":0.0,"divFreq":0,"divPayAmount":0.0,"divYield":0.0,"eps":0.0,"fundLeverageFactor":0.0,"peRatio":0.0},"quote":{"52WeekHigh":5325.49,"52WeekLow":4103.78,"closePrice":5308.13,"highPrice":5324.32,"lastPrice":5321.41,"lowPrice":5297.87,"netChange":13.28,"netPercentChange":0.25018227,"openPrice":5298.69,"securityStatus":"Closed","totalVolume":1974738504,"tradeTime":1716325754901},"reference":{"description":"S\u0026P 500 INDEX","exchange":"0","exchangeName":"Index"}}}`
Failing client fetch log:
`schwab-api version 0.0.0a29
Loading token from file token.json
Req 1: GET to https://api.schwabapi.com/marketdata/v1/$SPX/quotes, params={}
Traceback (most recent call last):
File "get_quote.py", line 27, in
[debug.py:151:_enable_bug_report_logging] schwab-api version 0.0.0a29 [auth.py:36:load_token] Loading token from file token.json [synchronous.py:17:_get_request] Req 1: GET to https://api.schwabapi.com/marketdata/v1/$SPX/quotes, params={}`
Wait a second, this is the wrong repo... Can you re-enter your ticket on the new library? https://github.com/alexgolec/schwab-py/issues
oh shoot, yes let me do that
Description of Bug I created my token with client_from_manual_flow, all my inputs are correct. It then only gives me a expires_in token of 1800 (30 min).
Then I use schwab.auth.client_from_token_file to create my client which is also suppose to refresh my token as well right? But my token still expires on the first set 30 min
My token file exists on the same level as the code I am using to grab quotes. Here is my code:
`from schwab.auth import client_from_manual_flow
api_key='', app_secret='', callback_url='https://127.0.0.1', token_path='/mnt/c/Users/Brogan/Documents/tickerStats/schwab-py/token.json'
def getPrice(ticker):
getPrice('$SPX')`
Expected Behavior I expect the access token to update to a new expire time.
Actual Behavior Instead, the token still expires at my original set time from the manual token creation. I have to manually create the token every 30 min to access schwab
Error/Exception Log, If Applicable log.txt