Skip to content

Commit 3aa9d82

Browse files
Added ticker news insights support (#710)
1 parent 5c73e33 commit 3aa9d82

File tree

2 files changed

+87
-60
lines changed

2 files changed

+87
-60
lines changed

Diff for: .polygon/rest.json

+69-60
Original file line numberDiff line numberDiff line change
@@ -18312,7 +18312,7 @@
1831218312
"operationId": "ListNews",
1831318313
"parameters": [
1831418314
{
18315-
"description": "Return results that contain this ticker.",
18315+
"description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.",
1831618316
"in": "query",
1831718317
"name": "ticker",
1831818318
"schema": {
@@ -18496,52 +18496,35 @@
1849618496
"request_id": "831afdb0b8078549fed053476984947a",
1849718497
"results": [
1849818498
{
18499-
"amp_url": "https://amp.benzinga.com/amp/content/20784086",
18500-
"article_url": "https://www.benzinga.com/markets/cryptocurrency/21/04/20784086/cathie-wood-adds-more-coinbase-skillz-trims-square",
18501-
"author": "Rachit Vats",
18502-
"description": "<p>Cathie Wood-led Ark Investment Management on Friday snapped up another 221,167 shares of the cryptocurrency exchange <strong>Coinbase Global Inc </strong>(NASDAQ <a class=\"ticker\" href=\"https://www.benzinga.com/stock/coin#NASDAQ\">COIN</a>) worth about $64.49 million on the stock&rsquo;s Friday&rsquo;s dip and also its fourth-straight loss.</p>\n<p>The investment firm&rsquo;s <strong>Ark Innovation ETF</strong> (NYSE <a class=\" ticker\" href=\"https://www.benzinga.com/stock/arkk#NYSE\">ARKK</a>) bought the shares of the company that closed 0.63% lower at $291.60 on Friday, giving the cryptocurrency exchange a market cap of $58.09 billion. Coinbase&rsquo;s market cap has dropped from $85.8 billion on its blockbuster listing earlier this month.</p>\n<p>The New York-based company also added another 3,873 shares of the mobile gaming company <strong>Skillz Inc</strong> (NYSE <a class=\" ticker\" href=\"https://www.benzinga.com/stock/sklz#NYSE\">SKLZ</a>), <a href=\"http://www.benzinga.com/markets/cryptocurrency/21/04/20762794/cathie-woods-ark-loads-up-another-1-2-million-shares-in-skillz-also-adds-coinbase-draftkin\" >just a day after</a> snapping 1.2 million shares of the stock.</p>\n <p>ARKK bought the shares of the company which closed ...</p><p><a href=https://www.benzinga.com/markets/cryptocurrency/21/04/20784086/cathie-wood-adds-more-coinbase-skillz-trims-square alt=Cathie Wood Adds More Coinbase, Skillz, Trims Square>Full story available on Benzinga.com</a></p>",
18503-
"id": "nJsSJJdwViHZcw5367rZi7_qkXLfMzacXBfpv-vD9UA",
18504-
"image_url": "https://cdn2.benzinga.com/files/imagecache/og_image_social_share_1200x630/images/story/2012/andre-francois-mckenzie-auhr4gcqcce-unsplash.jpg?width=720",
18499+
"amp_url": "https://m.uk.investing.com/news/stock-market-news/markets-are-underestimating-fed-cuts-ubs-3559968?ampMode=1",
18500+
"article_url": "https://uk.investing.com/news/stock-market-news/markets-are-underestimating-fed-cuts-ubs-3559968",
18501+
"author": "Sam Boughedda",
18502+
"description": "UBS analysts warn that markets are underestimating the extent of future interest rate cuts by the Federal Reserve, as the weakening economy is likely to justify more cuts than currently anticipated.",
18503+
"id": "8ec638777ca03b553ae516761c2a22ba2fdd2f37befae3ab6fdab74e9e5193eb",
18504+
"image_url": "https://i-invdn-com.investing.com/news/LYNXNPEC4I0AL_L.jpg",
18505+
"insights": [
18506+
{
18507+
"sentiment": "positive",
18508+
"sentiment_reasoning": "UBS analysts are providing a bullish outlook on the extent of future Federal Reserve rate cuts, suggesting that markets are underestimating the number of cuts that will occur.",
18509+
"ticker": "UBS"
18510+
}
18511+
],
1850518512
"keywords": [
18506-
"Sector ETFs",
18507-
"Penny Stocks",
18508-
"Cryptocurrency",
18509-
"Small Cap",
18510-
"Markets",
18511-
"Trading Ideas",
18512-
"ETFs"
18513+
"Federal Reserve",
18514+
"interest rates",
18515+
"economic data"
1851318516
],
18514-
"published_utc": "2021-04-26T02:33:17Z",
18517+
"published_utc": "2024-06-24T18:33:53Z",
1851518518
"publisher": {
18516-
"favicon_url": "https://s3.polygon.io/public/public/assets/news/favicons/benzinga.ico",
18517-
"homepage_url": "https://www.benzinga.com/",
18518-
"logo_url": "https://s3.polygon.io/public/public/assets/news/logos/benzinga.svg",
18519-
"name": "Benzinga"
18519+
"favicon_url": "https://s3.polygon.io/public/assets/news/favicons/investing.ico",
18520+
"homepage_url": "https://www.investing.com/",
18521+
"logo_url": "https://s3.polygon.io/public/assets/news/logos/investing.png",
18522+
"name": "Investing.com"
1852018523
},
1852118524
"tickers": [
18522-
"DOCU",
18523-
"DDD",
18524-
"NIU",
18525-
"ARKF",
18526-
"NVDA",
18527-
"SKLZ",
18528-
"PCAR",
18529-
"MASS",
18530-
"PSTI",
18531-
"SPFR",
18532-
"TREE",
18533-
"PHR",
18534-
"IRDM",
18535-
"BEAM",
18536-
"ARKW",
18537-
"ARKK",
18538-
"ARKG",
18539-
"PSTG",
18540-
"SQ",
18541-
"IONS",
18542-
"SYRS"
18525+
"UBS"
1854318526
],
18544-
"title": "Cathie Wood Adds More Coinbase, Skillz, Trims Square"
18527+
"title": "Markets are underestimating Fed cuts: UBS By Investing.com - Investing.com UK"
1854518528
}
1854618529
],
1854718530
"status": "OK"
@@ -18587,6 +18570,32 @@
1858718570
"description": "The article's image URL.",
1858818571
"type": "string"
1858918572
},
18573+
"insights": {
18574+
"description": "The insights related to the article.",
18575+
"items": {
18576+
"properties": {
18577+
"sentiment": {
18578+
"description": "The sentiment of the insight.",
18579+
"type": "string"
18580+
},
18581+
"sentiment_reasoning": {
18582+
"description": "The reasoning behind the sentiment.",
18583+
"type": "string"
18584+
},
18585+
"ticker": {
18586+
"description": "The ticker symbol associated with the insight.",
18587+
"type": "string"
18588+
}
18589+
},
18590+
"required": [
18591+
"ticker",
18592+
"sentiment",
18593+
"sentiment_reasoning"
18594+
],
18595+
"type": "object"
18596+
},
18597+
"type": "array"
18598+
},
1859018599
"keywords": {
1859118600
"description": "The keywords associated with the article (which will vary depending on\nthe publishing source).",
1859218601
"items": {
@@ -18667,7 +18676,7 @@
1866718676
}
1866818677
},
1866918678
"text/csv": {
18670-
"example": "id,publisher_name,publisher_homepage_url,publisher_logo_url,publisher_favicon_url,title,author,published_utc,article_url,tickers,amp_url,image_url,description,keywords\nnJsSJJdwViHZcw5367rZi7_qkXLfMzacXBfpv-vD9UA,Benzinga,https://www.benzinga.com/,https://s3.polygon.io/public/public/assets/news/logos/benzinga.svg,https://s3.polygon.io/public/public/assets/news/favicons/benzinga.ico,\"Cathie Wood Adds More Coinbase, Skillz, Trims Square\",Rachit Vats,2021-04-26T02:33:17Z,https://www.benzinga.com/markets/cryptocurrency/21/04/20784086/cathie-wood-adds-more-coinbase-skillz-trims-square,\"DOCU,DDD,NIU,ARKF,NVDA,SKLZ,PCAR,MASS,PSTI,SPFR,TREE,PHR,IRDM,BEAM,ARKW,ARKK,ARKG,PSTG,SQ,IONS,SYRS\",https://amp.benzinga.com/amp/content/20784086,https://cdn2.benzinga.com/files/imagecache/og_image_social_share_1200x630/images/story/2012/andre-francois-mckenzie-auhr4gcqcce-unsplash.jpg?width=720,\"<p>Cathie Wood-led Ark Investment Management on Friday snapped up another 221,167 shares of the cryptocurrency exchange <strong>Coinbase Global Inc </strong>(NASDAQ <a class=\\\"ticker\\\" href=\\\"https://www.benzinga.com/stock/coin#NASDAQ\\\">COIN</a>) worth about $64.49 million on the stock&rsquo;s Friday&rsquo;s dip and also its fourth-straight loss.</p> <p>The investment firm&rsquo;s <strong>Ark Innovation ETF</strong> (NYSE <a class=\\\" ticker\\\" href=\\\"https://www.benzinga.com/stock/arkk#NYSE\\\">ARKK</a>) bought the shares of the company that closed 0.63% lower at $291.60 on Friday, giving the cryptocurrency exchange a market cap of $58.09 billion. Coinbase&rsquo;s market cap has dropped from $85.8 billion on its blockbuster listing earlier this month.</p> <p>The New York-based company also added another 3,873 shares of the mobile gaming company <strong>Skillz Inc</strong> (NYSE <a class=\\\" ticker\\\" href=\\\"https://www.benzinga.com/stock/sklz#NYSE\\\">SKLZ</a>), <a href=\\\"http://www.benzinga.com/markets/cryptocurrency/21/04/20762794/cathie-woods-ark-loads-up-another-1-2-million-shares-in-skillz-also-adds-coinbase-draftkin\\\" >just a day after</a> snapping 1.2 million shares of the stock.</p> <p>ARKK bought the shares of the company which closed ...</p><p><a href=https://www.benzinga.com/markets/cryptocurrency/21/04/20784086/cathie-wood-adds-more-coinbase-skillz-trims-square alt=Cathie Wood Adds More Coinbase, Skillz, Trims Square>Full story available on Benzinga.com</a></p>\",\"Sector ETFs,Penny Stocks,Cryptocurrency,Small Cap,Markets,Trading Ideas,ETFs\"\n",
18679+
"example": "id,publisher_name,publisher_homepage_url,publisher_logo_url,publisher_favicon_url,title,author,published_utc,article_url,ticker,amp_url,image_url,description,keywords,sentiment,sentiment_reasoning\n8ec638777ca03b553ae516761c2a22ba2fdd2f37befae3ab6fdab74e9e5193eb,Investing.com,https://www.investing.com/,https://s3.polygon.io/public/assets/news/logos/investing.png,https://s3.polygon.io/public/assets/news/favicons/investing.ico,Markets are underestimating Fed cuts: UBS By Investing.com - Investing.com UK,Sam Boughedda,1719254033000000000,https://uk.investing.com/news/stock-market-news/markets-are-underestimating-fed-cuts-ubs-3559968,UBS,https://m.uk.investing.com/news/stock-market-news/markets-are-underestimating-fed-cuts-ubs-3559968?ampMode=1,https://i-invdn-com.investing.com/news/LYNXNPEC4I0AL_L.jpg,\"UBS analysts warn that markets are underestimating the extent of future interest rate cuts by the Federal Reserve, as the weakening economy is likely to justify more cuts than currently anticipated.\",\"Federal Reserve,interest rates,economic data\",positive,\"UBS analysts are providing a bullish outlook on the extent of future Federal Reserve rate cuts, suggesting that markets are underestimating the number of cuts that will occur.\"\n",
1867118680
"schema": {
1867218681
"type": "string"
1867318682
}
@@ -22864,11 +22873,11 @@
2286422873
}
2286522874
},
2286622875
{
22867-
"description": "Limit the number of results returned, default is 10 and max is 50000.",
22876+
"description": "Limit the number of results returned, default is 1000 and max is 50000.",
2286822877
"in": "query",
2286922878
"name": "limit",
2287022879
"schema": {
22871-
"default": 10,
22880+
"default": 1000,
2287222881
"example": 10,
2287322882
"maximum": 50000,
2287422883
"minimum": 1,
@@ -22993,7 +23002,7 @@
2299323002
},
2299423003
"x-polygon-paginate": {
2299523004
"limit": {
22996-
"default": 10,
23005+
"default": 1000,
2299723006
"example": 10,
2299823007
"max": 50000
2299923008
},
@@ -23091,11 +23100,11 @@
2309123100
}
2309223101
},
2309323102
{
23094-
"description": "Limit the number of results returned, default is 10 and max is 50000.",
23103+
"description": "Limit the number of results returned, default is 1000 and max is 50000.",
2309523104
"in": "query",
2309623105
"name": "limit",
2309723106
"schema": {
23098-
"default": 10,
23107+
"default": 1000,
2309923108
"example": 10,
2310023109
"maximum": 50000,
2310123110
"minimum": 1,
@@ -23242,7 +23251,7 @@
2324223251
},
2324323252
"x-polygon-paginate": {
2324423253
"limit": {
23245-
"default": 10,
23254+
"default": 1000,
2324623255
"example": 10,
2324723256
"max": 50000
2324823257
},
@@ -23333,11 +23342,11 @@
2333323342
}
2333423343
},
2333523344
{
23336-
"description": "Limit the number of results returned, default is 10 and max is 50000.",
23345+
"description": "Limit the number of results returned, default is 1000 and max is 50000.",
2333723346
"in": "query",
2333823347
"name": "limit",
2333923348
"schema": {
23340-
"default": 10,
23349+
"default": 1000,
2334123350
"example": 10,
2334223351
"maximum": 50000,
2334323352
"minimum": 1,
@@ -23545,7 +23554,7 @@
2354523554
},
2354623555
"x-polygon-paginate": {
2354723556
"limit": {
23548-
"default": 10,
23557+
"default": 1000,
2354923558
"example": 10,
2355023559
"max": 50000
2355123560
},
@@ -29071,11 +29080,11 @@
2907129080
}
2907229081
},
2907329082
{
29074-
"description": "Limit the number of results returned, default is 10 and max is 50000.",
29083+
"description": "Limit the number of results returned, default is 1000 and max is 50000.",
2907529084
"in": "query",
2907629085
"name": "limit",
2907729086
"schema": {
29078-
"default": 10,
29087+
"default": 1000,
2907929088
"example": 10,
2908029089
"maximum": 50000,
2908129090
"minimum": 1,
@@ -29221,7 +29230,7 @@
2922129230
},
2922229231
"x-polygon-paginate": {
2922329232
"limit": {
29224-
"default": 10,
29233+
"default": 1000,
2922529234
"example": 10,
2922629235
"max": 50000
2922729236
},
@@ -29319,11 +29328,11 @@
2931929328
}
2932029329
},
2932129330
{
29322-
"description": "Limit the number of results returned, default is 10 and max is 50000.",
29331+
"description": "Limit the number of results returned, default is 1000 and max is 50000.",
2932329332
"in": "query",
2932429333
"name": "limit",
2932529334
"schema": {
29326-
"default": 10,
29335+
"default": 1000,
2932729336
"example": 10,
2932829337
"maximum": 50000,
2932929338
"minimum": 1,
@@ -29475,7 +29484,7 @@
2947529484
},
2947629485
"x-polygon-paginate": {
2947729486
"limit": {
29478-
"default": 10,
29487+
"default": 1000,
2947929488
"example": 10,
2948029489
"max": 50000
2948129490
},
@@ -29566,11 +29575,11 @@
2956629575
}
2956729576
},
2956829577
{
29569-
"description": "Limit the number of results returned, default is 10 and max is 50000.",
29578+
"description": "Limit the number of results returned, default is 1000 and max is 50000.",
2957029579
"in": "query",
2957129580
"name": "limit",
2957229581
"schema": {
29573-
"default": 10,
29582+
"default": 1000,
2957429583
"example": 10,
2957529584
"maximum": 50000,
2957629585
"minimum": 1,
@@ -29766,7 +29775,7 @@
2976629775
},
2976729776
"x-polygon-paginate": {
2976829777
"limit": {
29769-
"default": 10,
29778+
"default": 1000,
2977029779
"example": 10,
2977129780
"max": 50000
2977229781
},

Diff for: polygon/rest/models/tickers.py

+18
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ def from_dict(d):
3232
return Branding(**d)
3333

3434

35+
@modelclass
36+
class Insight:
37+
"Contains the insights related to the article."
38+
sentiment: Optional[str] = None
39+
sentiment_reasoning: Optional[str] = None
40+
ticker: Optional[str] = None
41+
42+
@staticmethod
43+
def from_dict(d):
44+
return Insight(**d)
45+
46+
3547
@modelclass
3648
class Publisher:
3749
"Contains publisher data for ticker news."
@@ -152,6 +164,7 @@ class TickerNews:
152164
description: Optional[str] = None
153165
id: Optional[str] = None
154166
image_url: Optional[str] = None
167+
insights: Optional[List[Insight]] = None
155168
keywords: Optional[List[str]] = None
156169
published_utc: Optional[str] = None
157170
publisher: Optional[Publisher] = None
@@ -167,6 +180,11 @@ def from_dict(d):
167180
description=d.get("description", None),
168181
id=d.get("id", None),
169182
image_url=d.get("image_url", None),
183+
insights=(
184+
[Insight.from_dict(insight) for insight in d["insights"]]
185+
if "insights" in d
186+
else None
187+
),
170188
keywords=d.get("keywords", None),
171189
published_utc=d.get("published_utc", None),
172190
publisher=(

0 commit comments

Comments
 (0)