Giter Site home page Giter Site logo

polygon-io / client-go Goto Github PK

View Code? Open in Web Editor NEW
127.0 14.0 35.0 1.44 MB

The official Go client library for the Polygon REST and WebSocket API.

License: MIT License

Makefile 0.66% Go 99.34%
crypto-trading forex-trading go golang options-trading rest-api stocks-api realtime-stocks stock-data stock-market trading

client-go's Introduction

Polygon Go Client

Coverage

docs Build Go Report Card

The official Go client library for the Polygon REST and WebSocket API. This client makes use of Go generics and thus requires Go 1.18. See the docs for more details on our API.

Getting Started

This section guides you through setting up a simple project with polygon-io/client-go.

First, make a new directory for your project and navigate into it:

mkdir myproject && cd myproject

Next, initialize a new module for dependency management. This creates a go.mod file to track your dependencies:

go mod init example

Then, create a main.go file. For quick start, you can find over 100+ example code snippets that demonstrate connecting to both the REST and WebSocket APIs. Here's an example that fetches the last trade for AAPL.

cat > main.go <<EOF
// Stocks - Last Trade
// https://polygon.io/docs/stocks/get_v2_last_trade__stocksticker
// https://github.com/polygon-io/client-go/blob/master/rest/trades.go
package main

import (
	"context"
	"log"
	"os"

	polygon "github.com/polygon-io/client-go/rest"
	"github.com/polygon-io/client-go/rest/models"
)

func main() {

	// init client
	c := polygon.New(os.Getenv("POLYGON_API_KEY"))

	// set params
	params := &models.GetLastTradeParams{
		Ticker: "AAPL",
	}

	// make request
	res, err := c.GetLastTrade(context.Background(), params)
	if err != nil {
		log.Fatal(err)
	}

	// do something with the result
	log.Print(res)

}
EOF

Please remember to set your Polygon API key, which you can find on the polygon.io dashboard, in the environment variable POLYGON_API_KEY. Or, as a less secure option, by hardcoding it in your code. But please note that hardcoding the API key can be risky if your code is shared or exposed. You can configure the environment variable by running:

export POLYGON_API_KEY="<your_api_key>"        <- mac/linux
xset POLYGON_API_KEY "<your_api_key>"          <- windows

Then, run go mod tidy to automatically download and install the necessary dependencies. This command ensures your go.mod file reflects all dependencies used in your project:

go mod tidy

Finally, execute your application:

go run main.go

REST API Client

rest-docs

To get started, you'll need to import two main packages.

import (
	polygon "github.com/polygon-io/client-go/rest"
	"github.com/polygon-io/client-go/rest/models"
)

Next, create a new client with your API key.

c := polygon.New("YOUR_API_KEY")

Or create a client with a custom HTTP client implementation.

hc := http.Client{} // some custom HTTP client
c := polygon.NewWithClient("YOUR_API_KEY", hc)

Using the client

After creating the client, making calls to the Polygon API is simple.

params := models.GetTickerDetailsParams{
    Ticker: "AAPL",
}.WithDate(models.Date(time.Date(2021, 7, 22, 0, 0, 0, 0, time.Local)))

res, err := c.GetTickerDetails(context.Background(), params)
if err != nil {
    log.Fatal(err)
}
log.Print(res) // do something with the result

Pagination

Our list methods return iterators that handle pagination for you.

// create a new iterator
params := models.ListTradesParams{Ticker: "AAPL"}.
    WithTimestamp(models.GTE, models.Nanos(time.Date(2021, 7, 22, 0, 0, 0, 0, time.UTC))).
    WithOrder(models.Asc)
iter := c.ListTrades(context.Background(), params)

// iter.Next() advances the iterator to the next value in the list
for iter.Next() {
    log.Print(iter.Item()) // do something with the current value
}

// if the loop breaks, it has either reached the end of the list or an error has occurred
// you can check if something went wrong with iter.Err()
if iter.Err() != nil {
    log.Fatal(iter.Err())
}

We also provide a builder method to make it easier to retrieve all trades and quotes for a specific day.

params := models.ListQuotesParams{Ticker: "AAPL"}.
    WithDay(2021, 7, 22). // get all quotes for July 22, 2021
    WithOrder(models.Asc)
iter := c.ListQuotes(context.Background(), params)

for iter.Next() {
    log.Print(iter.Item())
}
if iter.Err() != nil {
    log.Fatal(iter.Err())
}

Request options

Advanced users may want to add additional headers or query params to a given request.

params := &models.GetGroupedDailyAggsParams{
    Locale:     models.US,
    MarketType: models.Stocks,
    Date:       models.Date(time.Date(2021, 7, 22, 0, 0, 0, 0, time.Local)),
}

res, err := c.GetGroupedDailyAggs(context.Background(), params,
    models.APIKey("YOUR_OTHER_API_KEY"),
    models.Header("X-CUSTOM-HEADER", "VALUE"),
    models.QueryParam("adjusted", strconv.FormatBool(true)))
if err != nil {
    log.Fatal(err)
}
log.Print(res) // do something with the result

Launchpad Usage

Users of the Launchpad product will need to pass in certain headers in order to make API requests. Example can be found here.

Debugging

Sometimes you may find it useful to see the actual request and response details while working with the API. The client allows for this through its models.WithTrace(true) option.

How to Enable Debug Mode

You can activate the debug mode per request as follows by adding models.WithTrace(true) after the params:

iter := c.ListAggs(context.Background(), params, models.WithTrace(true))

What Does Debug Mode Do?

When debug mode is enabled, the client will print out useful debugging information for each API request. This includes: the request URL, the headers sent in the request, and the headers received in the response.

Example Output

For instance, if you made a request for TSLA data for the date 2023-08-01, you would see debug output similar to the following:

Request URL: /v2/aggs/ticker/AAPL/range/1/day/1672531200000/1678320000000?adjusted=true&limit=50000&sort=desc
Request Headers: map[Accept-Encoding:[gzip] Authorization:[REDACTED] User-Agent:[Polygon.io GoClient/v1.14.1]]
Response Headers: map[Content-Encoding:[gzip] Content-Length:[1639] Content-Type:[application/json] Date:[Tue, 05 Sep 2023 23:25:00 GMT] Server:[nginx/1.19.2] Strict-Transport-Security:[max-age=15724800; includeSubDomains] Vary:[Accept-Encoding] X-Request-Id:[ba3d3e9f42622bd16d05dafe01200f72]]

This can be an invaluable tool for debugging issues or understanding how the client interacts with the API.

WebSocket Client

ws-docs

Import the WebSocket client and models packages to get started.

import (
    polygonws "github.com/polygon-io/client-go/websocket"
    "github.com/polygon-io/client-go/websocket/models"
)

Next, create a new client with your API key and a couple other config options.

// create a new client
c, err := polygonws.New(polygonws.Config{
    APIKey:    "YOUR_API_KEY",
    Feed:      polygonws.RealTime,
    Market:    polygonws.Stocks,
})
if err != nil {
    log.Fatal(err)
}
defer c.Close() // the user of this client must close it

// connect to the server
if err := c.Connect(); err != nil {
    log.Error(err)
    return
}

The client automatically reconnects to the server when the connection is dropped. By default, it will attempt to reconnect indefinitely but the number of retries is configurable. When the client successfully reconnects, it automatically resubscribes to any topics that were set before the disconnect.

Using the client

After creating a client, subscribe to one or more topics and start accessing data. Currently, all of the data is pushed to a single output channel.

// passing a topic by itself will subscribe to all tickers
if err := c.Subscribe(polygonws.StocksSecAggs); err != nil {
    log.Fatal(err)
}
if err := c.Subscribe(polygonws.StocksTrades, "TSLA", "GME"); err != nil {
    log.Fatal(err)
}

for {
    select {
    case err := <-c.Error(): // check for any fatal errors (e.g. auth failed)
        log.Fatal(err)
    case out, more := <-c.Output(): // read the next data message
        if !more {
            return
        }

        switch out.(type) {
        case models.EquityAgg:
            log.Print(out) // do something with the agg
        case models.EquityTrade:
            log.Print(out) // do something with the trade
        }
    }
}

See the full example for more details on how to use this client effectively.

Release planning

This client will attempt to follow the release cadence of our API. When endpoints are deprecated and newer versions are added, the client will maintain two methods in a backwards compatible way (e.g. ListTrades and ListTradesV4(...)). When deprecated endpoints are removed from the API, we'll rename the versioned method (e.g. ListTradesV4(...) -> ListTrades(...)), remove the old method, and release a new major version of the client. The goal is to give users ample time to upgrade to newer versions of our API before we bump the major version of the client, and in general, we'll try to bundle breaking changes like this to avoid frequent major version bumps.

There are a couple exceptions to this. When we find small breaking issues with this client library (e.g. incorrect response types), we may decide to release them under the same major version. These changes will be clearly outlined in the release notes. Also, methods that fall under the VX client are considered experimental and may be modified or deprecated as needed. We'll call out any breaking changes to VX endpoints in our release notes to make using them easier.

Contributing

If you found a bug or have an idea for a new feature, please first discuss it with us by submitting a new issue. We will respond to issues within at most 3 weeks. We're also open to volunteers if you want to submit a PR for any open issues but please discuss it with us beforehand. PRs that aren't linked to an existing issue or discussed with us ahead of time will generally be declined. If you have more general feedback or want to discuss using this client with other users, feel free to reach out on our Slack channel.


client-go's People

Contributors

aitzkovitz avatar antdjohns avatar antewall avatar chaig15 avatar claytonnorthey92 avatar danielatpolygonio avatar darcy-linde avatar dependabot[bot] avatar hunterl avatar jbonzo avatar johnallen avatar justinpolygon avatar lukeoleson avatar mcdayoub avatar morningvera avatar mpatel18 avatar nolotz avatar suremarc avatar syeduguri avatar timetraveler328 avatar umiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

client-go's Issues

Dividend Date as time.Time

Is your feature request related to a problem? Please describe.
The date values from the ListDividend() should be time.Time not string's. Similar to your other APIs like GetAgg()

Describe the solution you'd like
It would be amazing if the type was change from a string to time.Time.

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -3999,6 +3999,15 @@
               ]
             },
             "example": "gainers"
+          },
+          {
+            "name": "include_otc",
+            "in": "query",
+            "description": "Include OTC securities in the response. Default is false (don't include OTC securities).\n",
+            "required": false,
+            "schema": {
+              "type": "boolean"
+            }
           }
         ],
         "responses": {

Client update needed to match websocket.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -423,6 +423,10 @@
                         "e": {
                           "type": "integer",
                           "description": "The timestamp of the ending tick for this aggregate window in Unix Milliseconds."
+                        },
+                        "otc": {
+                          "type": "boolean",
+                          "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                         }
                       }
                     },
@@ -566,6 +570,10 @@
                         "e": {
                           "type": "integer",
                           "description": "The timestamp of the ending tick for this aggregate window in Unix Milliseconds."
+                        },
+                        "otc": {
+                          "type": "boolean",
+                          "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                         }
                       }
                     },
@@ -2348,6 +2356,10 @@
           "e": {
             "type": "integer",
             "description": "The timestamp of the ending tick for this aggregate window in Unix Milliseconds."
+          },
+          "otc": {
+            "type": "boolean",
+            "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
           }
         }
       },
@@ -2417,6 +2429,10 @@
               "e": {
                 "type": "integer",
                 "description": "The timestamp of the ending tick for this aggregate window in Unix Milliseconds."
+              },
+              "otc": {
+                "type": "boolean",
+                "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
               }
             }
           },
@@ -2498,6 +2514,10 @@
               "e": {
                 "type": "integer",
                 "description": "The timestamp of the ending tick for this aggregate window in Unix Milliseconds."
+              },
+              "otc": {
+                "type": "boolean",
+                "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
               }
             }
           },

Examples code seems incorrect

Describe the bug
The example code for some endpoints have invalid code.

To Reproduce
https://github.com/polygon-io/client-go/blob/master/rest/reference.go#L104-L110

Expected behavior

//	iter := c.ListSplits(context.TODO(), params, opts...)
//	for iter.Next() {
//	    log.Print(iter.Item()) // do something with the current value
//	}
//	if iter.Err() != nil {
//	    return iter.Err()
//	}

Current Behavior

//	iter, err := c.ListSplits(context.TODO(), params, opts...)
//	for iter.Next() {
//	    log.Print(iter.Item()) // do something with the current value
//	}
//	if iter.Err() != nil {
//	    return err
//	}

Client update needed to match websocket.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -292,6 +292,14 @@
                       "type": "integer",
                       "description": "The condition."
                     },
+                    "i": {
+                      "type": "array",
+                      "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+                      "items": {
+                        "type": "integer",
+                        "description": "The indicator code.\n"
+                      }
+                    },
                     "t": {
                       "type": "integer",
                       "description": "The Timestamp in Unix MS."
@@ -312,6 +320,9 @@
                   "ap": 114.128,
                   "as": 160,
                   "c": 0,
+                  "i": [
+                    604
+                  ],
                   "t": 1536036818784,
                   "z": 3
                 }
@@ -2282,6 +2293,14 @@
             "type": "integer",
             "description": "The condition."
           },
+          "i": {
+            "type": "array",
+            "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+            "items": {
+              "type": "integer",
+              "description": "The indicator code.\n"
+            }
+          },
           "t": {
             "type": "integer",
             "description": "The Timestamp in Unix MS."

How to keep the connection alive (it keeps dropping regardless of volume)

I followed your websocket example. Performance is great, however, the connection is frequently dropped during trading hours and not because of my client not processing the messages fast enough. What's worse is that the connection drops without an error and the process is just suspended. I tried to implement Gorilla's chat example sending pings and receiving pongs but it didn't work, in fact it appears that the pongs are not returned at all during trading hours.

Any advice on how I can keep the connection alive? Thanks!

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

Client update needed to match websocket.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -292,6 +292,14 @@
                       "type": "integer",
                       "description": "The condition."
                     },
+                    "i": {
+                      "type": "array",
+                      "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+                      "items": {
+                        "type": "integer",
+                        "description": "The indicator code.\n"
+                      }
+                    },
                     "t": {
                       "type": "integer",
                       "description": "The Timestamp in Unix MS."
@@ -312,6 +320,9 @@
                   "ap": 114.128,
                   "as": 160,
                   "c": 0,
+                  "i": [
+                    604
+                  ],
                   "t": 1536036818784,
                   "z": 3
                 }
@@ -2282,6 +2293,14 @@
             "type": "integer",
             "description": "The condition."
           },
+          "i": {
+            "type": "array",
+            "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+            "items": {
+              "type": "integer",
+              "description": "The indicator code.\n"
+            }
+          },
           "t": {
             "type": "integer",
             "description": "The Timestamp in Unix MS."

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

failed to unmarshal MinuteSnapshot accumulated volume

Describe the bug
Sometimes when requesting Snapshot.GetTickerSnapshot we get the following error trying to marshal the MinuteSnapshot struct.
json: cannot unmarshal number 4.578654e+06 into Go struct field MinuteSnapshot.ticker.min.av of type int

To Reproduce
Request GetTickerSnapshot ticker with data that as av that is not a int
I requested ticker ET during this weekend (2022-10-01)

Client update needed to match websocket.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -292,6 +292,14 @@
                       "type": "integer",
                       "description": "The condition."
                     },
+                    "i": {
+                      "type": "array",
+                      "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+                      "items": {
+                        "type": "integer",
+                        "description": "The indicator code.\n"
+                      }
+                    },
                     "t": {
                       "type": "integer",
                       "description": "The Timestamp in Unix MS."
@@ -312,6 +320,9 @@
                   "ap": 114.128,
                   "as": 160,
                   "c": 0,
+                  "i": [
+                    604
+                  ],
                   "t": 1536036818784,
                   "z": 3
                 }
