@apifreaks/openapi-specs 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +657 -84
- package/dist/index.js +657 -84
- package/dist/specs/commodity/commodity-fluctuation.yaml +81 -7
- package/dist/specs/commodity/commodity-prices.yaml +130 -22
- package/dist/specs/commodity/commodity-symbols.yaml +54 -7
- package/dist/specs/commodity/commodity-time-series.yaml +94 -7
- package/dist/specs/commodity/historical-commodity-prices.yaml +112 -30
- package/package.json +1 -1
- package/specs/README.md +1 -1
- package/specs/commodity/commodity-fluctuation.json +118 -8
- package/specs/commodity/commodity-prices.json +176 -23
- package/specs/commodity/commodity-symbols.json +64 -7
- package/specs/commodity/commodity-time-series.json +136 -8
- package/specs/commodity/historical-commodity-prices.json +158 -33
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"openapi": "3.1.1",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Live Commodity Prices API - Real Time Market Insights",
|
|
5
|
-
"version": "
|
|
6
|
-
"description": "Get real-time prices for
|
|
5
|
+
"version": "2.0.0",
|
|
6
|
+
"description": "Get real-time prices for 245+ commodities in a single request. Returns current market prices for each requested symbol plus unit and quote currency metadata. Supports an optional quote parameter to convert prices into a desired currency, defaulting to each commodity's native market currency. Accepts 10-minute or 1-minute update frequencies for price freshness. If some requested symbols can't be resolved, a 206 Partial Content response is returned with the resolved rates plus an `unresolved` object; if none resolve, a 404 is returned instead. An unsupported quote currency also returns a 404.",
|
|
7
7
|
"contact": {
|
|
8
8
|
"name": "APIFreaks Support",
|
|
9
9
|
"url": "https://apifreaks.com/contact",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"servers": [
|
|
14
14
|
{
|
|
15
|
-
"url": "https://api.apifreaks.com/
|
|
15
|
+
"url": "https://api.apifreaks.com/v2.0",
|
|
16
16
|
"description": "Live Commodity Prices API Server"
|
|
17
17
|
}
|
|
18
18
|
],
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"name": "updates",
|
|
49
49
|
"in": "query",
|
|
50
50
|
"required": true,
|
|
51
|
-
"description": "Update frequency. Accepted values: `
|
|
51
|
+
"description": "Update frequency. Accepted values: `10m` (default), `1m`.",
|
|
52
52
|
"schema": {
|
|
53
53
|
"type": "string",
|
|
54
|
-
"enum": ["
|
|
55
|
-
"default": "
|
|
54
|
+
"enum": ["10m", "1m"],
|
|
55
|
+
"default": "10m"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
{
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
},
|
|
76
76
|
"examples": {
|
|
77
77
|
"success": {
|
|
78
|
-
"summary": "Successful response",
|
|
78
|
+
"summary": "Successful response (10m update frequency)",
|
|
79
79
|
"value": {
|
|
80
80
|
"success": true,
|
|
81
|
-
"timestamp":
|
|
81
|
+
"timestamp": 1789375397,
|
|
82
82
|
"rates": {
|
|
83
|
-
"XAU":
|
|
84
|
-
"WTIOIL-SPOT":
|
|
83
|
+
"XAU": 4313.04,
|
|
84
|
+
"WTIOIL-SPOT": 100
|
|
85
85
|
},
|
|
86
86
|
"metadata": {
|
|
87
87
|
"XAU": {
|
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
"summary": "Price converted to a target quote currency",
|
|
100
100
|
"value": {
|
|
101
101
|
"success": true,
|
|
102
|
-
"timestamp":
|
|
102
|
+
"timestamp": 1789375426,
|
|
103
103
|
"rates": {
|
|
104
|
-
"XAU":
|
|
104
|
+
"XAU": 3739.023
|
|
105
105
|
},
|
|
106
106
|
"metadata": {
|
|
107
107
|
"XAU": {
|
|
@@ -120,6 +120,66 @@
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
+
"206": {
|
|
124
|
+
"description": "Partial Content — Some requested symbols could not be resolved",
|
|
125
|
+
"content": {
|
|
126
|
+
"application/json": {
|
|
127
|
+
"schema": {
|
|
128
|
+
"$ref": "#/components/schemas/LiveCommodityPricesResponse"
|
|
129
|
+
},
|
|
130
|
+
"examples": {
|
|
131
|
+
"partial": {
|
|
132
|
+
"summary": "One valid symbol, one unresolved symbol",
|
|
133
|
+
"value": {
|
|
134
|
+
"success": true,
|
|
135
|
+
"timestamp": 1789376193,
|
|
136
|
+
"rates": {
|
|
137
|
+
"XAU": 4311.88
|
|
138
|
+
},
|
|
139
|
+
"metadata": {
|
|
140
|
+
"XAU": {
|
|
141
|
+
"unit": "T.oz",
|
|
142
|
+
"quote": "USD"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"unresolved": {
|
|
146
|
+
"FAKESYM": {
|
|
147
|
+
"message": "We don't support this symbol, please visit our symbols page to see supported symbols."
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"partialWithSuggestions": {
|
|
153
|
+
"summary": "Unresolved symbol with close-match suggestions",
|
|
154
|
+
"value": {
|
|
155
|
+
"success": true,
|
|
156
|
+
"timestamp": 1789376644,
|
|
157
|
+
"rates": {
|
|
158
|
+
"XAU": 4306.06
|
|
159
|
+
},
|
|
160
|
+
"metadata": {
|
|
161
|
+
"XAU": {
|
|
162
|
+
"unit": "T.oz",
|
|
163
|
+
"quote": "USD"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"unresolved": {
|
|
167
|
+
"ZW": {
|
|
168
|
+
"message": "Did you mean ZW-SPOT (Wheat Spot) or ZW-FUT (Wheat Futures)?",
|
|
169
|
+
"suggestions": ["ZW-SPOT", "ZW-FUT"]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"headers": {
|
|
178
|
+
"X-AF-Credits-Cost": {
|
|
179
|
+
"$ref": "#/components/headers/X-AF-Credits-Cost"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
123
183
|
"400": {
|
|
124
184
|
"description": "Bad Request — Missing or invalid query parameters",
|
|
125
185
|
"content": {
|
|
@@ -133,19 +193,46 @@
|
|
|
133
193
|
"value": {
|
|
134
194
|
"error": "Invalid Param Exception",
|
|
135
195
|
"message": "please pass correct parameters",
|
|
136
|
-
"path": "/
|
|
196
|
+
"path": "/v2.0/commodity/rates/latest",
|
|
137
197
|
"status": 400,
|
|
138
|
-
"timestamp": "2026-
|
|
198
|
+
"timestamp": "2026-09-14T08:43:43.964Z"
|
|
139
199
|
}
|
|
140
200
|
},
|
|
141
201
|
"invalidUpdates": {
|
|
142
|
-
"summary": "updates is not
|
|
202
|
+
"summary": "updates is not 10m or 1m",
|
|
143
203
|
"value": {
|
|
144
204
|
"error": "Invalid Param Exception",
|
|
145
205
|
"message": "please pass correct parameters",
|
|
146
|
-
"path": "/
|
|
206
|
+
"path": "/v2.0/commodity/rates/latest",
|
|
147
207
|
"status": 400,
|
|
148
|
-
"timestamp": "2026-
|
|
208
|
+
"timestamp": "2026-09-14T08:43:44.440Z"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"headers": {
|
|
215
|
+
"X-AF-Credits-Cost": {
|
|
216
|
+
"$ref": "#/components/headers/X-AF-Credits-Cost"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"402": {
|
|
221
|
+
"description": "Payment Required — Maximum symbols per request exceeded",
|
|
222
|
+
"content": {
|
|
223
|
+
"application/json": {
|
|
224
|
+
"schema": {
|
|
225
|
+
"$ref": "#/components/schemas/CommodityNotFoundError"
|
|
226
|
+
},
|
|
227
|
+
"examples": {
|
|
228
|
+
"maxSymbolsExceeded": {
|
|
229
|
+
"summary": "Too many symbols requested",
|
|
230
|
+
"value": {
|
|
231
|
+
"timestamp": "2026-09-14T08:43:44.957Z",
|
|
232
|
+
"path": "/rates/latestRates",
|
|
233
|
+
"code": 402,
|
|
234
|
+
"error": "PAYMENT_REQUIRED",
|
|
235
|
+
"message": "Maximum symbols per request exceeded"
|
|
149
236
|
}
|
|
150
237
|
}
|
|
151
238
|
}
|
|
@@ -168,17 +255,38 @@
|
|
|
168
255
|
"symbolNotFound": {
|
|
169
256
|
"summary": "Symbol Not Found",
|
|
170
257
|
"value": {
|
|
171
|
-
"timestamp":
|
|
258
|
+
"timestamp": "2026-09-14T08:43:44.957Z",
|
|
172
259
|
"path": "/rates/latestRates",
|
|
173
260
|
"code": 404,
|
|
174
261
|
"error": "SYMBOL_NOT_FOUND",
|
|
175
|
-
"message": "The symbol is not supported, please visit the documentation for a list of supported symbols"
|
|
262
|
+
"message": "The symbol is not supported, please visit the documentation for a list of supported symbols",
|
|
263
|
+
"unresolved": {
|
|
264
|
+
"FAKESYM": {
|
|
265
|
+
"message": "We don't support this symbol, please visit our symbols page to see supported symbols."
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"symbolNotFoundWithSuggestions": {
|
|
271
|
+
"summary": "Symbol Not Found, with close-match suggestions",
|
|
272
|
+
"value": {
|
|
273
|
+
"timestamp": "2026-09-14T09:04:04.878Z",
|
|
274
|
+
"path": "/rates/latestRates",
|
|
275
|
+
"code": 404,
|
|
276
|
+
"error": "SYMBOL_NOT_FOUND",
|
|
277
|
+
"message": "The symbol is not supported, please visit the documentation for a list of supported symbols",
|
|
278
|
+
"unresolved": {
|
|
279
|
+
"ZW": {
|
|
280
|
+
"message": "Did you mean ZW-SPOT (Wheat Spot) or ZW-FUT (Wheat Futures)?",
|
|
281
|
+
"suggestions": ["ZW-SPOT", "ZW-FUT"]
|
|
282
|
+
}
|
|
283
|
+
}
|
|
176
284
|
}
|
|
177
285
|
},
|
|
178
286
|
"quoteNotFound": {
|
|
179
287
|
"summary": "Quote Currency Not Found",
|
|
180
288
|
"value": {
|
|
181
|
-
"timestamp":
|
|
289
|
+
"timestamp": "2026-09-14T08:43:45.461Z",
|
|
182
290
|
"path": "/rates/latestRates",
|
|
183
291
|
"code": 404,
|
|
184
292
|
"error": "QUOTE_NOT_FOUND",
|
|
@@ -231,6 +339,30 @@
|
|
|
231
339
|
},
|
|
232
340
|
"metadata": {
|
|
233
341
|
"$ref": "#/components/schemas/CommodityMetadata"
|
|
342
|
+
},
|
|
343
|
+
"unresolved": {
|
|
344
|
+
"type": "object",
|
|
345
|
+
"description": "Present only on a 206 Partial Content response, when some requested symbols could not be resolved. Map of each unresolved symbol to a detail message and optional close-match suggestions.",
|
|
346
|
+
"additionalProperties": {
|
|
347
|
+
"type": "object",
|
|
348
|
+
"properties": {
|
|
349
|
+
"message": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"description": "Detail message explaining why this symbol was not resolved."
|
|
352
|
+
},
|
|
353
|
+
"suggestions": {
|
|
354
|
+
"type": "array",
|
|
355
|
+
"description": "Optional list of supported symbols that closely match the unresolved symbol.",
|
|
356
|
+
"items": {
|
|
357
|
+
"type": "string"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"warning": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"description": "Present only when currency conversion for the requested `quote` is temporarily unavailable; rates are returned in each commodity's default currency instead."
|
|
234
366
|
}
|
|
235
367
|
},
|
|
236
368
|
"description": "Live commodity prices response containing success status, timestamp, rates, and metadata."
|
|
@@ -294,12 +426,13 @@
|
|
|
294
426
|
},
|
|
295
427
|
"CommodityNotFoundError": {
|
|
296
428
|
"type": "object",
|
|
297
|
-
"description": "Error envelope returned by the commodity pricing service specifically for unresolvable symbol/quote errors. Uses `code` instead of `status` and
|
|
429
|
+
"description": "Error envelope returned by the commodity pricing service specifically for unresolvable symbol/quote errors. Uses `code` instead of `status` and an ISO 8601 `timestamp`, unlike the standard ErrorResponse.",
|
|
298
430
|
"required": ["code", "error", "message"],
|
|
299
431
|
"properties": {
|
|
300
432
|
"timestamp": {
|
|
301
|
-
"type": "
|
|
302
|
-
"
|
|
433
|
+
"type": "string",
|
|
434
|
+
"format": "date-time",
|
|
435
|
+
"description": "Timestamp when the error occurred (ISO 8601)."
|
|
303
436
|
},
|
|
304
437
|
"path": {
|
|
305
438
|
"type": "string",
|
|
@@ -316,6 +449,26 @@
|
|
|
316
449
|
"message": {
|
|
317
450
|
"type": "string",
|
|
318
451
|
"description": "Human-readable error message describing the failure."
|
|
452
|
+
},
|
|
453
|
+
"unresolved": {
|
|
454
|
+
"type": "object",
|
|
455
|
+
"description": "Present only on SYMBOL_NOT_FOUND errors. Map of each unresolved symbol to a detail message and optional close-match suggestions.",
|
|
456
|
+
"additionalProperties": {
|
|
457
|
+
"type": "object",
|
|
458
|
+
"properties": {
|
|
459
|
+
"message": {
|
|
460
|
+
"type": "string",
|
|
461
|
+
"description": "Detail message explaining why this symbol was not resolved."
|
|
462
|
+
},
|
|
463
|
+
"suggestions": {
|
|
464
|
+
"type": "array",
|
|
465
|
+
"description": "Optional list of supported symbols that closely match the unresolved symbol.",
|
|
466
|
+
"items": {
|
|
467
|
+
"type": "string"
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
319
472
|
}
|
|
320
473
|
}
|
|
321
474
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"openapi": "3.1.1",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Commodity Symbols API Reference",
|
|
5
|
-
"version": "
|
|
6
|
-
"description": "List all supported commodity symbols available in the APIFreaks Commodity API. Returns an array of commodity objects with symbol, name, category, pricing currency, unit of measurement, status, and update interval. Supports metals, energy, agriculture, and livestock categories.",
|
|
5
|
+
"version": "2.0.0",
|
|
6
|
+
"description": "List all supported commodity symbols available in the APIFreaks Commodity API. Returns an array of commodity objects with symbol, name, category, pricing currency, unit of measurement, status, and update interval. Supports metals, energy, agriculture, industrial, raw materials, oils and meals, textiles, meats, poultry, and livestock categories across 245+ commodities. Deprecated symbols are included with `status: \"inactive\"` and a `deprecationDate`; historical rates remain available for them up to their deprecation date, but latest rates do not.",
|
|
7
7
|
"contact": {
|
|
8
8
|
"name": "APIFreaks Support",
|
|
9
9
|
"url": "https://apifreaks.com/contact",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"servers": [
|
|
14
14
|
{
|
|
15
|
-
"url": "https://api.apifreaks.com/
|
|
15
|
+
"url": "https://api.apifreaks.com/v2.0",
|
|
16
16
|
"description": "Commodity Symbols API Server"
|
|
17
17
|
}
|
|
18
18
|
],
|
|
@@ -81,6 +81,40 @@
|
|
|
81
81
|
"symbol": "MMBtu",
|
|
82
82
|
"name": "Million British Thermal Units"
|
|
83
83
|
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"symbol": "NG-EU",
|
|
87
|
+
"name": "Natural Gas, Europe",
|
|
88
|
+
"category": "Energy",
|
|
89
|
+
"status": "active",
|
|
90
|
+
"updateInterval": "PER_MONTH",
|
|
91
|
+
"exchange": "World Bank",
|
|
92
|
+
"currency": {
|
|
93
|
+
"code": "USD",
|
|
94
|
+
"name": "US Dollar",
|
|
95
|
+
"symbol": "$"
|
|
96
|
+
},
|
|
97
|
+
"unit": {
|
|
98
|
+
"symbol": "MMBtu",
|
|
99
|
+
"name": "Million British Thermal Units"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"symbol": "UANEU",
|
|
104
|
+
"name": "Urea Ammonium Nitrate",
|
|
105
|
+
"category": "Industrial",
|
|
106
|
+
"status": "inactive",
|
|
107
|
+
"updateInterval": "PER_MINUTE",
|
|
108
|
+
"deprecationDate": "2024-04-14",
|
|
109
|
+
"currency": {
|
|
110
|
+
"code": "USD",
|
|
111
|
+
"name": "US Dollar",
|
|
112
|
+
"symbol": "$"
|
|
113
|
+
},
|
|
114
|
+
"unit": {
|
|
115
|
+
"symbol": "T",
|
|
116
|
+
"name": "Metric Ton"
|
|
117
|
+
}
|
|
84
118
|
}
|
|
85
119
|
]
|
|
86
120
|
}
|
|
@@ -147,23 +181,46 @@
|
|
|
147
181
|
"properties": {
|
|
148
182
|
"symbol": {
|
|
149
183
|
"type": "string",
|
|
150
|
-
"description": "Unique identifier/ticker symbol for the commodity (e.g., XAU, NG-FUT)."
|
|
184
|
+
"description": "Unique identifier/ticker symbol for the commodity (e.g., XAU, NG-FUT). Use this value in the `symbols` parameter of the rate endpoints."
|
|
151
185
|
},
|
|
152
186
|
"name": {
|
|
153
187
|
"type": "string",
|
|
154
188
|
"description": "Full name of the commodity (e.g., Gold, Natural Gas Futures)."
|
|
155
189
|
},
|
|
190
|
+
"description": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"description": "Short description of the commodity. May be an empty string for some symbols."
|
|
193
|
+
},
|
|
156
194
|
"category": {
|
|
157
195
|
"type": "string",
|
|
158
|
-
"description": "Category the commodity belongs to (e.g., Metals, Energy)."
|
|
196
|
+
"description": "Category the commodity belongs to (e.g., Metals, Energy, Agriculture, Industrial, Raw Materials, Oils and Meals, Textiles, Meats, Poultry, Livestock)."
|
|
159
197
|
},
|
|
160
198
|
"status": {
|
|
161
199
|
"type": "string",
|
|
162
|
-
"
|
|
200
|
+
"enum": ["active", "inactive"],
|
|
201
|
+
"description": "Current status of the commodity. `inactive` means the symbol is deprecated: latest rates are unavailable, but historical rates remain available up to its `deprecationDate`."
|
|
163
202
|
},
|
|
164
203
|
"updateInterval": {
|
|
165
204
|
"type": "string",
|
|
166
|
-
"
|
|
205
|
+
"enum": [
|
|
206
|
+
"PER_SECOND",
|
|
207
|
+
"PER_MINUTE",
|
|
208
|
+
"PER_10_MINUTES",
|
|
209
|
+
"PER_HOUR",
|
|
210
|
+
"PER_DAY",
|
|
211
|
+
"PER_WEEK",
|
|
212
|
+
"PER_MONTH"
|
|
213
|
+
],
|
|
214
|
+
"description": "Rate at which the price is updated."
|
|
215
|
+
},
|
|
216
|
+
"exchange": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"description": "Optional. Data source for the symbol (e.g., World Bank). Present only for some symbols."
|
|
219
|
+
},
|
|
220
|
+
"deprecationDate": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"format": "date",
|
|
223
|
+
"description": "Optional. Present only when `status` is `inactive`. Date the symbol was deprecated (YYYY-MM-DD)."
|
|
167
224
|
},
|
|
168
225
|
"currency": {
|
|
169
226
|
"$ref": "#/components/schemas/CommodityCurrency"
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"openapi": "3.1.1",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Commodities Time Series API",
|
|
5
|
-
"version": "
|
|
6
|
-
"description": "Retrieve daily OHLC (open, high, low, close) price data for any supported commodity over a date range of up to 365 days. Accepts one or more comma-separated commodity symbols with a start and end date in YYYY-MM-DD format. Returns a date-indexed object where each date key maps to per-symbol OHLC data. Non-trading days are automatically excluded. Returns a 400 error for invalid dates or a range exceeding 365 days, and a 404 error for unsupported symbols or a date range with no available data.",
|
|
5
|
+
"version": "2.0.0",
|
|
6
|
+
"description": "Retrieve daily OHLC (open, high, low, close) price data for any supported commodity over a date range of up to 365 days. Accepts one or more comma-separated commodity symbols with a start and end date in YYYY-MM-DD format. Returns a date-indexed object where each date key maps to per-symbol OHLC data. Non-trading days are automatically excluded, and only closing rates are available for monthly-updated commodities. A symbol is considered resolved if it appears on at least one date in the range; if some requested symbols can't be resolved at all, a 206 Partial Content response is returned with an `unresolved` object. Returns a 400 error for invalid dates or a range exceeding 365 days, and a 404 error for unsupported symbols or a date range with no available data.",
|
|
7
7
|
"contact": {
|
|
8
8
|
"name": "APIFreaks Support",
|
|
9
9
|
"url": "https://apifreaks.com/contact",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"servers": [
|
|
14
14
|
{
|
|
15
|
-
"url": "https://api.apifreaks.com/
|
|
15
|
+
"url": "https://api.apifreaks.com/v2.0",
|
|
16
16
|
"description": "Commodity Time Series API Server"
|
|
17
17
|
}
|
|
18
18
|
],
|
|
@@ -115,6 +115,62 @@
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
+
"206": {
|
|
119
|
+
"description": "Partial Content — Some requested symbols could not be resolved",
|
|
120
|
+
"content": {
|
|
121
|
+
"application/json": {
|
|
122
|
+
"schema": {
|
|
123
|
+
"$ref": "#/components/schemas/CommodityTimeSeriesResponse"
|
|
124
|
+
},
|
|
125
|
+
"examples": {
|
|
126
|
+
"partial": {
|
|
127
|
+
"summary": "One valid symbol, one unresolved symbol",
|
|
128
|
+
"value": {
|
|
129
|
+
"success": true,
|
|
130
|
+
"startDate": "2025-01-06",
|
|
131
|
+
"endDate": "2025-01-08",
|
|
132
|
+
"rates": {
|
|
133
|
+
"2025-01-06": {
|
|
134
|
+
"XAU": {
|
|
135
|
+
"open": 2649.01,
|
|
136
|
+
"high": 2651.33,
|
|
137
|
+
"low": 2645.36,
|
|
138
|
+
"close": 2646.91
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"2025-01-07": {
|
|
142
|
+
"XAU": {
|
|
143
|
+
"open": 2662.45,
|
|
144
|
+
"high": 2663.06,
|
|
145
|
+
"low": 2655.66,
|
|
146
|
+
"close": 2658.9
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"2025-01-08": {
|
|
150
|
+
"XAU": {
|
|
151
|
+
"open": 2669.69,
|
|
152
|
+
"high": 2674.68,
|
|
153
|
+
"low": 2668.58,
|
|
154
|
+
"close": 2671.8
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"unresolved": {
|
|
159
|
+
"FAKESYM": {
|
|
160
|
+
"message": "We don't support this symbol, please visit our symbols page to see supported symbols."
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"headers": {
|
|
169
|
+
"X-AF-Credits-Cost": {
|
|
170
|
+
"$ref": "#/components/headers/X-AF-Credits-Cost"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
118
174
|
"400": {
|
|
119
175
|
"description": "Bad Request — Missing parameters, invalid dates, or date range exceeded",
|
|
120
176
|
"content": {
|
|
@@ -125,9 +181,9 @@
|
|
|
125
181
|
"value": {
|
|
126
182
|
"error": "Invalid Param Exception",
|
|
127
183
|
"message": "please pass correct parameters",
|
|
128
|
-
"path": "/
|
|
184
|
+
"path": "/v2.0/commodity/time-series",
|
|
129
185
|
"status": 400,
|
|
130
|
-
"timestamp": "2026-
|
|
186
|
+
"timestamp": "2026-09-14T08:43:58.547Z"
|
|
131
187
|
}
|
|
132
188
|
},
|
|
133
189
|
"invalidDate": {
|
|
@@ -172,6 +228,33 @@
|
|
|
172
228
|
}
|
|
173
229
|
}
|
|
174
230
|
},
|
|
231
|
+
"402": {
|
|
232
|
+
"description": "Payment Required — Maximum symbols per request exceeded",
|
|
233
|
+
"content": {
|
|
234
|
+
"application/json": {
|
|
235
|
+
"schema": {
|
|
236
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
237
|
+
},
|
|
238
|
+
"examples": {
|
|
239
|
+
"maxSymbolsExceeded": {
|
|
240
|
+
"summary": "Too many symbols requested",
|
|
241
|
+
"value": {
|
|
242
|
+
"timestamp": "2026-09-14T08:44:00.586Z",
|
|
243
|
+
"path": "/rates/time-series",
|
|
244
|
+
"code": 402,
|
|
245
|
+
"error": "PAYMENT_REQUIRED",
|
|
246
|
+
"message": "Maximum symbols per request exceeded"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"headers": {
|
|
253
|
+
"X-AF-Credits-Cost": {
|
|
254
|
+
"$ref": "#/components/headers/X-AF-Credits-Cost"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
},
|
|
175
258
|
"404": {
|
|
176
259
|
"description": "Not found - Symbol or data not available",
|
|
177
260
|
"content": {
|
|
@@ -183,17 +266,22 @@
|
|
|
183
266
|
"symbolNotFound": {
|
|
184
267
|
"summary": "Symbol Not Found",
|
|
185
268
|
"value": {
|
|
186
|
-
"timestamp": "2026-
|
|
269
|
+
"timestamp": "2026-09-14T08:44:00.586Z",
|
|
187
270
|
"path": "/rates/time-series",
|
|
188
271
|
"code": 404,
|
|
189
272
|
"error": "SYMBOL_NOT_FOUND",
|
|
190
|
-
"message": "The symbol is not supported, please visit the documentation for a list of supported symbols"
|
|
273
|
+
"message": "The symbol is not supported, please visit the documentation for a list of supported symbols",
|
|
274
|
+
"unresolved": {
|
|
275
|
+
"FAKESYM": {
|
|
276
|
+
"message": "We don't support this symbol, please visit our symbols page to see supported symbols."
|
|
277
|
+
}
|
|
278
|
+
}
|
|
191
279
|
}
|
|
192
280
|
},
|
|
193
281
|
"dataNotFound": {
|
|
194
282
|
"summary": "No data available for the given date range",
|
|
195
283
|
"value": {
|
|
196
|
-
"timestamp": "2026-
|
|
284
|
+
"timestamp": "2026-09-14T08:44:31.547Z",
|
|
197
285
|
"path": "/rates/time-series",
|
|
198
286
|
"code": 404,
|
|
199
287
|
"error": "DATA_NOT_FOUND",
|
|
@@ -247,6 +335,26 @@
|
|
|
247
335
|
},
|
|
248
336
|
"rates": {
|
|
249
337
|
"$ref": "#/components/schemas/CommodityTimeSeriesRates"
|
|
338
|
+
},
|
|
339
|
+
"unresolved": {
|
|
340
|
+
"type": "object",
|
|
341
|
+
"description": "Present only on a 206 Partial Content response, when some requested symbols could not be resolved on any date in the range. Map of each unresolved symbol to a detail message and optional close-match suggestions.",
|
|
342
|
+
"additionalProperties": {
|
|
343
|
+
"type": "object",
|
|
344
|
+
"properties": {
|
|
345
|
+
"message": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"description": "Detail message explaining why this symbol was not resolved."
|
|
348
|
+
},
|
|
349
|
+
"suggestions": {
|
|
350
|
+
"type": "array",
|
|
351
|
+
"description": "Optional list of supported symbols that closely match the unresolved symbol.",
|
|
352
|
+
"items": {
|
|
353
|
+
"type": "string"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
250
358
|
}
|
|
251
359
|
},
|
|
252
360
|
"description": "Commodity time series response containing date-indexed OHLC data per symbol."
|
|
@@ -319,6 +427,26 @@
|
|
|
319
427
|
"type": "string",
|
|
320
428
|
"format": "date-time",
|
|
321
429
|
"description": "Timestamp when the error occurred (ISO 8601)."
|
|
430
|
+
},
|
|
431
|
+
"unresolved": {
|
|
432
|
+
"type": "object",
|
|
433
|
+
"description": "Present only on SYMBOL_NOT_FOUND errors. Map of each unresolved symbol to a detail message and optional close-match suggestions.",
|
|
434
|
+
"additionalProperties": {
|
|
435
|
+
"type": "object",
|
|
436
|
+
"properties": {
|
|
437
|
+
"message": {
|
|
438
|
+
"type": "string",
|
|
439
|
+
"description": "Detail message explaining why this symbol was not resolved."
|
|
440
|
+
},
|
|
441
|
+
"suggestions": {
|
|
442
|
+
"type": "array",
|
|
443
|
+
"description": "Optional list of supported symbols that closely match the unresolved symbol.",
|
|
444
|
+
"items": {
|
|
445
|
+
"type": "string"
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
322
450
|
}
|
|
323
451
|
}
|
|
324
452
|
}
|