This is a simple app to build an option chain using IBKR Web API, via ibind client which handles OAuth.
Secret files are pre-made and store locally. No user login is required.
-
Install the required dependencies:
pip install ibind
-
Configure the API client:
- Update the
config.pyfile with your API base URL and authentication token.
- Update the
-
Run the main script:
python src/infrastructure/option_chain_app/main.py
-
The script will retrieve option chain data for the specified symbol (default: "SPX") and save to a PostgreSQL database in a docker container.
-
docker run -d --name options-db-container -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_DB=options_db -p 5432:5432 postgre
https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/#option-chain
Trying to find out if httpx can improve retrieval time from IBKR Web API.