@@ -2282,6 +2293,14 @@
             "type": "integer",
             "description": "The condition."
           },
+          "i": {
+            "type": "array",
+            "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+            "items": {
+              "type": "integer",
+              "description": "The indicator code.\n"
+            }
+          },
           "t": {
             "type": "integer",
             "description": "The Timestamp in Unix MS."

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -18,105 +18,382 @@
   "x-polygon-order": {
     "stocks": {
       "market": [
-        "/v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to}",
-        "/v2/aggs/grouped/locale/us/market/stocks/{date}",
-        "/v1/open-close/{stocksTicker}/{date}",
-        "/v2/aggs/ticker/{stocksTicker}/prev",
-        "/v3/trades/{stockTicker}",
-        "/v2/ticks/stocks/trades/{ticker}/{date}",
-        "/v2/last/trade/{stocksTicker}",
-        "/v3/quotes/{stockTicker}",
-        "/v2/ticks/stocks/nbbo/{ticker}/{date}",
-        "/v2/last/nbbo/{stocksTicker}",
-        "/v2/snapshot/locale/us/markets/stocks/tickers",
-        "/v2/snapshot/locale/us/markets/stocks/{direction}",
-        "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}"
+        {
+          "paths": [
+            "/v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/aggs/grouped/locale/us/market/stocks/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/open-close/{stocksTicker}/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/aggs/ticker/{stocksTicker}/prev"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/trades/{stockTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/ticks/stocks/trades/{ticker}/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/last/trade/{stocksTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/quotes/{stockTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/ticks/stocks/nbbo/{ticker}/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/last/nbbo/{stocksTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/snapshot/locale/us/markets/stocks/tickers",
+            "/v2/snapshot/locale/us/markets/stocks/{direction}",
+            "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}"
+          ],
+          "group": "Snapshots"
+        }
       ],
       "reference": [
-        "/v3/reference/tickers",
-        "/v1/meta/symbols/{stocksTicker}/company",
-        "/v3/reference/tickers/{ticker}",
-        "/v2/reference/news",
-        "/v3/reference/tickers/types",
-        "/v1/marketstatus/upcoming",
-        "/v1/marketstatus/now",
-        "/v1/reference/sec/filings",
-        "/v1/reference/sec/filings/{filing_id}",
-        "/v1/reference/sec/filings/{filing_id}/files",
-        "/v1/reference/sec/filings/{filing_id}/files/{file_id}",
-        "/v3/reference/splits",
-        "/v3/reference/dividends",
-        "/vX/reference/financials",
-        "/v3/reference/conditions",
-        "/v3/reference/exchanges"
+        {
+          "paths": [
+            "/v3/reference/tickers"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/meta/symbols/{stocksTicker}/company"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/tickers/{ticker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/reference/news"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/tickers/types"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/marketstatus/upcoming"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/marketstatus/now"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/reference/sec/filings",
+            "/v1/reference/sec/filings/{filing_id}",
+            "/v1/reference/sec/filings/{filing_id}/files",
+            "/v1/reference/sec/filings/{filing_id}/files/{file_id}"
+          ],
+          "group": "SEC Filings"
+        },
+        {
+          "paths": [
+            "/v3/reference/splits"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/dividends"
+          ]
+        },
+        {
+          "paths": [
+            "/vX/reference/financials"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/conditions"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/exchanges"
+          ]
+        }
       ]
     },
     "options": {
       "market": [
-        "/v2/aggs/ticker/{optionsTicker}/range/{multiplier}/{timespan}/{from}/{to}",
-        "/v1/open-close/{optionsTicker}/{date}",
-        "/v2/aggs/ticker/{optionsTicker}/prev",
-        "/v3/trades/{optionsTicker}",
-        "/v2/last/trade/{optionsTicker}",
-        "/v3/quotes/{optionsTicker}",
-        "/v3/snapshot/options/{underlyingAsset}/{optionContract}",
-        "/v3/snapshot/options/{underlyingAsset}"
+        {
+          "paths": [
+            "/v2/aggs/ticker/{optionsTicker}/range/{multiplier}/{timespan}/{from}/{to}"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/open-close/{optionsTicker}/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/aggs/ticker/{optionsTicker}/prev"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/trades/{optionsTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/last/trade/{optionsTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/quotes/{optionsTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/snapshot/options/{underlyingAsset}/{optionContract}",
+            "/v3/snapshot/options/{underlyingAsset}"
+          ],
+          "group": "Snapshots"
+        }
       ],
       "reference": [
-        "/v3/reference/options/contracts/{options_ticker}",
-        "/v3/reference/options/contracts",
-        "/v3/reference/tickers",
-        "/v1/meta/symbols/{stocksTicker}/company",
-        "/v3/reference/tickers/{ticker}",
-        "/v2/reference/news",
-        "/v3/reference/tickers/types",
-        "/v1/marketstatus/upcoming",
-        "/v1/marketstatus/now",
-        "/v3/reference/conditions",
-        "/v3/reference/exchanges"
+        {
+          "paths": [
+            "/v3/reference/options/contracts/{options_ticker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/options/contracts"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/tickers"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/meta/symbols/{stocksTicker}/company"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/tickers/{ticker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/reference/news"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/tickers/types"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/marketstatus/upcoming"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/marketstatus/now"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/conditions"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/exchanges"
+          ]
+        }
       ]
     },
     "fx": {
       "market": [
-        "/v2/aggs/ticker/{forexTicker}/range/{multiplier}/{timespan}/{from}/{to}",
-        "/v2/aggs/grouped/locale/global/market/fx/{date}",
-        "/v2/aggs/ticker/{forexTicker}/prev",
-        "/v3/quotes/{fxTicker}",
-        "/v1/historic/forex/{from}/{to}/{date}",
-        "/v1/last_quote/currencies/{from}/{to}",
-        "/v1/conversion/{from}/{to}",
-        "/v2/snapshot/locale/global/markets/forex/tickers",
-        "/v2/snapshot/locale/global/markets/forex/{direction}",
-        "/v2/snapshot/locale/global/markets/forex/tickers/{ticker}"
+        {
+          "paths": [
+            "/v2/aggs/ticker/{forexTicker}/range/{multiplier}/{timespan}/{from}/{to}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/aggs/grouped/locale/global/market/fx/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/aggs/ticker/{forexTicker}/prev"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/quotes/{fxTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/historic/forex/{from}/{to}/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/last_quote/currencies/{from}/{to}"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/conversion/{from}/{to}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/snapshot/locale/global/markets/forex/tickers",
+            "/v2/snapshot/locale/global/markets/forex/{direction}",
+            "/v2/snapshot/locale/global/markets/forex/tickers/{ticker}"
+          ],
+          "group": "Snapshots"
+        }
       ],
       "reference": [
-        "/v3/reference/tickers",
-        "/v1/marketstatus/upcoming",
-        "/v1/marketstatus/now",
-        "/v3/reference/conditions",
-        "/v3/reference/exchanges"
+        {
+          "paths": [
+            "/v3/reference/tickers"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/marketstatus/upcoming"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/marketstatus/now"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/conditions"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/exchanges"
+          ]
+        }
       ]
     },
     "crypto": {
       "market": [
-        "/v2/aggs/ticker/{cryptoTicker}/range/{multiplier}/{timespan}/{from}/{to}",
-        "/v2/aggs/grouped/locale/global/market/crypto/{date}",
-        "/v1/open-close/crypto/{from}/{to}/{date}",
-        "/v2/aggs/ticker/{cryptoTicker}/prev",
-        "/v3/trades/{cryptoTicker}",
-        "/v1/historic/crypto/{from}/{to}/{date}",
-        "/v1/last/crypto/{from}/{to}",
-        "/v2/snapshot/locale/global/markets/crypto/tickers",
-        "/v2/snapshot/locale/global/markets/crypto/{direction}",
-        "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}",
-        "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book"
+        {
+          "paths": [
+            "/v2/aggs/ticker/{cryptoTicker}/range/{multiplier}/{timespan}/{from}/{to}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/aggs/grouped/locale/global/market/crypto/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/open-close/crypto/{from}/{to}/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/aggs/ticker/{cryptoTicker}/prev"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/trades/{cryptoTicker}"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/historic/crypto/{from}/{to}/{date}"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/last/crypto/{from}/{to}"
+          ]
+        },
+        {
+          "paths": [
+            "/v2/snapshot/locale/global/markets/crypto/tickers",
+            "/v2/snapshot/locale/global/markets/crypto/{direction}",
+            "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}",
+            "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book"
+          ],
+          "group": "Snapshots"
+        }
       ],
       "reference": [
-        "/v3/reference/tickers",
-        "/v1/marketstatus/upcoming",
-        "/v1/marketstatus/now",
-        "/v3/reference/conditions",
-        "/v3/reference/exchanges"
+        {
+          "paths": [
+            "/v3/reference/tickers"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/marketstatus/upcoming"
+          ]
+        },
+        {
+          "paths": [
+            "/v1/marketstatus/now"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/conditions"
+          ]
+        },
+        {
+          "paths": [
+            "/v3/reference/exchanges"
+          ]
+        }
       ]
     }
   },
@@ -2786,7 +3043,7 @@
           {
             "name": "from",
             "in": "path",
-            "description": "The start of the aggregate time window.",
+            "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
             "required": true,
             "schema": {
               "type": "string"
@@ -2796,7 +3053,7 @@
           {
             "name": "to",
             "in": "path",
-            "description": "The end of the aggregate time window.",
+            "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
             "required": true,
             "schema": {
               "type": "string"
@@ -4303,7 +4560,7 @@
           {
             "name": "from",
             "in": "path",
-            "description": "The start of the aggregate time window.",
+            "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
             "required": true,
             "schema": {
               "type": "string"
@@ -4313,7 +4570,7 @@
           {
             "name": "to",
             "in": "path",
-            "description": "The end of the aggregate time window.",
+            "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
             "required": true,
             "schema": {
               "type": "string"
@@ -5494,7 +5751,7 @@
           {
             "name": "from",
             "in": "path",
-            "description": "The start of the aggregate time window.",
+            "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
             "required": true,
             "schema": {
               "type": "string"
@@ -5504,7 +5761,7 @@
           {
             "name": "to",
             "in": "path",
-            "description": "The end of the aggregate time window.",
+            "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
             "required": true,
             "schema": {
               "type": "string"
@@ -7388,7 +7645,7 @@
           {
             "name": "from",
             "in": "path",
-            "description": "The start of the aggregate time window.",
+            "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
             "required": true,
             "schema": {
               "type": "string"
@@ -7398,7 +7655,7 @@
           {
             "name": "to",
             "in": "path",
-            "description": "The end of the aggregate time window.",
+            "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
             "required": true,
             "schema": {
               "type": "string"
@@ -12909,7 +13166,7 @@
       "AggregateTimeFrom": {
         "name": "from",
         "in": "path",
-        "description": "The start of the aggregate time window.",
+        "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
         "required": true,
         "schema": {
           "type": "string"
@@ -12919,7 +13176,7 @@
       "AggregateTimeTo": {
         "name": "to",
         "in": "path",
-        "description": "The end of the aggregate time window.",
+        "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.",
         "required": true,
         "schema": {
           "type": "string"

Client update needed to match websocket.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -292,6 +292,14 @@
                       "type": "integer",
                       "description": "The condition."
                     },
+                    "i": {
+                      "type": "array",
+                      "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+                      "items": {
+                        "type": "integer",
+                        "description": "The indicator code.\n"
+                      }
+                    },
                     "t": {
                       "type": "integer",
                       "description": "The Timestamp in Unix MS."
@@ -312,6 +320,9 @@
                   "ap": 114.128,
                   "as": 160,
                   "c": 0,
+                  "i": [
+                    604
+                  ],
                   "t": 1536036818784,
                   "z": 3
                 }
@@ -2282,6 +2293,14 @@
             "type": "integer",
             "description": "The condition."
           },
+          "i": {
+            "type": "array",
+            "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+            "items": {
+              "type": "integer",
+              "description": "The indicator code.\n"
+            }
+          },
           "t": {
             "type": "integer",
             "description": "The Timestamp in Unix MS."

Client update needed to match websocket.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -292,6 +292,14 @@
                       "type": "integer",
                       "description": "The condition."
                     },
+                    "i": {
+                      "type": "array",
+                      "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+                      "items": {
+                        "type": "integer",
+                        "description": "The indicator code.\n"
+                      }
+                    },
                     "t": {
                       "type": "integer",
                       "description": "The Timestamp in Unix MS."
@@ -312,6 +320,9 @@
                   "ap": 114.128,
                   "as": 160,
                   "c": 0,
+                  "i": [
+                    604
+                  ],
                   "t": 1536036818784,
                   "z": 3
                 }
@@ -2282,6 +2293,14 @@
             "type": "integer",
             "description": "The condition."
           },
+          "i": {
+            "type": "array",
+            "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+            "items": {
+              "type": "integer",
+              "description": "The indicator code.\n"
+            }
+          },
           "t": {
             "type": "integer",
             "description": "The Timestamp in Unix MS."

ListOptionsContracts ignores `polygonModels.GT` and `polygonModels.GTE`

Describe the bug
ListOptionsContracts does not respect the strike price params settings.

To Reproduce

	asOf, _ := time.Parse(time.RFC3339, "2022-07-14T09:45:00-04:00")
	expr, _ := time.Parse(time.RFC3339, "2022-07-15T00:00:00-04:00")
	params := polygonModels.ListOptionsContractsParams{}.
		WithAsOf(polygonModels.Date(asOf)).
		WithExpirationDate(polygonModels.EQ, polygonModels.Date(expr)).
		WithUnderlyingTicker(polygonModels.EQ, string("AAPL")).
		WithStrikePrice(polygonModels.GT, 136).
		WithContractType("put")
	fmt.Printf("%v\n", *params.StrikePriceGT)
	iter := polygonClient.ListOptionsContracts(context.Background(), params)
	for iter.Next() {
		fmt.Printf("%s\n", iter.Item().Ticker)
	}

Expected behavior
client should return put contracts with strikes greater than 136, but the program returns everything starting from strke 50

$ go run main.go 
136
O:AAPL220715P00050000
O:AAPL220715P00055000
O:AAPL220715P00060000
O:AAPL220715P00065000
O:AAPL220715P00070000
O:AAPL220715P00075000
O:AAPL220715P00080000
O:AAPL220715P00085000
O:AAPL220715P00090000
...

Screenshots
not needed

Additional context

  1. more testing shows polygonModels.LT and polygonModels.LTE work as expected.
  2. version github.com/polygon-io/client-go v1.1.0

Client update needed to match websocket.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -18,34 +18,98 @@
   "x-polygon-order": {
     "stocks": {
       "market": [
-        "/stocks/AM",
-        "/stocks/A",
-        "/stocks/T",
-        "/stocks/Q",
-        "/stocks/NOI",
-        "/stocks/LULD"
+        {
+          "paths": [
+            "/stocks/AM"
+          ]
+        },
+        {
+          "paths": [
+            "/stocks/A"
+          ]
+        },
+        {
+          "paths": [
+            "/stocks/T"
+          ]
+        },
+        {
+          "paths": [
+            "/stocks/Q"
+          ]
+        },
+        {
+          "paths": [
+            "/stocks/NOI"
+          ]
+        },
+        {
+          "paths": [
+            "/stocks/LULD"
+          ]
+        }
       ]
     },
     "options": {
       "market": [
-        "/options/AM",
-        "/options/A",
-        "/options/T",
-        "/options/Q"
+        {
+          "paths": [
+            "/options/AM"
+          ]
+        },
+        {
+          "paths": [
+            "/options/A"
+          ]
+        },
+        {
+          "paths": [
+            "/options/T"
+          ]
+        },
+        {
+          "paths": [
+            "/options/Q"
+          ]
+        }
       ]
     },
     "fx": {
       "market": [
-        "/forex/CA",
-        "/forex/C"
+        {
+          "paths": [
+            "/forex/CA"
+          ]
+        },
+        {
+          "paths": [
+            "/forex/C"
+          ]
+        }
       ]
     },
     "crypto": {
       "market": [
-        "/crypto/XA",
-        "/crypto/XT",
-        "/crypto/XQ",
-        "/crypto/XL2"
+        {
+          "paths": [
+            "/crypto/XA"
+          ]
+        },
+        {
+          "paths": [
+            "/crypto/XT"
+          ]
+        },
+        {
+          "paths": [
+            "/crypto/XQ"
+          ]
+        },
+        {
+          "paths": [
+            "/crypto/XL2"
+          ]
+        }
       ]
     }
   },

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -2207,363 +2207,6 @@
         }
       }
     },
-    "/v2/last/trade/{stocksTicker}": {
-      "get": {
-        "summary": "Last Trade",
-        "description": "Get the most recent trade for a given stock.\n",
-        "tags": [
-          "stocks:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "stocksTicker",
-            "in": "path",
-            "description": "The ticker symbol of the stock/equity.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AAPL"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last trade for this stock.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "string",
-                                  "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n"
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                                },
-                                "s": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The size of a trade (also known as volume).\n"
-                                },
-                                "e": {
-                                  "type": "integer",
-                                  "description": "The trade correction indicator.\n"
-                                },
-                                "x": {
-                                  "type": "integer",
-                                  "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                },
-                                "r": {
-                                  "type": "integer",
-                                  "description": "The ID for the Trade Reporting Facility where the trade took place.\n"
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "f05562305bd26ced64b98ed68b3c5d96",
-                  "status": "OK",
-                  "results": {
-                    "T": "AAPL",
-                    "c": [
-                      37
-                    ],
-                    "f": 1617901342969796400,
-                    "i": "118749",
-                    "p": 129.8473,
-                    "q": 3135876,
-                    "r": 202,
-                    "s": 25,
-                    "t": 1617901342969834000,
-                    "x": 4,
-                    "y": 1617901342968000000,
-                    "z": 3
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "stocks",
-          "description": "Stocks data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
-    "/v2/last/nbbo/{stocksTicker}": {
-      "get": {
-        "summary": "Last Quote",
-        "description": "Get the most recent NBBO (Quote) tick for a given stock.\n",
-        "tags": [
-          "stocks:last:quote"
-        ],
-        "parameters": [
-          {
-            "name": "stocksTicker",
-            "in": "path",
-            "description": "The ticker symbol of the stock/equity.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AAPL"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last NBBO tick for this stock.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "array",
-                                  "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The indicator code.\n"
-                                  }
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The bid price."
-                                },
-                                "s": {
-                                  "type": "integer",
-                                  "description": "The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price."
-                                },
-                                "x": {
-                                  "allOf": [
-                                    {
-                                      "type": "integer",
-                                      "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                    },
-                                    {
-                                      "description": "Bid Exchange Id"
-                                    }
-                                  ]
-                                },
-                                "P": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The ask price."
-                                },
-                                "S": {
-                                  "type": "integer",
-                                  "description": "The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price."
-                                },
-                                "X": {
-                                  "allOf": [
-                                    {
-                                      "type": "integer",
-                                      "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                    },
-                                    {
-                                      "description": "Ask Exchange Id"
-                                    }
-                                  ]
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "b84e24636301f19f88e0dfbf9a45ed5c",
-                  "status": "OK",
-                  "results": {
-                    "P": 127.98,
-                    "S": 7,
-                    "T": "AAPL",
-                    "X": 19,
-                    "p": 127.96,
-                    "q": 83480742,
-                    "s": 1,
-                    "t": 1617827221349730300,
-                    "x": 11,
-                    "y": 1617827221349366000,
-                    "z": 3
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "stocks",
-          "description": "Stocks data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
     "/v1/open-close/{stocksTicker}/{date}": {
       "get": {
         "summary": "Daily Open/Close",
@@ -3291,7 +2934,7 @@
     "/v2/snapshot/locale/us/markets/stocks/tickers": {
       "get": {
         "summary": "All Tickers",
-        "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
+        "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -3641,7 +3284,7 @@
     "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}": {
       "get": {
         "summary": "Ticker",
-        "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
+        "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -3981,7 +3624,7 @@
     "/v2/snapshot/locale/us/markets/stocks/{direction}": {
       "get": {
         "summary": "Gainers/Losers",
-        "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
+        "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -4325,173 +3968,6 @@
         ]
       }
     },
-    "/v2/last/trade/{optionsTicker}": {
-      "get": {
-        "summary": "Last Trade",
-        "description": "Get the most recent trade for a given options contract.\n",
-        "tags": [
-          "options:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "optionsTicker",
-            "in": "path",
-            "description": "The ticker symbol of the options contract.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "O:TSLA210903C00700000"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last trade for this options contract.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "string",
-                                  "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n"
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                                },
-                                "s": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The size of a trade (also known as volume).\n"
-                                },
-                                "e": {
-                                  "type": "integer",
-                                  "description": "The trade correction indicator.\n"
-                                },
-                                "x": {
-                                  "type": "integer",
-                                  "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                },
-                                "r": {
-                                  "type": "integer",
-                                  "description": "The ID for the Trade Reporting Facility where the trade took place.\n"
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "f05562305bd26ced64b98ed68b3c5d96",
-                  "status": "OK",
-                  "results": {
-                    "T": "O:TSLA210903C00700000",
-                    "c": [
-                      227
-                    ],
-                    "f": 1617901342969796400,
-                    "i": "",
-                    "p": 115.55,
-                    "q": 1325541950,
-                    "r": 202,
-                    "s": 25,
-                    "t": 1617901342969834000,
-                    "x": 312
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "options",
-          "description": "Options data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
     "/v1/open-close/{optionsTicker}/{date}": {
       "get": {
         "summary": "Daily Open/Close",
@@ -5206,272 +4682,6 @@
         }
       }
     },
-    "/v1/conversion/{from}/{to}": {
-      "get": {
-        "summary": "Real-time Currency Conversion",
-        "description": "Get currency conversions using the latest market conversion rates. Note than you can convert in both directions. For example USD to CAD or CAD to USD.\n",
-        "tags": [
-          "fx:conversion"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AUD"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          },
-          {
-            "name": "amount",
-            "in": "query",
-            "description": "The amount to convert, with a decimal.",
-            "required": false,
-            "schema": {
-              "type": "integer"
-            },
-            "example": 100
-          },
-          {
-            "name": "precision",
-            "in": "query",
-            "description": "The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy.",
-            "required": false,
-            "schema": {
-              "type": "integer",
-              "enum": [
-                0,
-                1,
-                2,
-                3,
-                4
-              ]
-            },
-            "example": 2
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last tick for this currency pair, plus the converted amount for the requested amount.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "ask": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The ask price."
-                            },
-                            "bid": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The bid price."
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "from": {
-                          "type": "string",
-                          "description": "The \"from\" currency symbol."
-                        },
-                        "to": {
-                          "type": "string",
-                          "description": "The \"to\" currency symbol."
-                        },
-                        "initialAmount": {
-                          "type": "number",
-                          "format": "double",
-                          "description": "The amount to convert."
-                        },
-                        "converted": {
-                          "type": "number",
-                          "format": "double",
-                          "description": "The result of the conversion."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "status": "success",
-                  "last": {
-                    "bid": 1.3672596,
-                    "ask": 1.3673344,
-                    "exchange": 48,
-                    "timestamp": 1605555313000
-                  },
-                  "from": "AUD",
-                  "to": "USD",
-                  "initialAmount": 100,
-                  "converted": 73.14
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "fx",
-          "description": "Forex data"
-        }
-      }
-    },
-    "/v1/last_quote/currencies/{from}/{to}": {
-      "get": {
-        "summary": "Last Quote for a Currency Pair",
-        "description": "Get the last quote tick for a forex currency pair.\n",
-        "tags": [
-          "fx:last:quote"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AUD"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last quote tick for this currency pair.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "ask": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The ask price."
-                            },
-                            "bid": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The bid price."
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "symbol": {
-                          "type": "string",
-                          "description": "The symbol pair that was evaluated from the request."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "last": {
-                    "ask": 0.73124,
-                    "bid": 0.73122,
-                    "exchange": 48,
-                    "timestamp": 1605557756000
-                  },
-                  "request_id": "a73a29dbcab4613eeaf48583d3baacf0",
-                  "status": "success",
-                  "symbol": "AUD/USD"
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "fx",
-          "description": "Forex data"
-        }
-      }
-    },
     "/v2/aggs/grouped/locale/global/market/fx/{date}": {
       "get": {
         "summary": "Grouped Daily (Bars)",
@@ -6823,133 +6033,6 @@
         ]
       }
     },
-    "/v1/last/crypto/{from}/{to}": {
-      "get": {
-        "summary": "Last Trade for a Crypto Pair",
-        "description": "Get the last trade tick for a cryptocurrency pair.\n",
-        "tags": [
-          "crypto:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "BTC"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last tick for this currency pair.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "conditions": {
-                              "type": "array",
-                              "description": "A list of condition codes.\n",
-                              "items": {
-                                "type": "integer",
-                                "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                              }
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange that this crypto trade happened on.  \nSee <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs.\n"
-                            },
-                            "price": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                            },
-                            "size": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The size of a trade (also known as volume).\n"
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "symbol": {
-                          "type": "string",
-                          "description": "The symbol pair that was evaluated from the request."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "last": {
-                    "conditions": [
-                      1
-                    ],
-                    "exchange": 4,
-                    "price": 16835.42,
-                    "size": 0.006909,
-                    "timestamp": 1605560885027
-                  },
-                  "request_id": "d2d779df015fe2b7fbb8e58366610ef7",
-                  "status": "success",
-                  "symbol": "BTC-USD"
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "crypto",
-          "description": "Crypto data"
-        }
-      }
-    },
     "/v1/open-close/crypto/{from}/{to}/{date}": {
       "get": {
         "summary": "Daily Open/Close",

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -2811,7 +2811,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               },
                               "otc": {
@@ -2996,7 +2996,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -3227,7 +3227,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               },
                               "otc": {
@@ -4806,7 +4806,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -4977,7 +4977,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -5580,7 +5580,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -5765,7 +5765,7 @@
                                 "description": "The volume weighted average price."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -5997,7 +5997,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -7475,7 +7475,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -7660,7 +7660,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -7891,7 +7891,7 @@
                                 "description": "The Unix Msec timestamp for the start of the aggregate window."
                               },
                               "n": {
-                                "type": "number",
+                                "type": "integer",
                                 "description": "The number of transactions in the aggregate window."
                               }
                             }
@@ -9753,7 +9753,7 @@
         "description": "The milliseconds of latency for the query results."
       },
       "NumberOfItems": {
-        "type": "number",
+        "type": "integer",
         "description": "The number of transactions in the aggregate window."
       },
       "OTC": {
@@ -9895,7 +9895,7 @@
                   "description": "The Unix Msec timestamp for the start of the aggregate window."
                 },
                 "n": {
-                  "type": "number",
+                  "type": "integer",
                   "description": "The number of transactions in the aggregate window."
                 }
               }
@@ -9950,7 +9950,7 @@
                   "description": "The Unix Msec timestamp for the start of the aggregate window."
                 },
                 "n": {
-                  "type": "number",
+                  "type": "integer",
                   "description": "The number of transactions in the aggregate window."
                 },
                 "otc": {
@@ -10005,7 +10005,7 @@
                   "description": "The Unix Msec timestamp for the start of the aggregate window."
                 },
                 "n": {
-                  "type": "number",
+                  "type": "integer",
                   "description": "The number of transactions in the aggregate window."
                 },
                 "otc": {
@@ -10064,7 +10064,7 @@
                   "description": "The Unix Msec timestamp for the start of the aggregate window."
                 },
                 "n": {
-                  "type": "number",
+                  "type": "integer",
                   "description": "The number of transactions in the aggregate window."
                 }
               }
@@ -10115,7 +10115,7 @@
                   "description": "The Unix Msec timestamp for the start of the aggregate window."
                 },
                 "n": {
-                  "type": "number",
+                  "type": "integer",
                   "description": "The number of transactions in the aggregate window."
                 }
               }
@@ -10170,7 +10170,7 @@
                   "description": "The Unix Msec timestamp for the start of the aggregate window."
                 },
                 "n": {
-                  "type": "number",
+                  "type": "integer",
                   "description": "The number of transactions in the aggregate window."
                 }
               }
@@ -13065,7 +13065,7 @@
                   "description": "The volume weighted average price."
                 },
                 "n": {
-                  "type": "number",
+                  "type": "integer",
                   "description": "The number of transactions in the aggregate window."
                 }
               }

Ticker ListDate returns different than expected

Maybe this isn't a Bug, but I consider this a consistency thing.

The Agg interface returns daily values with dates/time that is set for EST (this is what I would expect).

I would also expect the same for the Ticker, but it doesn't. Instead it returns a value that is UTC.

Since the stocks are based in the US I would have expected to see to see those also be EST.

Ticker Events Endpoint

Is your feature request related to a problem? Please describe.
The client is missing the Event Endpoint (/vX/reference/tickers/{id}/events).

Describe the solution you'd like
Ideally there would be a function added to the client for the endpoint.

Client update needed to match REST spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/openapi
@@ -14981,7 +14981,15 @@
                 "LT",
                 "ST"
               ],
-              "type": "string"
+              "type": "string",
+              "x-polygon-go-field-tags": {
+                "tags": [
+                  {
+                    "key": "binding",
+                    "value": "required"
+                  }
+                ]
+              }
             }
           },
           {
@@ -15281,15 +15289,39 @@
                         "properties": {
                           "cash_amount": {
                             "description": "The cash amount of the dividend per share owned.",
-                            "type": "number"
+                            "type": "number",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           },
                           "currency": {
                             "description": "The currency in which the dividend is paid.",
-                            "type": "string"
+                            "type": "string",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           },
                           "declaration_date": {
                             "description": "The date that the dividend was announced.",
-                            "type": "string"
+                            "type": "string",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           },
                           "dividend_type": {
                             "description": "The type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD.\nSpecial Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC.\nLong-Term and Short-Term capital gain distributions are denoted as LT and ST, respectively.",
@@ -15299,27 +15325,75 @@
                               "LT",
                               "ST"
                             ],
-                            "type": "string"
+                            "type": "string",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           },
                           "ex_dividend_date": {
                             "description": "The date that the stock first trades without the dividend, determined by the exchange.",
-                            "type": "string"
+                            "type": "string",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           },
                           "frequency": {
                             "description": "The number of times per year the dividend is paid out.  Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly).",
-                            "type": "integer"
+                            "type": "integer",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           },
                           "pay_date": {
                             "description": "The date that the dividend is paid out.",
-                            "type": "string"
+                            "type": "string",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           },
                           "record_date": {
                             "description": "The date that the stock must be held to receive the dividend, set by the company.",
-                            "type": "string"
+                            "type": "string",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           },
                           "ticker": {
                             "description": "The ticker symbol of the dividend.",
-                            "type": "string"
+                            "type": "string",
+                            "x-polygon-go-field-tags": {
+                              "tags": [
+                                {
+                                  "key": "binding",
+                                  "value": "required"
+                                }
+                              ]
+                            }
                           }
                         },
                         "required": [
@@ -15401,15 +15460,39 @@
                 "properties": {
                   "cash_amount": {
                     "description": "The cash amount of the dividend per share owned.",
-                    "type": "number"
+                    "type": "number",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   },
                   "currency": {
                     "description": "The currency in which the dividend is paid.",
-                    "type": "string"
+                    "type": "string",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   },
                   "declaration_date": {
                     "description": "The date that the dividend was announced.",
-                    "type": "string"
+                    "type": "string",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   },
                   "dividend_type": {
                     "description": "The type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD.\nSpecial Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC.\nLong-Term and Short-Term capital gain distributions are denoted as LT and ST, respectively.",
@@ -15419,27 +15496,75 @@
                       "LT",
                       "ST"
                     ],
-                    "type": "string"
+                    "type": "string",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   },
                   "ex_dividend_date": {
                     "description": "The date that the stock first trades without the dividend, determined by the exchange.",
-                    "type": "string"
+                    "type": "string",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   },
                   "frequency": {
                     "description": "The number of times per year the dividend is paid out.  Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly).",
-                    "type": "integer"
+                    "type": "integer",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   },
                   "pay_date": {
                     "description": "The date that the dividend is paid out.",
-                    "type": "string"
+                    "type": "string",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   },
                   "record_date": {
                     "description": "The date that the stock must be held to receive the dividend, set by the company.",
-                    "type": "string"
+                    "type": "string",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   },
                   "ticker": {
                     "description": "The ticker symbol of the dividend.",
-                    "type": "string"
+                    "type": "string",
+                    "x-polygon-go-field-tags": {
+                      "tags": [
+                        {
+                          "key": "binding",
+                          "value": "required"
+                        }
+                      ]
+                    }
                   }
                 },
                 "required": [
@@ -15477,15 +15587,39 @@
                       "properties": {
                         "cash_amount": {
                           "description": "The cash amount of the dividend per share owned.",
-                          "type": "number"
+                          "type": "number",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         },
                         "currency": {
                           "description": "The currency in which the dividend is paid.",
-                          "type": "string"
+                          "type": "string",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         },
                         "declaration_date": {
                           "description": "The date that the dividend was announced.",
-                          "type": "string"
+                          "type": "string",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         },
                         "dividend_type": {
                           "description": "The type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD.\nSpecial Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC.\nLong-Term and Short-Term capital gain distributions are denoted as LT and ST, respectively.",
@@ -15495,27 +15623,75 @@
                             "LT",
                             "ST"
                           ],
-                          "type": "string"
+                          "type": "string",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         },
                         "ex_dividend_date": {
                           "description": "The date that the stock first trades without the dividend, determined by the exchange.",
-                          "type": "string"
+                          "type": "string",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         },
                         "frequency": {
                           "description": "The number of times per year the dividend is paid out.  Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly).",
-                          "type": "integer"
+                          "type": "integer",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         },
                         "pay_date": {
                           "description": "The date that the dividend is paid out.",
-                          "type": "string"
+                          "type": "string",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         },
                         "record_date": {
                           "description": "The date that the stock must be held to receive the dividend, set by the company.",
-                          "type": "string"
+                          "type": "string",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         },
                         "ticker": {
                           "description": "The ticker symbol of the dividend.",
-                          "type": "string"
+                          "type": "string",
+                          "x-polygon-go-field-tags": {
+                            "tags": [
+                              {
+                                "key": "binding",
+                                "value": "required"
+                              }
+                            ]
+                          }
                         }
                       },
                       "required": [

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -2207,363 +2207,6 @@
         }
       }
     },
-    "/v2/last/trade/{stocksTicker}": {
-      "get": {
-        "summary": "Last Trade",
-        "description": "Get the most recent trade for a given stock.\n",
-        "tags": [
-          "stocks:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "stocksTicker",
-            "in": "path",
-            "description": "The ticker symbol of the stock/equity.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AAPL"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last trade for this stock.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "string",
-                                  "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n"
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                                },
-                                "s": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The size of a trade (also known as volume).\n"
-                                },
-                                "e": {
-                                  "type": "integer",
-                                  "description": "The trade correction indicator.\n"
-                                },
-                                "x": {
-                                  "type": "integer",
-                                  "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                },
-                                "r": {
-                                  "type": "integer",
-                                  "description": "The ID for the Trade Reporting Facility where the trade took place.\n"
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "f05562305bd26ced64b98ed68b3c5d96",
-                  "status": "OK",
-                  "results": {
-                    "T": "AAPL",
-                    "c": [
-                      37
-                    ],
-                    "f": 1617901342969796400,
-                    "i": "118749",
-                    "p": 129.8473,
-                    "q": 3135876,
-                    "r": 202,
-                    "s": 25,
-                    "t": 1617901342969834000,
-                    "x": 4,
-                    "y": 1617901342968000000,
-                    "z": 3
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "stocks",
-          "description": "Stocks data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
-    "/v2/last/nbbo/{stocksTicker}": {
-      "get": {
-        "summary": "Last Quote",
-        "description": "Get the most recent NBBO (Quote) tick for a given stock.\n",
-        "tags": [
-          "stocks:last:quote"
-        ],
-        "parameters": [
-          {
-            "name": "stocksTicker",
-            "in": "path",
-            "description": "The ticker symbol of the stock/equity.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AAPL"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last NBBO tick for this stock.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "array",
-                                  "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The indicator code.\n"
-                                  }
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The bid price."
-                                },
-                                "s": {
-                                  "type": "integer",
-                                  "description": "The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price."
-                                },
-                                "x": {
-                                  "allOf": [
-                                    {
-                                      "type": "integer",
-                                      "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                    },
-                                    {
-                                      "description": "Bid Exchange Id"
-                                    }
-                                  ]
-                                },
-                                "P": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The ask price."
-                                },
-                                "S": {
-                                  "type": "integer",
-                                  "description": "The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price."
-                                },
-                                "X": {
-                                  "allOf": [
-                                    {
-                                      "type": "integer",
-                                      "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                    },
-                                    {
-                                      "description": "Ask Exchange Id"
-                                    }
-                                  ]
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "b84e24636301f19f88e0dfbf9a45ed5c",
-                  "status": "OK",
-                  "results": {
-                    "P": 127.98,
-                    "S": 7,
-                    "T": "AAPL",
-                    "X": 19,
-                    "p": 127.96,
-                    "q": 83480742,
-                    "s": 1,
-                    "t": 1617827221349730300,
-                    "x": 11,
-                    "y": 1617827221349366000,
-                    "z": 3
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "stocks",
-          "description": "Stocks data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
     "/v1/open-close/{stocksTicker}/{date}": {
       "get": {
         "summary": "Daily Open/Close",
@@ -3291,7 +2934,7 @@
     "/v2/snapshot/locale/us/markets/stocks/tickers": {
       "get": {
         "summary": "All Tickers",
-        "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
+        "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -3641,7 +3284,7 @@
     "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}": {
       "get": {
         "summary": "Ticker",
-        "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
+        "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -3981,7 +3624,7 @@
     "/v2/snapshot/locale/us/markets/stocks/{direction}": {
       "get": {
         "summary": "Gainers/Losers",
-        "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
+        "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -4325,173 +3968,6 @@
         ]
       }
     },
-    "/v2/last/trade/{optionsTicker}": {
-      "get": {
-        "summary": "Last Trade",
-        "description": "Get the most recent trade for a given options contract.\n",
-        "tags": [
-          "options:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "optionsTicker",
-            "in": "path",
-            "description": "The ticker symbol of the options contract.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "O:TSLA210903C00700000"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last trade for this options contract.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "string",
-                                  "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n"
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                                },
-                                "s": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The size of a trade (also known as volume).\n"
-                                },
-                                "e": {
-                                  "type": "integer",
-                                  "description": "The trade correction indicator.\n"
-                                },
-                                "x": {
-                                  "type": "integer",
-                                  "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                },
-                                "r": {
-                                  "type": "integer",
-                                  "description": "The ID for the Trade Reporting Facility where the trade took place.\n"
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "f05562305bd26ced64b98ed68b3c5d96",
-                  "status": "OK",
-                  "results": {
-                    "T": "O:TSLA210903C00700000",
-                    "c": [
-                      227
-                    ],
-                    "f": 1617901342969796400,
-                    "i": "",
-                    "p": 115.55,
-                    "q": 1325541950,
-                    "r": 202,
-                    "s": 25,
-                    "t": 1617901342969834000,
-                    "x": 312
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "options",
-          "description": "Options data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
     "/v1/open-close/{optionsTicker}/{date}": {
       "get": {
         "summary": "Daily Open/Close",
@@ -5206,272 +4682,6 @@
         }
       }
     },
-    "/v1/conversion/{from}/{to}": {
-      "get": {
-        "summary": "Real-time Currency Conversion",
-        "description": "Get currency conversions using the latest market conversion rates. Note than you can convert in both directions. For example USD to CAD or CAD to USD.\n",
-        "tags": [
-          "fx:conversion"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AUD"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          },
-          {
-            "name": "amount",
-            "in": "query",
-            "description": "The amount to convert, with a decimal.",
-            "required": false,
-            "schema": {
-              "type": "integer"
-            },
-            "example": 100
-          },
-          {
-            "name": "precision",
-            "in": "query",
-            "description": "The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy.",
-            "required": false,
-            "schema": {
-              "type": "integer",
-              "enum": [
-                0,
-                1,
-                2,
-                3,
-                4
-              ]
-            },
-            "example": 2
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last tick for this currency pair, plus the converted amount for the requested amount.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "ask": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The ask price."
-                            },
-                            "bid": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The bid price."
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "from": {
-                          "type": "string",
-                          "description": "The \"from\" currency symbol."
-                        },
-                        "to": {
-                          "type": "string",
-                          "description": "The \"to\" currency symbol."
-                        },
-                        "initialAmount": {
-                          "type": "number",
-                          "format": "double",
-                          "description": "The amount to convert."
-                        },
-                        "converted": {
-                          "type": "number",
-                          "format": "double",
-                          "description": "The result of the conversion."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "status": "success",
-                  "last": {
-                    "bid": 1.3672596,
-                    "ask": 1.3673344,
-                    "exchange": 48,
-                    "timestamp": 1605555313000
-                  },
-                  "from": "AUD",
-                  "to": "USD",
-                  "initialAmount": 100,
-                  "converted": 73.14
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "fx",
-          "description": "Forex data"
-        }
-      }
-    },
-    "/v1/last_quote/currencies/{from}/{to}": {
-      "get": {
-        "summary": "Last Quote for a Currency Pair",
-        "description": "Get the last quote tick for a forex currency pair.\n",
-        "tags": [
-          "fx:last:quote"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AUD"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last quote tick for this currency pair.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "ask": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The ask price."
-                            },
-                            "bid": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The bid price."
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "symbol": {
-                          "type": "string",
-                          "description": "The symbol pair that was evaluated from the request."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "last": {
-                    "ask": 0.73124,
-                    "bid": 0.73122,
-                    "exchange": 48,
-                    "timestamp": 1605557756000
-                  },
-                  "request_id": "a73a29dbcab4613eeaf48583d3baacf0",
-                  "status": "success",
-                  "symbol": "AUD/USD"
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "fx",
-          "description": "Forex data"
-        }
-      }
-    },
     "/v2/aggs/grouped/locale/global/market/fx/{date}": {
       "get": {
         "summary": "Grouped Daily (Bars)",
@@ -6823,133 +6033,6 @@
         ]
       }
     },
-    "/v1/last/crypto/{from}/{to}": {
-      "get": {
-        "summary": "Last Trade for a Crypto Pair",
-        "description": "Get the last trade tick for a cryptocurrency pair.\n",
-        "tags": [
-          "crypto:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "BTC"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last tick for this currency pair.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "conditions": {
-                              "type": "array",
-                              "description": "A list of condition codes.\n",
-                              "items": {
-                                "type": "integer",
-                                "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                              }
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange that this crypto trade happened on.  \nSee <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs.\n"
-                            },
-                            "price": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                            },
-                            "size": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The size of a trade (also known as volume).\n"
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "symbol": {
-                          "type": "string",
-                          "description": "The symbol pair that was evaluated from the request."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "last": {
-                    "conditions": [
-                      1
-                    ],
-                    "exchange": 4,
-                    "price": 16835.42,
-                    "size": 0.006909,
-                    "timestamp": 1605560885027
-                  },
-                  "request_id": "d2d779df015fe2b7fbb8e58366610ef7",
-                  "status": "success",
-                  "symbol": "BTC-USD"
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "crypto",
-          "description": "Crypto data"
-        }
-      }
-    },
     "/v1/open-close/crypto/{from}/{to}/{date}": {
       "get": {
         "summary": "Daily Open/Close",

Client update needed to match REST spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/openapi
@@ -20642,6 +20642,12 @@
                   ],
                   "type": "object"
                 }
+              },
+              "text/csv": {
+                "schema": {
+                  "example": "ticker,declaration_date,ex_dividend_date,record_date,pay_date,frequency,cash_amount,dividend_type\nAAPL,2021-10-28,2021-11-05,2021-11-08,2021-11-11,4,0.22,CD\nAAPL,2021-07-27,2021-08-06,2021-08-09,2021-08-12,4,0.22,CD\n",
+                  "type": "string"
+                }
               }
             },
             "description": "OK"
@@ -22062,6 +22068,12 @@
                   },
                   "type": "object"
                 }
+              },
+              "text/csv": {
+                "example": "ticker,execution_date,split_from,split_to\nAAPL,2020-08-31,1.0,4.0\nAAPL,2005-02-28,1.0,2.0\n",
+                "schema": {
+                  "type": "string"
+                }
               }
             },
             "description": "A list of stock splits."
@@ -23179,7 +23191,10 @@
                                 "x-polygon-go-id": "VWAP"
                               }
                             },
-                            "type": "object"
+                            "type": "object",
+                            "x-polygon-go-type": {
+                              "name": "Day"
+                            }
                           },
                           "details": {
                             "properties": {
@@ -23224,7 +23239,10 @@
                                 "type": "string"
                               }
                             },
-                            "type": "object"
+                            "type": "object",
+                            "x-polygon-go-type": {
+                              "name": "Details"
+                            }
                           },
                           "greeks": {
                             "description": "The greeks for this contract. This is only returned if your current plan includes greeks.",
@@ -23250,7 +23268,10 @@
                                 "type": "number"
                               }
                             },
-                            "type": "object"
+                            "type": "object",
+                            "x-polygon-go-type": {
+                              "name": "Greeks"
+                            }
                           },
                           "implied_volatility": {
                             "description": "The market's forecast for the volatility of the underlying asset, based on this option's current price.",
@@ -23303,7 +23324,10 @@
                                 "type": "string"
                               }
                             },
-                            "type": "object"
+                            "type": "object",
+                            "x-polygon-go-type": {
+                              "name": "LastQuote"
+                            }
                           },
                           "open_interest": {
                             "description": "The quantity of this contract held at the end of the last trading day.",
@@ -23345,10 +23369,16 @@
                                 "type": "string"
                               }
                             },
-                            "type": "object"
+                            "type": "object",
+                            "x-polygon-go-type": {
+                              "name": "UnderlyingAsset"
+                            }
                           }
                         },
-                        "type": "object"
+                        "type": "object",
+                        "x-polygon-go-type": {
+                          "name": "OptionSnapshotResult"
+                        }
                       },
                       "type": "array"
                     },
@@ -23559,7 +23587,10 @@
                               "x-polygon-go-id": "VWAP"
                             }
                           },
-                          "type": "object"
+                          "type": "object",
+                          "x-polygon-go-type": {
+                            "name": "Day"
+                          }
                         },
                         "details": {
                           "properties": {
@@ -23604,7 +23635,10 @@
                               "type": "string"
                             }
                           },
-                          "type": "object"
+                          "type": "object",
+                          "x-polygon-go-type": {
+                            "name": "Details"
+                          }
                         },
                         "greeks": {
                           "description": "The greeks for this contract. This is only returned if your current plan includes greeks.",
@@ -23630,7 +23664,10 @@
                               "type": "number"
                             }
                           },
-                          "type": "object"
+                          "type": "object",
+                          "x-polygon-go-type": {
+                            "name": "Greeks"
+                          }
                         },
                         "implied_volatility": {
                           "description": "The market's forecast for the volatility of the underlying asset, based on this option's current price.",
@@ -23683,7 +23720,10 @@
                               "type": "string"
                             }
                           },
-                          "type": "object"
+                          "type": "object",
+                          "x-polygon-go-type": {
+                            "name": "LastQuote"
+                          }
                         },
                         "open_interest": {
                           "description": "The quantity of this contract held at the end of the last trading day.",
@@ -23725,10 +23765,16 @@
                               "type": "string"
                             }
                           },
-                          "type": "object"
+                          "type": "object",
+                          "x-polygon-go-type": {
+                            "name": "UnderlyingAsset"
+                          }
                         }
                       },
-                      "type": "object"
+                      "type": "object",
+                      "x-polygon-go-type": {
+                        "name": "OptionSnapshotResult"
+                      }
                     },
                     "status": {
                       "description": "The status of this request's response.",
@@ -23737,6 +23781,12 @@
                   },
                   "type": "object"
                 }
+              },
+              "text/csv": {
+                "schema": {
+                  "example": "break_even_price,day_close,day_high,day_last_updated,day_low,day_open,day_previous_close,day_volume,day_vwap,day_change,day_change_percent,details_contract_type,details_exercise_style,details_expiration_date,details_shares_per_contract,details_strike_price,details_ticker,greeks_delta,greeks_gamma,greeks_theta,greeks_vega,implied_volatility,last_quote_ask,last_quote_ask_size,last_quote_bid,last_quote_bid_size,last_quote_last_updated,last_quote_midpoint,last_quote_timeframe,open_interest,underlying_asset_change_to_break_even,underlying_asset_last_updated,underlying_asset_price,underlying_asset_ticker,underlying_asset_timeframe\n0,171.075,21.4,22.49,1636520400000000000,21.35,22.49,22.45,37,21.6741,-1.05,-4.67,call,american,2023-06-16,100,150,O:AAPL230616C00150000,0.5520187372272933,0.00706756515659829,-0.018532772783847958,0.7274811132998142,0.3048997097864957,21.25,110,20.9,172,1636573458756383500,21.075,REAL-TIME,8921,23.123999999999995,1636573459862384600,147.951,AAPL,REAL-TIME\n",
+                  "type": "string"
+                }
               }
             },
             "description": "Snapshot of the option contract."

type *polygon.PolygonClient has no field or method ListTickers

Describe the bug

Upon installing and initializing the client as proposed in README.md, it is not possible to use the client as the documentation suggests. The returned pointer does not seem to implement the client functionality.

To Reproduce

  1. Create a fresh go module using go mod init
  2. Add client using go get github.com/polygon-io/client-go
  3. Create a simple program as suggested by the documentation in README.md:
package main

import (
	"context"
	polygon "github.com/polygon-io/client-go/rest"
	"github.com/polygon-io/client-go/rest/models"
)

func main() {
	c := polygon.New("{REDACTED}")
	res, err := c.ListTickers(context.Background())
}
  1. Execute the program
> go run ptest.go                            
# command-line-arguments
./ptest.go:11:16: c.ListTickers undefined (type *polygon.PolygonClient has no field or method ListTickers)

Expected behavior

The client module should implement the client functions.

Additional context

> go version
go version go1.18.1 darwin/arm64

Broken compatibility to runtimes below 1.18

Due to recent commits compatibility has been broken to runtimes below 1.18, resulting in an extremely frustrating experience when trying to integrate the client in new projects that are impossible to run on 1.18.

To give more context and an example, Cloud Functions on GCP do not offer the latest go runtime (only up to 1.16).

In addition, for the future, in cases of heavy, established and maybe even professional usage, it is desired to be able to update the client in case the API itself changes without breaking compatibility to the runtime itself.

I think this needs to be, at least, clearly reflected in README.md.

I suggest creating separate branches for versions that are incompatible with estabilished runtimes.

REST Split type uses incorrect data types for From and To fields

Describe the bug

The rest API Split type contains incorrect data types for the SplitFrom and SplitTo fields. Currently, they're int64 and they should be float64.

type Split struct {
	ExecutionDate string `json:"execution_date,omitempty"`
	SplitFrom     int64  `json:"split_from,omitempty"` // should be float64
	SplitTo       int64  `json:"split_to,omitempty"` // should be float64
	Ticker        string `json:"ticker,omitempty"`
}

Expected behavior

We should find a backwards compatible way to support float64 values for these fields.

Additional context

Related PR. This PR was merged for now but we should likely roll it back and implement a backwards compatible fix.

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

Unmarshal error when running the example code (GetAllTickersSnapshot)

Describe the bug

GetAllTickersSnapshot fails to unmarshal the AccumulatedVolume value on MinuteSnapshot.

2023/01/06 09:29:47.837606 ERROR RESTY json: cannot unmarshal number 1.012021e+06 into Go struct field MinuteSnapshot.tickers.min.av of type int, Attempt 1 2023/01/06 09:29:47 failed to execute request: json: cannot unmarshal number 1.012021e+06 into Go struct field MinuteSnapshot.tickers.min.av of type int

To Reproduce

Run the example code shown in the "Using the Client" section of the readme. No changes to the example code are needed to reproduce the error on my end.

Expected behavior

GetAllTickersSnapshot should correctly handle the accumulated volume data.

Screenshots

Additional context

Go version 1.19

I was able to "fix" this error locally by changing the data type for the AccumulatedValue field to float64 instead of int.
Not sure if the schema is just out of date or if there may be some versioning issue.

Parsing time error 'GetMarketStatus'

When using the method GetMarketStatus

res, err := gRestClient.GetMarketStatus(context.Background())
if err != nil {
   logger.Error(err)
}

I get this error ->


2022/05/17 14:58:11.343078 ERROR RESTY parsing time "2022-05-17T08:58:11-04:00" as "2006-01-02T15:04:05Z": cannot parse "-04:00" as "Z", Attempt 1
2022-05-17T14:58:14.200+0200    ERROR   failed to execute request: parsing time "2022-05-17T08:58:11-04:00" as "2006-01-02T15:04:05Z": cannot parse "-04:00" as "Z"

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

Rest client ListTrades() doesn't respect params

Describe the bug

When using timestampGTE & timestampLTE with a time that ends with 0h 0m 0s 0ns, the API query is not generated properly.

To Reproduce

tz, _ := time.LoadLocation("America/New_York")
from := time.Date(2023, 1, 15, 0, 0, 0, 0, tz)
to := time.Date(2023, 1, 20, 0, 0, 0, 0, tz)
fromTS := models.Nanos(from)
toTS := models.Nanos(to)
iter := c.ListTrades(context.TODO(), &models.ListTradesParams{
	Ticker:       symbol,
	TimestampGTE: &fromTS,
	TimestampLTE: &toTS,
	Limit:        &limit,
	Order:        &order,
	Sort:         &sort,
}, models.APIKey(config.POLYGON_TOKEN))

Expected behavior

the iterator should return trades from the 19th until the 20th at midnight.

Screenshots

Screenshot 2023-01-29 at 15 39 16

Additional context

Issue comes from the assumption made here that if the time provided by the user trails with zero, it means that the user wants to send the date to the API.

Client update needed to match websocket.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -292,6 +292,14 @@
                       "type": "integer",
                       "description": "The condition."
                     },
+                    "i": {
+                      "type": "array",
+                      "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+                      "items": {
+                        "type": "integer",
+                        "description": "The indicator code.\n"
+                      }
+                    },
                     "t": {
                       "type": "integer",
                       "description": "The Timestamp in Unix MS."
@@ -312,6 +320,9 @@
                   "ap": 114.128,
                   "as": 160,
                   "c": 0,
+                  "i": [
+                    604
+                  ],
                   "t": 1536036818784,
                   "z": 3
                 }
@@ -2282,6 +2293,14 @@
             "type": "integer",
             "description": "The condition."
           },
+          "i": {
+            "type": "array",
+            "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
+            "items": {
+              "type": "integer",
+              "description": "The indicator code.\n"
+            }
+          },
           "t": {
             "type": "integer",
             "description": "The Timestamp in Unix MS."

WebSocket CryptoTrade type contains incorrect Symbol field

Describe the bug

Our WebSocket CryptoTrade type contains an incorrect variable name and JSON tag:

Symbol string `json:"sym,omitempty"`

This feed returns crypto pairs instead of ticker symbols so currently, users aren't able to see which crypto pair corresponds to the trade data.

To Reproduce

Connect to the Crypto WebSocket server via the client and subscribe to any ticker on the trades topic. The Symbol response field will always be empty.

Expected behavior

Ideally, it should be:

Pair string `json:"pair,omitempty"`

But that's unfortunately a breaking change so we'll have to fix it some other way. Here are a couple options:

Symbol string `json:"pair,omitempty"` // non-breaking and makes the JSON unmarshaling work correctly
Pair string `json:"pair,omitempty"` // new field with the correct name and JSON tag
Symbol string `json:"sym,omitempty"` // unchanged existing field that will either always be empty or contain identical data as Pair

Additional context

Related PR

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -3256,7 +3256,7 @@
     },
     "/v2/snapshot/locale/us/markets/stocks/tickers": {
       "get": {
-        "summary": "Snapshot - All Tickers",
+        "summary": "All Tickers",
         "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
@@ -3585,7 +3585,7 @@
     },
     "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}": {
       "get": {
-        "summary": "Snapshot - Ticker",
+        "summary": "Ticker",
         "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
@@ -3913,7 +3913,7 @@
     },
     "/v2/snapshot/locale/us/markets/stocks/{direction}": {
       "get": {
-        "summary": "Snapshot - Gainers/Losers",
+        "summary": "Gainers/Losers",
         "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "stocks:snapshot"
@@ -5954,7 +5954,7 @@
     },
     "/v2/snapshot/locale/global/markets/forex/tickers/{ticker}": {
       "get": {
-        "summary": "Snapshot - Ticker",
+        "summary": "Ticker",
         "description": "Get the current minute, day, and previous dayโ€™s aggregate, as well as the last trade and quote for a single traded currency symbol.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "fx:snapshot"
@@ -6216,7 +6216,7 @@
     },
     "/v2/snapshot/locale/global/markets/forex/tickers": {
       "get": {
-        "summary": "Snapshot - All Tickers",
+        "summary": "All Tickers",
         "description": "Get the current minute, day, and previous dayโ€™s aggregate, as well as the last trade and quote for all traded forex symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "fx:snapshot"
@@ -6473,7 +6473,7 @@
     },
     "/v2/snapshot/locale/global/markets/forex/{direction}": {
       "get": {
-        "summary": "Snapshot - Gainers/Losers",
+        "summary": "Gainers/Losers",
         "description": "Get the current top 20 gainers or losers of the day in forex markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "fx:snapshot"
@@ -7858,7 +7858,7 @@
     },
     "/v2/snapshot/locale/global/markets/crypto/tickers": {
       "get": {
-        "summary": "Snapshot - All Tickers",
+        "summary": "All Tickers",
         "description": "Get the current minute, day, and previous dayโ€™s aggregate, as well as the last trade and quote for all traded cryptocurrency symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "crypto:snapshot"
@@ -8155,7 +8155,7 @@
     },
     "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}": {
       "get": {
-        "summary": "Snapshot - Ticker",
+        "summary": "Ticker",
         "description": "Get the current minute, day, and previous dayโ€™s aggregate, as well as the last trade and quote for a single traded cryptocurrency symbol.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "crypto:snapshot"
@@ -8456,7 +8456,7 @@
     },
     "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book": {
       "get": {
-        "summary": "Snapshot - Ticker Full Book (L2)",
+        "summary": "Ticker Full Book (L2)",
         "description": "Get the current level 2 book of a single ticker. This is the combined book from all of the exchanges.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "crypto:snapshot"
@@ -8621,7 +8621,7 @@
     },
     "/v2/snapshot/locale/global/markets/crypto/{direction}": {
       "get": {
-        "summary": "Snapshot - Gainers/Losers",
+        "summary": "Gainers/Losers",
         "description": "Get the current top 20 gainers or losers of the day in cryptocurrency markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "crypto:snapshot"

Regarding your v1 branch.

Hi,

We started writing a polygon.io golang package but, noticed you are producing one yourselves (The v1 branch), that's great!

We want to use your version over ours and we will stop developing our package. However, if it's of interest to you, we open-source our implementation for you to look at and if you want to cherry-pick anything from there please do so. I do understand our design-patterns look different, so see this as a friendly gesture. Then when you release your or earlier, we will remove ours from being public on github.

Our implementation (MIT-License) can be found here ->

(Now removed)
https://github.com/tickup-se/go-polygon

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -2207,363 +2207,6 @@
         }
       }
     },
-    "/v2/last/trade/{stocksTicker}": {
-      "get": {
-        "summary": "Last Trade",
-        "description": "Get the most recent trade for a given stock.\n",
-        "tags": [
-          "stocks:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "stocksTicker",
-            "in": "path",
-            "description": "The ticker symbol of the stock/equity.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AAPL"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last trade for this stock.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "string",
-                                  "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n"
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                                },
-                                "s": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The size of a trade (also known as volume).\n"
-                                },
-                                "e": {
-                                  "type": "integer",
-                                  "description": "The trade correction indicator.\n"
-                                },
-                                "x": {
-                                  "type": "integer",
-                                  "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                },
-                                "r": {
-                                  "type": "integer",
-                                  "description": "The ID for the Trade Reporting Facility where the trade took place.\n"
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "f05562305bd26ced64b98ed68b3c5d96",
-                  "status": "OK",
-                  "results": {
-                    "T": "AAPL",
-                    "c": [
-                      37
-                    ],
-                    "f": 1617901342969796400,
-                    "i": "118749",
-                    "p": 129.8473,
-                    "q": 3135876,
-                    "r": 202,
-                    "s": 25,
-                    "t": 1617901342969834000,
-                    "x": 4,
-                    "y": 1617901342968000000,
-                    "z": 3
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "stocks",
-          "description": "Stocks data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
-    "/v2/last/nbbo/{stocksTicker}": {
-      "get": {
-        "summary": "Last Quote",
-        "description": "Get the most recent NBBO (Quote) tick for a given stock.\n",
-        "tags": [
-          "stocks:last:quote"
-        ],
-        "parameters": [
-          {
-            "name": "stocksTicker",
-            "in": "path",
-            "description": "The ticker symbol of the stock/equity.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AAPL"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last NBBO tick for this stock.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "array",
-                                  "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The indicator code.\n"
-                                  }
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The bid price."
-                                },
-                                "s": {
-                                  "type": "integer",
-                                  "description": "The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price."
-                                },
-                                "x": {
-                                  "allOf": [
-                                    {
-                                      "type": "integer",
-                                      "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                    },
-                                    {
-                                      "description": "Bid Exchange Id"
-                                    }
-                                  ]
-                                },
-                                "P": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The ask price."
-                                },
-                                "S": {
-                                  "type": "integer",
-                                  "description": "The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price."
-                                },
-                                "X": {
-                                  "allOf": [
-                                    {
-                                      "type": "integer",
-                                      "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                    },
-                                    {
-                                      "description": "Ask Exchange Id"
-                                    }
-                                  ]
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "b84e24636301f19f88e0dfbf9a45ed5c",
-                  "status": "OK",
-                  "results": {
-                    "P": 127.98,
-                    "S": 7,
-                    "T": "AAPL",
-                    "X": 19,
-                    "p": 127.96,
-                    "q": 83480742,
-                    "s": 1,
-                    "t": 1617827221349730300,
-                    "x": 11,
-                    "y": 1617827221349366000,
-                    "z": 3
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "stocks",
-          "description": "Stocks data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
     "/v1/open-close/{stocksTicker}/{date}": {
       "get": {
         "summary": "Daily Open/Close",
@@ -3291,7 +2934,7 @@
     "/v2/snapshot/locale/us/markets/stocks/tickers": {
       "get": {
         "summary": "All Tickers",
-        "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
+        "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -3641,7 +3284,7 @@
     "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}": {
       "get": {
         "summary": "Ticker",
-        "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
+        "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -3981,7 +3624,7 @@
     "/v2/snapshot/locale/us/markets/stocks/{direction}": {
       "get": {
         "summary": "Gainers/Losers",
-        "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
+        "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -4325,173 +3968,6 @@
         ]
       }
     },
-    "/v2/last/trade/{optionsTicker}": {
-      "get": {
-        "summary": "Last Trade",
-        "description": "Get the most recent trade for a given options contract.\n",
-        "tags": [
-          "options:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "optionsTicker",
-            "in": "path",
-            "description": "The ticker symbol of the options contract.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "O:TSLA210903C00700000"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last trade for this options contract.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "string",
-                                  "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n"
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                                },
-                                "s": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The size of a trade (also known as volume).\n"
-                                },
-                                "e": {
-                                  "type": "integer",
-                                  "description": "The trade correction indicator.\n"
-                                },
-                                "x": {
-                                  "type": "integer",
-                                  "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                },
-                                "r": {
-                                  "type": "integer",
-                                  "description": "The ID for the Trade Reporting Facility where the trade took place.\n"
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "f05562305bd26ced64b98ed68b3c5d96",
-                  "status": "OK",
-                  "results": {
-                    "T": "O:TSLA210903C00700000",
-                    "c": [
-                      227
-                    ],
-                    "f": 1617901342969796400,
-                    "i": "",
-                    "p": 115.55,
-                    "q": 1325541950,
-                    "r": 202,
-                    "s": 25,
-                    "t": 1617901342969834000,
-                    "x": 312
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "options",
-          "description": "Options data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
     "/v1/open-close/{optionsTicker}/{date}": {
       "get": {
         "summary": "Daily Open/Close",
@@ -5206,272 +4682,6 @@
         }
       }
     },
-    "/v1/conversion/{from}/{to}": {
-      "get": {
-        "summary": "Real-time Currency Conversion",
-        "description": "Get currency conversions using the latest market conversion rates. Note than you can convert in both directions. For example USD to CAD or CAD to USD.\n",
-        "tags": [
-          "fx:conversion"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AUD"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          },
-          {
-            "name": "amount",
-            "in": "query",
-            "description": "The amount to convert, with a decimal.",
-            "required": false,
-            "schema": {
-              "type": "integer"
-            },
-            "example": 100
-          },
-          {
-            "name": "precision",
-            "in": "query",
-            "description": "The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy.",
-            "required": false,
-            "schema": {
-              "type": "integer",
-              "enum": [
-                0,
-                1,
-                2,
-                3,
-                4
-              ]
-            },
-            "example": 2
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last tick for this currency pair, plus the converted amount for the requested amount.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "ask": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The ask price."
-                            },
-                            "bid": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The bid price."
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "from": {
-                          "type": "string",
-                          "description": "The \"from\" currency symbol."
-                        },
-                        "to": {
-                          "type": "string",
-                          "description": "The \"to\" currency symbol."
-                        },
-                        "initialAmount": {
-                          "type": "number",
-                          "format": "double",
-                          "description": "The amount to convert."
-                        },
-                        "converted": {
-                          "type": "number",
-                          "format": "double",
-                          "description": "The result of the conversion."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "status": "success",
-                  "last": {
-                    "bid": 1.3672596,
-                    "ask": 1.3673344,
-                    "exchange": 48,
-                    "timestamp": 1605555313000
-                  },
-                  "from": "AUD",
-                  "to": "USD",
-                  "initialAmount": 100,
-                  "converted": 73.14
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "fx",
-          "description": "Forex data"
-        }
-      }
-    },
-    "/v1/last_quote/currencies/{from}/{to}": {
-      "get": {
-        "summary": "Last Quote for a Currency Pair",
-        "description": "Get the last quote tick for a forex currency pair.\n",
-        "tags": [
-          "fx:last:quote"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AUD"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last quote tick for this currency pair.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "ask": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The ask price."
-                            },
-                            "bid": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The bid price."
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "symbol": {
-                          "type": "string",
-                          "description": "The symbol pair that was evaluated from the request."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "last": {
-                    "ask": 0.73124,
-                    "bid": 0.73122,
-                    "exchange": 48,
-                    "timestamp": 1605557756000
-                  },
-                  "request_id": "a73a29dbcab4613eeaf48583d3baacf0",
-                  "status": "success",
-                  "symbol": "AUD/USD"
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "fx",
-          "description": "Forex data"
-        }
-      }
-    },
     "/v2/aggs/grouped/locale/global/market/fx/{date}": {
       "get": {
         "summary": "Grouped Daily (Bars)",
@@ -6823,133 +6033,6 @@
         ]
       }
     },
-    "/v1/last/crypto/{from}/{to}": {
-      "get": {
-        "summary": "Last Trade for a Crypto Pair",
-        "description": "Get the last trade tick for a cryptocurrency pair.\n",
-        "tags": [
-          "crypto:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "BTC"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last tick for this currency pair.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "conditions": {
-                              "type": "array",
-                              "description": "A list of condition codes.\n",
-                              "items": {
-                                "type": "integer",
-                                "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                              }
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange that this crypto trade happened on.  \nSee <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs.\n"
-                            },
-                            "price": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                            },
-                            "size": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The size of a trade (also known as volume).\n"
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "symbol": {
-                          "type": "string",
-                          "description": "The symbol pair that was evaluated from the request."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "last": {
-                    "conditions": [
-                      1
-                    ],
-                    "exchange": 4,
-                    "price": 16835.42,
-                    "size": 0.006909,
-                    "timestamp": 1605560885027
-                  },
-                  "request_id": "d2d779df015fe2b7fbb8e58366610ef7",
-                  "status": "success",
-                  "symbol": "BTC-USD"
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "crypto",
-          "description": "Crypto data"
-        }
-      }
-    },
     "/v1/open-close/crypto/{from}/{to}/{date}": {
       "get": {
         "summary": "Daily Open/Close",

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -2207,363 +2207,6 @@
         }
       }
     },
-    "/v2/last/trade/{stocksTicker}": {
-      "get": {
-        "summary": "Last Trade",
-        "description": "Get the most recent trade for a given stock.\n",
-        "tags": [
-          "stocks:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "stocksTicker",
-            "in": "path",
-            "description": "The ticker symbol of the stock/equity.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AAPL"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last trade for this stock.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "string",
-                                  "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n"
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                                },
-                                "s": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The size of a trade (also known as volume).\n"
-                                },
-                                "e": {
-                                  "type": "integer",
-                                  "description": "The trade correction indicator.\n"
-                                },
-                                "x": {
-                                  "type": "integer",
-                                  "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                },
-                                "r": {
-                                  "type": "integer",
-                                  "description": "The ID for the Trade Reporting Facility where the trade took place.\n"
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "f05562305bd26ced64b98ed68b3c5d96",
-                  "status": "OK",
-                  "results": {
-                    "T": "AAPL",
-                    "c": [
-                      37
-                    ],
-                    "f": 1617901342969796400,
-                    "i": "118749",
-                    "p": 129.8473,
-                    "q": 3135876,
-                    "r": 202,
-                    "s": 25,
-                    "t": 1617901342969834000,
-                    "x": 4,
-                    "y": 1617901342968000000,
-                    "z": 3
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "stocks",
-          "description": "Stocks data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
-    "/v2/last/nbbo/{stocksTicker}": {
-      "get": {
-        "summary": "Last Quote",
-        "description": "Get the most recent NBBO (Quote) tick for a given stock.\n",
-        "tags": [
-          "stocks:last:quote"
-        ],
-        "parameters": [
-          {
-            "name": "stocksTicker",
-            "in": "path",
-            "description": "The ticker symbol of the stock/equity.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AAPL"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last NBBO tick for this stock.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "array",
-                                  "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The indicator code.\n"
-                                  }
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The bid price."
-                                },
-                                "s": {
-                                  "type": "integer",
-                                  "description": "The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price."
-                                },
-                                "x": {
-                                  "allOf": [
-                                    {
-                                      "type": "integer",
-                                      "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                    },
-                                    {
-                                      "description": "Bid Exchange Id"
-                                    }
-                                  ]
-                                },
-                                "P": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The ask price."
-                                },
-                                "S": {
-                                  "type": "integer",
-                                  "description": "The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price."
-                                },
-                                "X": {
-                                  "allOf": [
-                                    {
-                                      "type": "integer",
-                                      "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                    },
-                                    {
-                                      "description": "Ask Exchange Id"
-                                    }
-                                  ]
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "b84e24636301f19f88e0dfbf9a45ed5c",
-                  "status": "OK",
-                  "results": {
-                    "P": 127.98,
-                    "S": 7,
-                    "T": "AAPL",
-                    "X": 19,
-                    "p": 127.96,
-                    "q": 83480742,
-                    "s": 1,
-                    "t": 1617827221349730300,
-                    "x": 11,
-                    "y": 1617827221349366000,
-                    "z": 3
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "stocks",
-          "description": "Stocks data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
     "/v1/open-close/{stocksTicker}/{date}": {
       "get": {
         "summary": "Daily Open/Close",
@@ -3291,7 +2934,7 @@
     "/v2/snapshot/locale/us/markets/stocks/tickers": {
       "get": {
         "summary": "All Tickers",
-        "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
+        "description": "Get the most up-to-date market data for all traded stock symbols.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -3641,7 +3284,7 @@
     "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}": {
       "get": {
         "summary": "Ticker",
-        "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
+        "description": "Get the most up-to-date market data for a single traded stock ticker.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -3981,7 +3624,7 @@
     "/v2/snapshot/locale/us/markets/stocks/{direction}": {
       "get": {
         "summary": "Gainers/Losers",
-        "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n",
+        "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n<br />\n<br />\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n<br />\n<br />\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges.\n",
         "tags": [
           "stocks:snapshot"
         ],
@@ -4325,173 +3968,6 @@
         ]
       }
     },
-    "/v2/last/trade/{optionsTicker}": {
-      "get": {
-        "summary": "Last Trade",
-        "description": "Get the most recent trade for a given options contract.\n",
-        "tags": [
-          "options:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "optionsTicker",
-            "in": "path",
-            "description": "The ticker symbol of the options contract.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "O:TSLA210903C00700000"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last trade for this options contract.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        },
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "results": {
-                          "allOf": [
-                            {
-                              "type": "object",
-                              "properties": {
-                                "T": {
-                                  "type": "string",
-                                  "description": "The exchange symbol that this item is traded under."
-                                },
-                                "t": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it."
-                                },
-                                "y": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange."
-                                },
-                                "f": {
-                                  "type": "integer",
-                                  "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message."
-                                },
-                                "q": {
-                                  "type": "integer",
-                                  "format": "int64",
-                                  "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
-                                }
-                              }
-                            },
-                            {
-                              "type": "object",
-                              "properties": {
-                                "c": {
-                                  "type": "array",
-                                  "description": "A list of condition codes.\n",
-                                  "items": {
-                                    "type": "integer",
-                                    "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                                  }
-                                },
-                                "i": {
-                                  "type": "string",
-                                  "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n"
-                                },
-                                "p": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                                },
-                                "s": {
-                                  "type": "number",
-                                  "format": "double",
-                                  "description": "The size of a trade (also known as volume).\n"
-                                },
-                                "e": {
-                                  "type": "integer",
-                                  "description": "The trade correction indicator.\n"
-                                },
-                                "x": {
-                                  "type": "integer",
-                                  "description": "The exchange ID. See <a href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                                },
-                                "r": {
-                                  "type": "integer",
-                                  "description": "The ID for the Trade Reporting Facility where the trade took place.\n"
-                                },
-                                "z": {
-                                  "type": "integer",
-                                  "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n"
-                                }
-                              }
-                            }
-                          ]
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "request_id": "f05562305bd26ced64b98ed68b3c5d96",
-                  "status": "OK",
-                  "results": {
-                    "T": "O:TSLA210903C00700000",
-                    "c": [
-                      227
-                    ],
-                    "f": 1617901342969796400,
-                    "i": "",
-                    "p": 115.55,
-                    "q": 1325541950,
-                    "r": 202,
-                    "s": 25,
-                    "t": 1617901342969834000,
-                    "x": 312
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Unauthorized - Check our API Key and account status"
-          },
-          "404": {
-            "description": "The specified resource was not found"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "options",
-          "description": "Options data"
-        },
-        "x-polygon-entitlement-allowed-timeframes": [
-          {
-            "name": "realtime",
-            "description": "Real Time Data"
-          },
-          {
-            "name": "delayed",
-            "description": "15 minute delayed data"
-          }
-        ]
-      }
-    },
     "/v1/open-close/{optionsTicker}/{date}": {
       "get": {
         "summary": "Daily Open/Close",
@@ -5206,272 +4682,6 @@
         }
       }
     },
-    "/v1/conversion/{from}/{to}": {
-      "get": {
-        "summary": "Real-time Currency Conversion",
-        "description": "Get currency conversions using the latest market conversion rates. Note than you can convert in both directions. For example USD to CAD or CAD to USD.\n",
-        "tags": [
-          "fx:conversion"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AUD"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          },
-          {
-            "name": "amount",
-            "in": "query",
-            "description": "The amount to convert, with a decimal.",
-            "required": false,
-            "schema": {
-              "type": "integer"
-            },
-            "example": 100
-          },
-          {
-            "name": "precision",
-            "in": "query",
-            "description": "The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy.",
-            "required": false,
-            "schema": {
-              "type": "integer",
-              "enum": [
-                0,
-                1,
-                2,
-                3,
-                4
-              ]
-            },
-            "example": 2
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last tick for this currency pair, plus the converted amount for the requested amount.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "ask": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The ask price."
-                            },
-                            "bid": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The bid price."
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "from": {
-                          "type": "string",
-                          "description": "The \"from\" currency symbol."
-                        },
-                        "to": {
-                          "type": "string",
-                          "description": "The \"to\" currency symbol."
-                        },
-                        "initialAmount": {
-                          "type": "number",
-                          "format": "double",
-                          "description": "The amount to convert."
-                        },
-                        "converted": {
-                          "type": "number",
-                          "format": "double",
-                          "description": "The result of the conversion."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "status": "success",
-                  "last": {
-                    "bid": 1.3672596,
-                    "ask": 1.3673344,
-                    "exchange": 48,
-                    "timestamp": 1605555313000
-                  },
-                  "from": "AUD",
-                  "to": "USD",
-                  "initialAmount": 100,
-                  "converted": 73.14
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "fx",
-          "description": "Forex data"
-        }
-      }
-    },
-    "/v1/last_quote/currencies/{from}/{to}": {
-      "get": {
-        "summary": "Last Quote for a Currency Pair",
-        "description": "Get the last quote tick for a forex currency pair.\n",
-        "tags": [
-          "fx:last:quote"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "AUD"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last quote tick for this currency pair.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "ask": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The ask price."
-                            },
-                            "bid": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The bid price."
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange ID. See <a href=\"https://polygon.io/docs/forex/get_v3_reference_exchanges\" alt=\"Exchanges\">Exchanges</a> for Polygon.io's mapping of exchange IDs."
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "symbol": {
-                          "type": "string",
-                          "description": "The symbol pair that was evaluated from the request."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "last": {
-                    "ask": 0.73124,
-                    "bid": 0.73122,
-                    "exchange": 48,
-                    "timestamp": 1605557756000
-                  },
-                  "request_id": "a73a29dbcab4613eeaf48583d3baacf0",
-                  "status": "success",
-                  "symbol": "AUD/USD"
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "nbbo",
-          "description": "NBBO data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "fx",
-          "description": "Forex data"
-        }
-      }
-    },
     "/v2/aggs/grouped/locale/global/market/fx/{date}": {
       "get": {
         "summary": "Grouped Daily (Bars)",
@@ -6823,133 +6033,6 @@
         ]
       }
     },
-    "/v1/last/crypto/{from}/{to}": {
-      "get": {
-        "summary": "Last Trade for a Crypto Pair",
-        "description": "Get the last trade tick for a cryptocurrency pair.\n",
-        "tags": [
-          "crypto:last:trade"
-        ],
-        "parameters": [
-          {
-            "name": "from",
-            "in": "path",
-            "description": "The \"from\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "BTC"
-          },
-          {
-            "name": "to",
-            "in": "path",
-            "description": "The \"to\" symbol of the pair.",
-            "required": true,
-            "schema": {
-              "type": "string"
-            },
-            "example": "USD"
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "The last tick for this currency pair.",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "type": "object",
-                      "properties": {
-                        "status": {
-                          "type": "string",
-                          "description": "The status of this request's response."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "request_id": {
-                          "type": "string",
-                          "description": "A request id assigned by the server."
-                        }
-                      }
-                    },
-                    {
-                      "type": "object",
-                      "properties": {
-                        "last": {
-                          "type": "object",
-                          "properties": {
-                            "conditions": {
-                              "type": "array",
-                              "description": "A list of condition codes.\n",
-                              "items": {
-                                "type": "integer",
-                                "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n"
-                              }
-                            },
-                            "exchange": {
-                              "type": "integer",
-                              "description": "The exchange that this crypto trade happened on.  \nSee <a href=\"https://polygon.io/docs/crypto/get_v3_reference_exchanges\">Exchanges</a> for a mapping of exchanges to IDs.\n"
-                            },
-                            "price": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.\n"
-                            },
-                            "size": {
-                              "type": "number",
-                              "format": "double",
-                              "description": "The size of a trade (also known as volume).\n"
-                            },
-                            "timestamp": {
-                              "type": "integer",
-                              "description": "The Unix Msec timestamp for the start of the aggregate window."
-                            }
-                          }
-                        },
-                        "symbol": {
-                          "type": "string",
-                          "description": "The symbol pair that was evaluated from the request."
-                        }
-                      }
-                    }
-                  ]
-                },
-                "example": {
-                  "last": {
-                    "conditions": [
-                      1
-                    ],
-                    "exchange": 4,
-                    "price": 16835.42,
-                    "size": 0.006909,
-                    "timestamp": 1605560885027
-                  },
-                  "request_id": "d2d779df015fe2b7fbb8e58366610ef7",
-                  "status": "success",
-                  "symbol": "BTC-USD"
-                }
-              }
-            }
-          },
-          "default": {
-            "description": "Unexpected error"
-          }
-        },
-        "x-polygon-entitlement-data-type": {
-          "name": "trades",
-          "description": "Trade data"
-        },
-        "x-polygon-entitlement-market-type": {
-          "name": "crypto",
-          "description": "Crypto data"
-        }
-      }
-    },
     "/v1/open-close/crypto/{from}/{to}/{date}": {
       "get": {
         "summary": "Daily Open/Close",

Question: Why is Exchange of type *int in ListTickersParams?

Looking at ListTickersParams, it is defined as:

// Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes at
// the ISO org website. Defaults to empty string which queries all exchanges.
Exchange *int `query:"exchange"`

Notice it is of type *int, I am wondering why that is?

From the documentation comment above the field:

...Defaults to empty string which queries all exchanges.

Also, when I use Polygon's website, I enter a string for the exchange parameter, for example if I wanted to filter for XNAS

https://api.polygon.io/v3/reference/tickers?exchange=XNAS&apiKey=mykey

image

This gives me results like so:

{
    "results": [
        {
            "ticker": "AACG",
            "name": "ATA Creativity Global American Depositary Shares",
            "market": "stocks",
            "locale": "us",
            "primary_exchange": "XNAS",
            "type": "ADRC",
            "active": true,
            "currency_name": "usd",
            "cik": "0001420529",
            "composite_figi": "BBG000V2S3P6",
            "share_class_figi": "BBG001T125S9",
            "last_updated_utc": "2022-11-23T00:00:00Z"
        },
        ...
    ]
}

shouldn't this be of type *string in ListTickersParams?

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -185,6 +185,14 @@
                     "q": {
                       "type": "integer",
                       "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+                    },
+                    "trfi": {
+                      "type": "integer",
+                      "description": "The ID for the Trade Reporting Facility where the trade took place."
+                    },
+                    "trft": {
+                      "type": "integer",
+                      "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
                     }
                   }
                 },
@@ -2247,6 +2255,14 @@
           "q": {
             "type": "integer",
             "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n"
+          },
+          "trfi": {
+            "type": "integer",
+            "description": "The ID for the Trade Reporting Facility where the trade took place."
+          },
+          "trft": {
+            "type": "integer",
+            "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n"
           }
         }
       },

Client update needed to match rest.json spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/specs/rest.json
@@ -512,7 +512,17 @@
                 "WARRANT",
                 "INDEX",
                 "ETF",
-                "ETN"
+                "ETN",
+                "OS",
+                "GDR",
+                "OTHER",
+                "NYRS",
+                "AGEN",
+                "EQLK",
+                "BOND",
+                "ADRW",
+                "BASKET",
+                "LT"
               ]
             }
           },
@@ -526,7 +536,8 @@
               "enum": [
                 "stocks",
                 "crypto",
-                "fx"
+                "fx",
+                "otc"
               ]
             }
           },
@@ -661,7 +672,7 @@
                       "properties": {
                         "results": {
                           "type": "array",
-                          "description": "An array of tickers that match your query.\n\nNote: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response.                                                                                                                                                                                                                                                                                                   \n",
+                          "description": "An array of tickers that match your query.\n\nNote: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response.\n",
                           "items": {
                             "type": "object",
                             "properties": {
@@ -679,7 +690,8 @@
                                 "enum": [
                                   "stocks",
                                   "crypto",
-                                  "fx"
+                                  "fx",
+                                  "otc"
                                 ]
                               },
                               "locale": {
@@ -872,7 +884,8 @@
                               "enum": [
                                 "stocks",
                                 "crypto",
-                                "fx"
+                                "fx",
+                                "otc"
                               ]
                             },
                             "locale": {
@@ -2637,6 +2650,10 @@
                       "format": "double",
                       "description": "The trading volume of the symbol in the given time period."
                     },
+                    "otc": {
+                      "type": "boolean",
+                      "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
+                    },
                     "preMarket": {
                       "type": "integer",
                       "description": "The open price of the ticker symbol in pre-market trading."
@@ -2704,6 +2721,15 @@
               "type": "boolean"
             },
             "example": true
+          },
+          {
+            "name": "include_otc",
+            "in": "query",
+            "description": "Include OTC securities in the response. Default is false (don't include OTC securities).\n",
+            "required": false,
+            "schema": {
+              "type": "boolean"
+            }
           }
         ],
         "responses": {
@@ -2787,6 +2813,10 @@
                               "n": {
                                 "type": "number",
                                 "description": "The number of transactions in the aggregate window."
+                              },
+                              "otc": {
+                                "type": "boolean",
+                                "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                               }
                             }
                           }
@@ -3199,6 +3229,10 @@
                               "n": {
                                 "type": "number",
                                 "description": "The number of transactions in the aggregate window."
+                              },
+                              "otc": {
+                                "type": "boolean",
+                                "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                               }
                             }
                           }
@@ -3272,6 +3306,15 @@
                 "type": "string"
               }
             }
+          },
+          {
+            "name": "include_otc",
+            "in": "query",
+            "description": "Include OTC securities in the response. Default is false (don't include OTC securities).\n",
+            "required": false,
+            "schema": {
+              "type": "boolean"
+            }
           }
         ],
         "responses": {
@@ -3335,6 +3378,10 @@
                                     "type": "number",
                                     "format": "double",
                                     "description": "The volume weighted average price."
+                                  },
+                                  "otc": {
+                                    "type": "boolean",
+                                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                   }
                                 }
                               },
@@ -3437,6 +3484,10 @@
                                     "type": "number",
                                     "format": "double",
                                     "description": "The volume weighted average price."
+                                  },
+                                  "otc": {
+                                    "type": "boolean",
+                                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                   }
                                 }
                               },
@@ -3473,6 +3524,10 @@
                                     "type": "number",
                                     "format": "double",
                                     "description": "The volume weighted average price."
+                                  },
+                                  "otc": {
+                                    "type": "boolean",
+                                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                   }
                                 }
                               },
@@ -3666,6 +3721,10 @@
                                   "type": "number",
                                   "format": "double",
                                   "description": "The volume weighted average price."
+                                },
+                                "otc": {
+                                  "type": "boolean",
+                                  "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                 }
                               }
                             },
@@ -3768,6 +3827,10 @@
                                   "type": "number",
                                   "format": "double",
                                   "description": "The volume weighted average price."
+                                },
+                                "otc": {
+                                  "type": "boolean",
+                                  "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                 }
                               }
                             },
@@ -3804,6 +3867,10 @@
                                   "type": "number",
                                   "format": "double",
                                   "description": "The volume weighted average price."
+                                },
+                                "otc": {
+                                  "type": "boolean",
+                                  "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                 }
                               }
                             },
@@ -3991,6 +4058,10 @@
                                     "type": "number",
                                     "format": "double",
                                     "description": "The volume weighted average price."
+                                  },
+                                  "otc": {
+                                    "type": "boolean",
+                                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                   }
                                 }
                               },
@@ -4093,6 +4164,10 @@
                                     "type": "number",
                                     "format": "double",
                                     "description": "The volume weighted average price."
+                                  },
+                                  "otc": {
+                                    "type": "boolean",
+                                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                   }
                                 }
                               },
@@ -4129,6 +4204,10 @@
                                     "type": "number",
                                     "format": "double",
                                     "description": "The volume weighted average price."
+                                  },
+                                  "otc": {
+                                    "type": "boolean",
+                                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                                   }
                                 }
                               },
