DOCN options

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-11-26 23:31:12 -06:00
parent 45191cbf84
commit c6912cfbf2
2 changed files with 35 additions and 1 deletions

View File

@ -1,13 +1,16 @@
# check out this: https://github.com/intrinio/python-sdk.git
# then run: python setup.py install --user
docn-stock-price:
docn-stock-price-history:
./stock_prices-DOCN.py
# ./stock_prices-DOCN.py > DOCN-last-90DAYS.txt
docn-insiders:
./DOCN-institutional-trans.py
docn-options:
./getOptionsDOCN.py
install:
python setup.py install --user
# pip install intrinio-sdk

31
getOptionsDOCN.py Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/python3
from __future__ import print_function
import time
import intrinio_sdk
from intrinio_sdk.rest import ApiException
from pprint import pprint
intrinio_sdk.ApiClient().configuration.api_key['api_key'] = 'OjZjZGIzZmYyNDg4NDZjYjQ4NzAzMzAyZjg0OTU5MDcz'
options_api = intrinio_sdk.OptionsApi()
symbol = 'DOCN' # str | The option symbol, corresponding to the underlying security.
type = 'put' # str | The option contract type. (optional)
try:
api_response = options_api.get_options(symbol, type=type)
options = api_response.options
print("%s options found for %s!" % (len(options), symbol))
for option in options:
print("")
print("ID: %s" % (option.id))
print("Code: %s" % (option.code))
print("Ticker: %s" % (option.ticker))
print("Expiration: %s" % (option.expiration))
print("Strike: %s" % (option.strike))
print("Type: %s" % (option.type))
except ApiException as e:
print("Exception when calling OptionsApi->get_options: %s\n" % e)