polygon-io / client-python

The official Python client library for the Polygon REST and WebSocket API.
https://polygon-api-client.readthedocs.io/
MIT License
800 stars 210 forks source link

Client update needed to match REST spec changes #323

Closed client-library-maintainer[bot] closed 1 year ago

client-library-maintainer[bot] commented 1 year ago

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-python/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"
           ]
         },
danielatpolygonio commented 1 year ago

Fixed by #319