parent
45191cbf84
commit
c6912cfbf2
5
Makefile
5
Makefile
|
@ -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
|
||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue