You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: For parameter argument examples check out our docs. All required arguments are annotated with red asterisks " * " and argument examples are set.
60
-
Check out an example for Aggregates(client.get_aggs) [here](https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__range__multiplier___timespan___from___to)
59
+
60
+
### Additional Filter Parameters
61
+
62
+
Many of the APIs in this client library support the use of additional filter parameters to refine your queries. Please refer to the specific API documentation for details on which filter parameters are supported for each endpoint. These filters can be applied using the following operators:
63
+
64
+
-`.gt`: greater than
65
+
-`.gte`: greater than or equal to
66
+
-`.lt`: less than
67
+
-`.lte`: less than or equal to
68
+
69
+
Here's a sample code snippet that demonstrates how to use these filter parameters when requesting an Options Chain using the `list_snapshot_options_chain` method. In this example, the filter parameters ensure that the returned options chain data will only include options with an expiration date that is greater than or equal to "2024-03-16" and a strike price that falls between 29 and 30 (inclusive).
70
+
71
+
```python
72
+
options_chain = []
73
+
for o in client.list_snapshot_options_chain(
74
+
"HCP",
75
+
params={
76
+
"expiration_date.gte": "2024-03-16",
77
+
"strike_price.gte": 29,
78
+
"strike_price.lte": 30,
79
+
},
80
+
):
81
+
options_chain.append(o)
82
+
83
+
print(options_chain)
84
+
print(len(options_chain))
85
+
```
86
+
87
+
Also, please refer to the API documentation to get a full understanding of how the API works and the supported arguments. All required arguments are annotated with red asterisks " * " and argument examples are set.
0 commit comments