A (very) minimal wrapper around the yfinance library for use as a self-hosted API, using FastAPI. Currently, only querying the current market price is supported.
Basic request authentication consists of api key verification, where api keys are listed, delimited by ':' in the environment variable YFI_API_KEY
on server startup.
Server startup:
YFI_API_KEY='foo:bar' python server.py --cache-ttl 60
Query:
$ curl http://127.0.0.1:8080/quote/vti?token=foo
223.88