polygon-io / issues

Quickly track and report problems with polygon.io
29 stars 0 forks source link

Pagination issue with option snapshot API #237

Closed yongqli closed 1 year ago

yongqli commented 1 year ago

URL https://api.polygon.io/v3/snapshot/options/SPX?expiration_date=2023-03-10&limit=250

Result Extra results for other expiries are returned in subsequent pages.

Expected Result Only the 2023-03-10 expiry is returned.

jrbell19 commented 1 year ago

@yongqli Because you've passed in the ?expiration_date= parameter with 2023-03-10 set, the results returned will only be for contracts with that expiration date.

If you're looking for all the contracts after that date, you could pass in the .gte extension and the sort parameter to paginate through additional expiration dates. Here's an example:

https://api.polygon.io/v3/snapshot/options/SPX?expiration_date.gte=2023-03-10&sort=expiration_date&apiKey=*

jrbell19 commented 1 year ago

i've realized that I misunderstood the issue here. This is a known issue, and something that we are currently working to address. Apologies for the confusion.

I will circle back once this is resolved

jrbell19 commented 1 year ago

This should be resolved now. Please let us know if you continue to have trouble.