@@ -4490,6 +4569,10 @@
                       "format": "double",
                       "description": "The trading volume of the symbol in the given time period."
                     },
+                    "otc": {
+                      "type": "boolean",
+                      "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
+                    },
                     "preMarket": {
                       "type": "integer",
                       "description": "The open price of the ticker symbol in pre-market trading."
@@ -9664,6 +9747,10 @@
         "type": "number",
         "description": "The number of transactions in the aggregate window."
       },
+      "OTC": {
+        "type": "boolean",
+        "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
+      },
       "Open": {
         "type": "number",
         "format": "double",
@@ -9856,12 +9943,71 @@
                 "n": {
                   "type": "number",
                   "description": "The number of transactions in the aggregate window."
+                },
+                "otc": {
+                  "type": "boolean",
+                  "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                 }
               }
             }
           }
         }
       },
+      "StocksTickerResultsOTC": {
+        "type": "object",
+        "properties": {
+          "results": {
+            "type": "array",
+            "items": {
+              "type": "object",
+              "properties": {
+                "o": {
+                  "type": "number",
+                  "format": "double",
+                  "description": "The open price for the symbol in the given time period."
+                },
+                "h": {
+                  "type": "number",
+                  "format": "double",
+                  "description": "The highest price for the symbol in the given time period."
+                },
+                "l": {
+                  "type": "number",
+                  "format": "double",
+                  "description": "The lowest price for the symbol in the given time period."
+                },
+                "c": {
+                  "type": "number",
+                  "format": "double",
+                  "description": "The close price for the symbol in the given time period."
+                },
+                "v": {
+                  "type": "number",
+                  "format": "double",
+                  "description": "The trading volume of the symbol in the given time period."
+                },
+                "vw": {
+                  "type": "number",
+                  "format": "double",
+                  "description": "The volume weighted average price."
+                },
+                "t": {
+                  "type": "integer",
+                  "description": "The Unix Msec timestamp for the start of the aggregate window."
+                },
+                "n": {
+                  "type": "number",
+                  "description": "The number of transactions in the aggregate window."
+                },
+                "otc": {
+                  "type": "boolean",
+                  "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
+                }
+              }
+            }
+          }
+        }
+      },
       "ForexGroupedResults": {
         "type": "object",
         "properties": {
@@ -10121,6 +10261,45 @@
           }
         }
       },
