Class: SnapTrade::OptionsApi
- Inherits:
-
Object
- Object
- SnapTrade::OptionsApi
- Defined in:
- lib/snaptrade/api/options_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_options_chain(user_id:, user_secret:, account_id:, symbol:, extra: {}) ⇒ Object
Get the options chain for a symbol.
-
#get_options_chain_with_http_info(user_id:, user_secret:, account_id:, symbol:, extra: {}) ⇒ Object
Get the options chain for a symbol.
-
#initialize(api_client = ApiClient.default) ⇒ OptionsApi
constructor
A new instance of OptionsApi.
-
#list_option_holdings(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object
List account option positions.
-
#list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object
List account option positions.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ OptionsApi
Returns a new instance of OptionsApi.
16 17 18 |
# File 'lib/snaptrade/api/options_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/snaptrade/api/options_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#get_options_chain(user_id:, user_secret:, account_id:, symbol:, extra: {}) ⇒ Object
Get the options chain for a symbol
Returns the option chain for the specified symbol in the specified account.
29 30 31 32 |
# File 'lib/snaptrade/api/options_api.rb', line 29 def (user_id:, user_secret:, account_id:, symbol:, extra: {}) data, _status_code, _headers = (user_id, user_secret, account_id, symbol, extra) data end |
#get_options_chain_with_http_info(user_id:, user_secret:, account_id:, symbol:, extra: {}) ⇒ Object
Get the options chain for a symbol
Returns the option chain for the specified symbol in the specified account.
43 44 45 |
# File 'lib/snaptrade/api/options_api.rb', line 43 def (user_id:, user_secret:, account_id:, symbol:, extra: {}) (user_id, user_secret, account_id, symbol, extra) end |
#list_option_holdings(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object
List account option positions
Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions).
Check your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
144 145 146 147 |
# File 'lib/snaptrade/api/options_api.rb', line 144 def list_option_holdings(user_id:, user_secret:, account_id:, extra: {}) data, _status_code, _headers = list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, extra) data end |
#list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object
List account option positions
Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions).
Check your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
161 162 163 |
# File 'lib/snaptrade/api/options_api.rb', line 161 def list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, extra: {}) list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, extra) end |