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.
56
+
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)
57
+
58
+
## Launchpad
59
+
Users of the Launchpad product will need to pass in certain headers in order to make API requests using the RequestOptionBuilder.
21
60
Example can be found [here](./examples/launchpad).
22
61
62
+
Import classes
63
+
```python
64
+
from polygon import RESTClient
65
+
from polygon.rest.models.request import RequestOptionBuilder
66
+
```
67
+
### Using the client
68
+
Create client and set options
69
+
```python
70
+
# create client
71
+
c = RESTClient(api_key="API_KEY")
72
+
73
+
# create request options
74
+
options = RequestOptionBuilder().edge_headers(
75
+
edge_id="YOUR_EDGE_ID", # required
76
+
edge_ip_address="IP_ADDRESS", # required
77
+
)
78
+
```
79
+
Request data using client methods.
80
+
```python
81
+
# get response
82
+
res = c.get_aggs("AAPL", 1, "day", "2022-04-04", "2022-04-04", options=options)
83
+
84
+
# do something with response
85
+
```
86
+
Checkout Launchpad readme for more details on RequestOptionBuilder [here](./examples/launchpad)
87
+
88
+
## WebSocket Client
89
+
90
+
Import classes
91
+
```python
92
+
from polygon import WebSocketClient
93
+
from polygon.websocket.models import WebSocketMessage
94
+
from typing import List
95
+
```
96
+
### Using the client
97
+
Create a new client with your [API key](https://polygon.io/dashboard/api-keys) and subscription options.
98
+
```python
99
+
# Note: Multiple subscriptions can be added to the array
100
+
# For example, if you want to subscribe to AAPL and META,
101
+
# you can do so by adding "T.META" to the subscriptions array. ["T.AAPL", "T.META"]
102
+
# If you want to subscribe to all tickers, place an asterisk in place of the symbol. ["T.*"]
0 commit comments