+      "SnapshotOHLCVVWOtc": {
+        "type": "object",
+        "properties": {
+          "o": {
+            "type": "number",
+            "format": "double",
+            "description": "The open price for the symbol in the given time period."
+          },
+          "h": {
+            "type": "number",
+            "format": "double",
+            "description": "The highest price for the symbol in the given time period."
+          },
+          "l": {
+            "type": "number",
+            "format": "double",
+            "description": "The lowest price for the symbol in the given time period."
+          },
+          "c": {
+            "type": "number",
+            "format": "double",
+            "description": "The close price for the symbol in the given time period."
+          },
+          "v": {
+            "type": "number",
+            "format": "double",
+            "description": "The trading volume of the symbol in the given time period."
+          },
+          "vw": {
+            "type": "number",
+            "format": "double",
+            "description": "The volume weighted average price."
+          },
+          "otc": {
+            "type": "boolean",
+            "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
+          }
+        }
+      },
       "StocksSnapshotLastQuote": {
         "type": "object",
         "properties": {
@@ -10187,6 +10366,49 @@
           }
         }
       },
+      "StocksSnapshotMinuteOTC": {
+        "type": "object",
+        "properties": {
+          "av": {
+            "type": "integer",
+            "description": "The accumulated volume."
+          },
+          "o": {
+            "type": "number",
+            "format": "double",
+            "description": "The open price for the symbol in the given time period."
+          },
+          "h": {
+            "type": "number",
+            "format": "double",
+            "description": "The highest price for the symbol in the given time period."
+          },
+          "l": {
+            "type": "number",
+            "format": "double",
+            "description": "The lowest price for the symbol in the given time period."
+          },
+          "c": {
+            "type": "number",
+            "format": "double",
+            "description": "The close price for the symbol in the given time period."
+          },
+          "v": {
+            "type": "number",
+            "format": "double",
+            "description": "The trading volume of the symbol in the given time period."
+          },
+          "vw": {
+            "type": "number",
+            "format": "double",
+            "description": "The volume weighted average price."
+          },
+          "otc": {
+            "type": "boolean",
+            "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
+          }
+        }
+      },
       "StocksSnapshotTickers": {
         "type": "object",
         "properties": {
@@ -10228,6 +10450,10 @@
                       "type": "number",
                       "format": "double",
                       "description": "The volume weighted average price."
+                    },
+                    "otc": {
+                      "type": "boolean",
+                      "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                     }
                   }
                 },
