Update main.py
Browse files
main.py
CHANGED
|
@@ -44,7 +44,7 @@ async def get_stocks_data(ticker: str, intervals: int, days: int):
|
|
| 44 |
@app.get('/chain')
|
| 45 |
async def get_stocks_data(ticker: str):
|
| 46 |
try:
|
| 47 |
-
response = fetcher.fetch_option_chain(ticker).to_dict(orient="records")
|
| 48 |
return {"data" : response}
|
| 49 |
except:
|
| 50 |
return {"Timeout" : "Error"}
|
|
@@ -57,21 +57,21 @@ async def get_stocks_data(ticker: str):
|
|
| 57 |
except:
|
| 58 |
return {"Timeout" : "Error"}
|
| 59 |
|
| 60 |
-
@app.get('/news')
|
| 61 |
-
async def get_stocks_data(ticker: str, page: int, size: int):
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
|
| 68 |
-
@app.get('/all')
|
| 69 |
-
async def get_stocks_data():
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
|
| 76 |
@app.get('/signal')
|
| 77 |
async def get_stocks_data(index: str):
|
|
|
|
| 44 |
@app.get('/chain')
|
| 45 |
async def get_stocks_data(ticker: str):
|
| 46 |
try:
|
| 47 |
+
response, exp = fetcher.fetch_option_chain(ticker).to_dict(orient="records")
|
| 48 |
return {"data" : response}
|
| 49 |
except:
|
| 50 |
return {"Timeout" : "Error"}
|
|
|
|
| 57 |
except:
|
| 58 |
return {"Timeout" : "Error"}
|
| 59 |
|
| 60 |
+
# @app.get('/news')
|
| 61 |
+
# async def get_stocks_data(ticker: str, page: int, size: int):
|
| 62 |
+
# try:
|
| 63 |
+
# response = fetcher.fetch_stock_news(ticker, page=page, size=size).to_dict(orient="records")
|
| 64 |
+
# return {"data" : response}
|
| 65 |
+
# except:
|
| 66 |
+
# return {"Timeout" : "Error"}
|
| 67 |
|
| 68 |
+
# @app.get('/all')
|
| 69 |
+
# async def get_stocks_data():
|
| 70 |
+
# try:
|
| 71 |
+
# response = fetcher.fetch_all_stock().to_dict(orient="records")
|
| 72 |
+
# return {"data" : response}
|
| 73 |
+
# except:
|
| 74 |
+
# return {"Timeout" : "Error"}
|
| 75 |
|
| 76 |
@app.get('/signal')
|
| 77 |
async def get_stocks_data(index: str):
|