client-js
client-js copied to clipboard
`options.snapshotOptionContract` and `reference.optionsContract` are not working, returning empty array.
The polygon.options.snapshotOptionContract
always returns an empty array.
const polygonResults = await polygon.options.snapshotOptionContract('SPY', 'O:SPY240426C00517000');
// {
// "results": [],
// "status": "OK",
// "request_id": "06deb361223937c365ebae0b41320f63",
// "count": 0,
// "next_url": null
// }
Expected behavior: polygonResults.results
should be an object containing the snapshot of the option (docs)
Running this endpoint on the docs website works fine.
https://api.polygon.io/v3/snapshot/options/SPY/O:SPY240426C00517000?apiKey=API_KEY
// {
// "results": {
// "day": {
// "change": 0.09,
// "change_percent": 150,
// ...
Thanks for reporting @Finalet. Looking into this now.
Same happens to the polygon.reference.optionsContract
endpoint.
const polygonOption = await polygon.reference.optionsContract(`O:AMZN240426C00187500`);
// {
// "results": [],
// "status": "OK",
// "request_id": "9a19fd532fb7b297eb8188c87b4d6529",
// "count": 0,
// "next_url": null
// }
Calling the endpoint directly and on the docs website works fine.
https://api.polygon.io/v3/reference/options/contracts/O:AMZN240426C00187500?apiKey=API_KEY
// {
// "results": {
// "cfi": "OCASPS",
// "contract_type": "call",
// "exercise_style": "american",
// ...