@@ -10330,6 +10556,10 @@
                       "type": "number",
                       "format": "double",
                       "description": "The volume weighted average price."
+                    },
+                    "otc": {
+                      "type": "boolean",
+                      "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                     }
                   }
                 },
@@ -10366,6 +10596,10 @@
                       "type": "number",
                       "format": "double",
                       "description": "The volume weighted average price."
+                    },
+                    "otc": {
+                      "type": "boolean",
+                      "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                     }
                   }
                 },
@@ -10431,6 +10665,10 @@
                     "type": "number",
                     "format": "double",
                     "description": "The volume weighted average price."
+                  },
+                  "otc": {
+                    "type": "boolean",
+                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                   }
                 }
               },
@@ -10533,6 +10771,10 @@
                     "type": "number",
                     "format": "double",
                     "description": "The volume weighted average price."
+                  },
+                  "otc": {
+                    "type": "boolean",
+                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                   }
                 }
               },
@@ -10569,6 +10811,10 @@
                     "type": "number",
                     "format": "double",
                     "description": "The volume weighted average price."
+                  },
+                  "otc": {
+                    "type": "boolean",
+                    "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
                   }
                 }
               },
@@ -11433,7 +11679,7 @@
         "properties": {
           "results": {
             "type": "array",
-            "description": "An array of tickers that match your query.\n\nNote: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response.                                                                                                                                                                                                                                                                                                   \n",
+            "description": "An array of tickers that match your query.\n\nNote: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response.\n",
             "items": {
               "type": "object",
               "properties": {
@@ -11451,7 +11697,8 @@
                   "enum": [
                     "stocks",
                     "crypto",
-                    "fx"
+                    "fx",
+                    "otc"
                   ]
                 },
                 "locale": {
@@ -11532,7 +11779,8 @@
                 "enum": [
                   "stocks",
                   "crypto",
-                  "fx"
+                  "fx",
+                  "otc"
                 ]
               },
               "locale": {
@@ -12236,6 +12484,10 @@
             "format": "double",
             "description": "The trading volume of the symbol in the given time period."
           },
+          "otc": {
+            "type": "boolean",
+            "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false."
+          },
           "preMarket": {
             "type": "integer",
             "description": "The open price of the ticker symbol in pre-market trading."
@@ -13259,6 +13511,15 @@
         },
         "example": "gainers"
       },
+      "IncludeOTC": {
+        "name": "include_otc",
+        "in": "query",
+        "description": "Include OTC securities in the response. Default is false (don't include OTC securities).\n",
+        "required": false,
+        "schema": {
+          "type": "boolean"
+        }
+      },
       "LimitMax50000": {
         "name": "limit",
         "in": "query",

Client update needed to match WebSocket spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/websocket.json
+++ https://api.polygon.io/specs/websocket.json
@@ -312,6 +312,10 @@
                       "type": "integer",
                       "description": "The Timestamp in Unix MS."
                     },
+                    "q": {
+                      "type": "integer",
+                      "description": "The sequence number represents the sequence in which quote events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day.\n"
+                    },
                     "z": {
                       "type": "integer",
                       "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq)."
@@ -332,6 +336,7 @@
                     604
                   ],
                   "t": 1536036818784,
+                  "q": 50385480,
                   "z": 3
                 }
               }
