I program in C#. Do Alpaca Nuget packages (basic and/or extensions) provide an option symbol generator function? If so, can you please describe the function and its parameters. I am mostly interested in SPY at the money option symbols for monthly options.
@ptrader Option symbols cannot exactly be “generated”. The recommended approach to get option symbols is to use the get option contracts end point. Documentation can be found here. Something like this to fetch all active SPY options. You may need to page the results if there are more than 10,000.
https://paper-api.alpaca.markets/v2/options/contracts?underlying_symbols=SPY&status=active&expiration_date_lte=2030-01-01&limit=10000
The response is a record similar to below for each contract.
{
"option_contracts": [
{
"id": "7920f71c-2c5c-4348-bdd7-950a9ac8786d",
"symbol": "SPY260203C00500000",
"name": "SPY Feb 03 2026 500 Call",
"status": "active",
"tradable": true,
"expiration_date": "2026-02-03",
"root_symbol": "SPY",
"underlying_symbol": "SPY",
"underlying_asset_id": "b28f4066-5c6d-479b-a2af-85dc1a8f16fb",
"type": "call",
"style": "american",
"strike_price": "500",
"multiplier": "100",
"size": "100",
"open_interest": "10",
"open_interest_date": "2026-01-30",
"close_price": "182.48",
"close_price_date": "2026-01-21",
"ppind": true
},
You can then use the expiration_date field to filter locally for monthly options. You would then need to separately fetch the current price of the underlying equity SPY and compare that to the strike_price field to determine which contracts are at-the-money.
Thank you for your detailed reply!