Skip to content

Commit 296384c

Browse files
committed
fix(quote): accept FUTUREs without headSymbolAsString (fixes #917)
1 parent f29a459 commit 296384c

File tree

5 files changed

+92
-3
lines changed

5 files changed

+92
-3
lines changed

src/modules/options.schema.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,6 @@
22102210
"expireIsoDate",
22112211
"fullExchangeName",
22122212
"gmtOffSetMilliseconds",
2213-
"headSymbolAsString",
22142213
"language",
22152214
"market",
22162215
"marketState",

src/modules/quote.schema.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,6 @@
21372137
"expireIsoDate",
21382138
"fullExchangeName",
21392139
"gmtOffSetMilliseconds",
2140-
"headSymbolAsString",
21412140
"language",
21422141
"market",
21432142
"marketState",

src/modules/quote.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe("quote", () => {
3636
"SOHO", // "openInterest" prop (#445)
3737
"VWRL.L", // ETF with no dividendYield, expenseRatio (#914)
3838
"ZGLD.SW", // ETF with no netAssets (#916)
39+
"B0K25.NYM", // FUTURE with no `headSymbolAsString` (#917)
3940
],
4041
});
4142

src/modules/quote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export interface QuoteEquity extends QuoteBase {
170170

171171
export interface QuoteFuture extends QuoteBase {
172172
quoteType: "FUTURE";
173-
headSymbolAsString: string; // "GC=F"
173+
headSymbolAsString?: string; // "GC=F"
174174
contractSymbol: boolean; // false
175175
underlyingExchangeSymbol: string; // "GCM22.CMX"
176176
expireDate: Date; // 1656374400
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"request": {
3+
"url": "https://query2.finance.yahoo.com/v7/finance/quote?symbols=B0K25.NYM&crumb=haT3oykhHqZ",
4+
"method": "GET",
5+
"headers": {
6+
"cookie": "GUCS=AV78X-IQ; GUC=AQABCAFnsytn2UIgTASn&s=AQAAAEKG89vA&g=Z7HctQ; A3=d=AQABBKvcsWcCEIGLkyl67hr2YX7XekV46j4FEgABCAErs2fZZ_bPb2UB9qMAAAcIq9yxZ63aZoI&S=AQAAAtFJa---IoVh8DRgGhGzVr4; A1S=d=AQABBKvcsWcCEIGLkyl67hr2YX7XekV46j4FEgABCAErs2fZZ_bPb2UB9qMAAAcIq9yxZ63aZoI&S=AQAAAtFJa---IoVh8DRgGhGzVr4; EuConsent=CQM66kAQM66kAAOACBENBcFoAP_gAEPgACiQKptB9G7WTXFneXp2YPskOYUX0VBJ4MAwBgCBAcABzBIUIBwGVmAzJEyIICACGAIAIGBBIABtGAhAQEAAYIAFAABIAEgAIBAAIGAAACAAAABACAAAAAAAAAAQgEAXMBQgmAYEBFoIQUhAggAgAQAAAAAEAIgBCgQAEAAAQAAICAAIACgAAgAAAAAAAAAEAFAIEQAAIAECAotkdQAAAAAAAAAAAAQACAABAAAAAIKpgAkGpUQBFgSEhAIGEECAEQUBABQIAgAACBAAAATBAUIAwAVGAiAEAIAAAAAAAAACABAAABAAhAAEAAQIAAAAAIAAgAIBAAACAAAAAAAAAAAAAAAAAAAAAAAAAGIBAggAAABBAAQUAAAAAgAAAAAAAAAIgACAAAAAAAAAAAAAAIgAAAAAAAAAAAAAAAAAAIAAAAIAAAAgBEFgAAAAAAAAAAAAAACAABAAAAAIAAA; A1=d=AQABBKvcsWcCEIGLkyl67hr2YX7XekV46j4FEgABCAErs2fZZ_bPb2UB9qMAAAcIq9yxZ63aZoI&S=AQAAAtFJa---IoVh8DRgGhGzVr4",
7+
"user-agent": "@gadicc/yahoo-finance2/0.0.1 (+https://github.com/gadicc/node-yahoo-finance2)"
8+
}
9+
},
10+
"response": {
11+
"ok": true,
12+
"status": 200,
13+
"statusText": "OK",
14+
"headers": {
15+
"age": "0",
16+
"cache-control": "public, max-age=1, stale-while-revalidate=9",
17+
"content-length": "1427",
18+
"content-type": "application/json;charset=utf-8",
19+
"date": "Wed, 28 May 2025 01:15:34 GMT",
20+
"referrer-policy": "no-referrer-when-downgrade",
21+
"server": "ATS",
22+
"strict-transport-security": "max-age=31536000",
23+
"vary": "Origin,Accept-Encoding",
24+
"x-content-type-options": "nosniff",
25+
"x-envoy-decorator-operation": "finance-quote-api--mtls-production-sg3.finance-k8s:4080/*",
26+
"x-envoy-upstream-service-time": "3",
27+
"x-frame-options": "SAMEORIGIN",
28+
"x-xss-protection": "1; mode=block",
29+
"y-rid": "568499dk3cotm"
30+
},
31+
"bodyJson": {
32+
"quoteResponse": {
33+
"result": [
34+
{
35+
"language": "en-US",
36+
"region": "US",
37+
"quoteType": "FUTURE",
38+
"typeDisp": "Futures",
39+
"quoteSourceName": "Delayed Quote",
40+
"triggerable": false,
41+
"customPriceAlertConfidence": "NONE",
42+
"contractSymbol": true,
43+
"currency": "USD",
44+
"ask": 0.68,
45+
"fullExchangeName": "NY Mercantile",
46+
"regularMarketOpen": 0.855,
47+
"fiftyTwoWeekLowChange": -0.083330035,
48+
"fiftyTwoWeekLowChangePercent": -0.09746203,
49+
"fiftyTwoWeekRange": "0.855 - 0.855",
50+
"fiftyTwoWeekHighChange": -0.083330035,
51+
"fiftyTwoWeekHighChangePercent": -0.09746203,
52+
"fiftyTwoWeekLow": 0.855,
53+
"fiftyTwoWeekHigh": 0.855,
54+
"openInterest": 15530,
55+
"expireDate": 1748908800,
56+
"expireIsoDate": "2025-06-03T00:00:00Z",
57+
"sourceInterval": 30,
58+
"exchangeDataDelayedBy": 10,
59+
"tradeable": false,
60+
"cryptoTradeable": false,
61+
"hasPrePostMarketData": false,
62+
"priceHint": 4,
63+
"regularMarketChange": 0.018339992,
64+
"regularMarketDayHigh": 0.855,
65+
"regularMarketDayRange": "0.855 - 0.855",
66+
"regularMarketDayLow": 0.855,
67+
"regularMarketVolume": 20,
68+
"regularMarketPreviousClose": 0.73125,
69+
"corporateActions": [],
70+
"regularMarketTime": 1743522575,
71+
"underlyingSymbol": "B0.NYM",
72+
"underlyingExchangeSymbol": "B0K25.NYM",
73+
"exchange": "NYM",
74+
"exchangeTimezoneName": "America/New_York",
75+
"exchangeTimezoneShortName": "EDT",
76+
"gmtOffSetMilliseconds": -14400000,
77+
"market": "us24_market",
78+
"esgPopulated": false,
79+
"shortName": "Mont Belvieu LDH Propane (OPIS)",
80+
"regularMarketChangePercent": 2.4345229,
81+
"regularMarketPrice": 0.77167,
82+
"marketState": "REGULAR",
83+
"symbol": "B0K25.NYM"
84+
}
85+
],
86+
"error": null
87+
}
88+
}
89+
}
90+
}

0 commit comments

Comments
 (0)