@@ -2321,6 +2326,10 @@
             "type": "integer",
             "description": "The Timestamp in Unix MS."
           },
+          "q": {
+            "type": "integer",
+            "description": "The sequence number represents the sequence in which quote events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day.\n"
+          },
           "z": {
             "type": "integer",
             "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq)."

Unable to stream Forex

Describe the bug
I am configuring the streaming for Forex and cannot get the Aggreate Minute to work.

To Reproduce
Steps to reproduce the behavior:

  1. Create a websocket connection
        const APIKEY = "YOUR_API_KEY"
        const CHANNELS = "CA.*"

        c, _, err := websocket.DefaultDialer.Dial("wss://socket.polygon.io/stocks", nil)
	if err != nil {
		panic(err)
	}
	defer c.Close()

        logrus.Info("Trying to subscribe to: ", CHANNELS)
	_ = c.WriteMessage(websocket.TextMessage, []byte(fmt.Sprintf("{\"action\":\"auth\",\"params\":\"%s\"}", APIKEY)))
	_ = c.WriteMessage(websocket.TextMessage, []byte(fmt.Sprintf("{\"action\":\"subscribe\",\"params\":\"%s\"}", CHANNELS)))

	// Buffered channel to account for bursts or spikes in data:
	chanMessages := make(chan interface{}, 10000)

	// Read messages off the buffered queue:
	go func() {
		for msgBytes := range chanMessages {
			logrus.Info("Message Bytes: ", msgBytes)
		}
	}()

	// As little logic as possible in the reader loop:
	for {
		var msg interface{}
		err := c.ReadJSON(&msg)
		// Ideally use c.ReadMessage instead of ReadJSON so you can parse the JSON data in a
		// separate go routine. Any processing done in this loop increases the chances of disconnects
		// due to not consuming the data fast enough.
		if err != nil {
			panic(err)
		}
		chanMessages <- msg
	}
  1. Subscribe using the documentation https://polygon.io/docs/forex/ws_getting-started settings of "CA.*", and also tried "CA.C:EUR-USD".
  2. See that the channel never gets subscribed

Expected behavior
I would expect when I use the parameters specified in the documentation to subscribe to a stream that it would be subscribed and provide results. The parameters specified for Stocks in the documentation works ok, but not for Forex.

Screenshots

Expected subscribed message when using T.QQQ

INFO[0001] Trying to subscribe to: T.QQQ                
INFO[0001] Message Bytes: [map[ev:status message:Connected Successfully status:connected]] 
INFO[0001] Message Bytes: [map[ev:status message:authenticated status:auth_success]] 
INFO[0001] Message Bytes: [map[ev:status message:subscribed to: T.QQQ status:success]]  

DO NOT see subscribed when using "CA.*"

INFO[0001] Trying to subscribe to: CA.*                 
INFO[0001] Message Bytes: [map[ev:status message:Connected Successfully status:connected]] 
INFO[0001] Message Bytes: [map[ev:status message:authenticated status:auth_success]]

DO NOT see subscribed when using "CA.C:EUR-USD"

INFO[0001] Trying to subscribe to: CA.C:EUR-USD         
INFO[0001] Message Bytes: [map[ev:status message:Connected Successfully status:connected]] 
INFO[0001] Message Bytes: [map[ev:status message:authenticated status:auth_success]] 

Client update needed to match REST spec changes

A diff between this client library's spec and our hosted spec was found. The client may need an update to match any changes in our API. See the diff below:

--- https://raw.githubusercontent.com/polygon-io/client-go/master/.polygon/rest.json
+++ https://api.polygon.io/openapi
@@ -22313,6 +22313,7 @@
                 "INDEX",
                 "ETF",
                 "ETN",
+                "ETV",
                 "OS",
                 "GDR",
                 "OTHER",
@@ -22456,41 +22457,25 @@
             "content": {
               "application/json": {
                 "example": {
-                  "request_id": "aa118eb5574a45d8baea953484dc0336",
-                  "results": {
-                    "active": true,
-                    "address": {
-                      "address1": "One Apple Park Way",
-                      "city": "Cupertino",
-                      "postal_code": "95014",
-                      "state": "CA"
-                    },
-                    "branding": {
-                      "icon_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_icon.png",
-                      "logo_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_logo.svg"
-                    },
-                    "cik": "0000320193",
-                    "composite_figi": "BBG000B9XRY4",
-                    "currency_name": "usd",
-                    "description": "Apple designs a wide variety of consumer electronic devices, including smartphones (iPhone), tablets (iPad), PCs (Mac), smartwatches (Apple Watch), AirPods, and TV boxes (Apple TV), among others. The iPhone makes up the majority of Apple's total revenue. In addition, Apple offers its customers a variety of services such as Apple Music, iCloud, Apple Care, Apple TV+, Apple Arcade, Apple Card, and Apple Pay, among others. Apple's products run internally developed software and semiconductors, and the firm is well known for its integration of hardware, software and services. Apple's products are distributed online as well as through company-owned stores and third-party retailers. The company generates roughly 40% of its revenue from the Americas, with the remainder earned internationally.",
-                    "homepage_url": "https://www.apple.com",
-                    "list_date": "1980-12-12",
-                    "locale": "us",
-                    "market": "stocks",
-                    "market_cap": 2771126040150,
-                    "name": "Apple Inc.",
-                    "phone_number": "(408) 996-1010",
-                    "primary_exchange": "XNAS",
-                    "share_class_figi": "BBG001S5N8V8",
-                    "share_class_shares_outstanding": 16406400000,
-                    "sic_code": "3571",
-                    "sic_description": "ELECTRONIC COMPUTERS",
-                    "ticker": "AAPL",
-                    "ticker_root": "AAPL",
-                    "total_employees": 154000,
-                    "type": "CS",
-                    "weighted_shares_outstanding": 16334371000
-                  },
+                  "count": 1,
+                  "next_url": "https://api.polygon.io/v3/reference/tickers?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy",
+                  "request_id": "e70013d92930de90e089dc8fa098888e",
+                  "results": [
+                    {
+                      "active": true,
+                      "cik": "0001090872",
+                      "composite_figi": "BBG000BWQYZ5",
+                      "currency_name": "usd",
+                      "last_updated_utc": "2021-04-25T00:00:00.000Z",
+                      "locale": "us",
+                      "market": "stocks",
+                      "name": "Agilent Technologies Inc.",
+                      "primary_exchange": "XNYS",
+                      "share_class_figi": "BBG001SCTQY4",
+                      "ticker": "A",
+                      "type": "CS"
+                    }
+                  ],
                   "status": "OK"
                 },
                 "schema": {
@@ -22614,7 +22599,7 @@
                 }
               },
               "text/csv": {
-                "example": "ticker,name,market,locale,primary_exchange,type,active,currency_name,cik,composite_figi,share_class_figi,share_class_shares_outstanding,weighted_shares_outstanding,market_cap,phone_number,address1,city,state,postal_code,sic_code,sic_description,ticker_root,total_employees,list_date,homepage_url,description,branding/logo_url,branding/icon_url\nAAPL,Apple Inc.,stocks,us,XNAS,CS,true,usd,0000320193,BBG000B9XRY4,BBG001S5N8V8,16406400000,16334371000,2771126040150,(408) 996-1010,One Apple Park Way,Cupertino,CA,95014,3571,ELECTRONIC COMPUTERS,AAPL,154000,1980-12-12,https://www.apple.com,\"Apple designs a wide variety of consumer electronic devices, including smartphones (iPhone), tablets (iPad), PCs (Mac), smartwatches (Apple Watch), AirPods, and TV boxes (Apple TV), among others. The iPhone makes up the majority of Apple's total revenue. In addition, Apple offers its customers a variety of services such as Apple Music, iCloud, Apple Care, Apple TV+, Apple Arcade, Apple Card, and Apple Pay, among others. Apple's products run internally developed software and semiconductors, and the firm is well known for its integration of hardware, software and services. Apple's products are distributed online as well as through company-owned stores and third-party retailers. The company generates roughly 40% of its revenue from the Americas, with the remainder earned internationally.\",https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_logo.svg,https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_icon.png\n",
+                "example": "ticker,name,market,locale,primary_exchange,type,active,currency_name,cik,composite_figi,share_class_figi,last_updated_utc\nA,Agilent Technologies Inc.,stocks,us,XNYS,CS,true,usd,0001090872,BBG000BWQYZ5,BBG001SCTQY4,2021-04-25T00:00:00Z\n",
                 "schema": {
                   "type": "string"
                 }
@@ -25284,6 +25269,166 @@
           }
         }
       }
+    },
+    "/vX/reference/tickers/{ticker}/events": {
+      "get": {
+        "description": "Get a timeline of events associated with a specific entity resolved from the given ticker. Use the as_of parameter\nto specify the date to use when resolving the entity.\n",
+        "operationId": "GetEvents",
+        "parameters": [
+          {
+            "description": "The ticker symbol of the asset.",
+            "example": "META",
+            "in": "path",
+            "name": "ticker",
+            "required": true,
+            "schema": {
+              "type": "string"
+            }
+          },
+          {
+            "description": "A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type.\nLeave blank to return all supported event_types.\n",
+            "in": "query",
+            "name": "types",
+            "schema": {
+              "type": "string"
+            }
+          },
+          {
+            "description": "Specify a point in time to use alongside the ticker to resolve the entity.\n\nDefaults to today.\n",
+            "in": "query",
+            "name": "as_of",
+            "schema": {
+              "format": "date",
+              "type": "string"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "content": {
+              "application/json": {
+                "example": {
+                  "request_id": "31d59dda-80e5-4721-8496-d0d32a654afe",
+                  "results": {
+                    "events": [
+                      {
+                        "date": "2022-06-09",
+                        "ticker_change": {
+                          "ticker": "META"
+                        },
+                        "type": "ticker_change"
+                      },
+                      {
+                        "date": "2012-05-18",
+                        "ticker_change": {
+                          "ticker": "FB"
+                        },
+                        "type": "ticker_change"
+                      }
+                    ],
+                    "name": "Meta Platforms, Inc. Class A Common Stock"
+                  },
+                  "status": "OK"
+                },
+                "schema": {
+                  "allOf": [
+                    {
+                      "properties": {
+                        "request_id": {
+                          "description": "A request id assigned by the server.",
+                          "type": "string"
+                        }
+                      },
+                      "type": "object"
+                    },
+                    {
+                      "properties": {
+                        "status": {
+                          "description": "The status of this request's response.",
+                          "type": "string"
+                        }
+                      },
+                      "type": "object"
+                    },
+                    {
+                      "properties": {
+                        "results": {
+                          "properties": {
+                            "events": {
+                              "items": {
+                                "discriminator": {
+                                  "propertyName": "event_type"
+                                },
+                                "oneOf": [
+                                  {
+                                    "allOf": [
+                                      {
+                                        "properties": {
+                                          "date": {
+                                            "description": "The date the event took place",
+                                            "format": "date",
+                                            "type": "string"
+                                          },
+                                          "event_type": {
+                                            "description": "The type of historical event for the asset",
+                                            "type": "string"
+                                          }
+                                        },
+                                        "required": [
+                                          "event_type",
+                                          "date"
+                                        ],
+                                        "type": "object"
+                                      },
+                                      {
+                                        "properties": {
+                                          "ticker_change": {
+                                            "properties": {
+                                              "ticker": {
+                                                "type": "string"
+                                              }
+                                            },
+                                            "type": "object"
+                                          }
+                                        },
+                                        "type": "object"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              },
+                              "type": "array"
+                            },
+                            "name": {
+                              "type": "string"
+                            }
+                          },
+                          "type": "object"
+                        }
+                      },
+                      "type": "object"
+                    }
+                  ]
+                }
+              }
+            },
+            "description": "Ticker Events."
+          },
+          "401": {
+            "description": "Unauthorized - Check our API Key and account status"
+          }
+        },
+        "summary": "Ticker Events",
+        "tags": [
+          "reference:tickers:get"
+        ],
+        "x-polygon-draft": true,
+        "x-polygon-entitlement-data-type": {
+          "description": "Reference data",
+          "name": "reference"
+        },
+        "x-polygon-experimental": {}
+      }
     }
   },
   "security": [
@@ -25738,6 +25883,11 @@
         },
         {
           "paths": [
+            "/vX/reference/tickers/{ticker}/events"
+          ]
+        },
+        {
+          "paths": [
             "/v2/reference/news"
           ]
         },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.