@apifreaks/openapi-specs 0.4.2 → 0.4.4

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.
@@ -1,14 +1,14 @@
1
1
  openapi: 3.1.1
2
2
  info:
3
3
  title: 'Commodity Fluctuation API '
4
- version: 1.0.0
5
- description: Calculate price change and percentage movement for any commodity over a custom date range. Returns the opening price, closing price, absolute change, and percentage change for each symbol. Accepts one or more comma-separated commodity symbols with a start and end date in YYYY-MM-DD format. Returns a 400 error for invalid dates or a date range where start is after end, and a 404 error for unsupported symbols or a date range with no available data.
4
+ version: 2.0.0
5
+ description: Price change and percentage movement for one or more commodities over a custom date range, with no limit on range length. For monthly-updated commodities the range snaps to month boundaries. Unresolved symbols degrade to a 206 partial response instead of failing the whole request.
6
6
  contact:
7
7
  name: APIFreaks Support
8
8
  url: https://apifreaks.com/contact
9
9
  email: support@apifreaks.com
10
10
  servers:
11
- - url: https://api.apifreaks.com/v1.0
11
+ - url: https://api.apifreaks.com/v2.0
12
12
  description: Commodity Fluctuation API Server
13
13
  paths:
14
14
  /commodity/fluctuation:
@@ -74,6 +74,31 @@ paths:
74
74
  headers:
75
75
  X-AF-Credits-Cost:
76
76
  $ref: '#/components/headers/X-AF-Credits-Cost'
77
+ '206':
78
+ description: Partial Content — Some requested symbols could not be resolved
79
+ content:
80
+ application/json:
81
+ schema:
82
+ $ref: '#/components/schemas/CommodityFluctuationResponse'
83
+ examples:
84
+ partial:
85
+ summary: One valid symbol, one unresolved symbol
86
+ value:
87
+ success: true
88
+ startDate: '2024-01-01'
89
+ endDate: '2024-01-31'
90
+ rates:
91
+ XAU:
92
+ startRate: 2063.63
93
+ endRate: 2039.83
94
+ change: -23.8
95
+ changePercent: -1.15
96
+ unresolved:
97
+ FAKESYM:
98
+ message: We don't support this symbol, please visit our symbols page to see supported symbols.
99
+ headers:
100
+ X-AF-Credits-Cost:
101
+ $ref: '#/components/headers/X-AF-Credits-Cost'
77
102
  '400':
78
103
  description: Bad Request — Missing parameters or invalid dates
79
104
  content:
@@ -84,9 +109,9 @@ paths:
84
109
  value:
85
110
  error: Invalid Param Exception
86
111
  message: please pass correct parameters
87
- path: /v1.0/commodity/fluctuation
112
+ path: /v2.0/commodity/fluctuation
88
113
  status: 400
89
- timestamp: '2026-07-27T11:37:24.273Z'
114
+ timestamp: '2026-09-14T08:43:46.481Z'
90
115
  invalidDateFormat:
91
116
  summary: Date is not in YYYY-MM-DD format
92
117
  value:
@@ -116,6 +141,24 @@ paths:
116
141
  headers:
117
142
  X-AF-Credits-Cost:
118
143
  $ref: '#/components/headers/X-AF-Credits-Cost'
144
+ '402':
145
+ description: Payment Required — Maximum symbols per request exceeded
146
+ content:
147
+ application/json:
148
+ schema:
149
+ $ref: '#/components/schemas/ErrorResponse'
150
+ examples:
151
+ maxSymbolsExceeded:
152
+ summary: Too many symbols requested
153
+ value:
154
+ timestamp: '2026-09-14T08:43:48.408Z'
155
+ path: /rates/fluctuation
156
+ code: 402
157
+ error: PAYMENT_REQUIRED
158
+ message: Maximum symbols per request exceeded
159
+ headers:
160
+ X-AF-Credits-Cost:
161
+ $ref: '#/components/headers/X-AF-Credits-Cost'
119
162
  '404':
120
163
  description: Not found - Symbol or data not available
121
164
  content:
@@ -126,15 +169,18 @@ paths:
126
169
  symbolNotFound:
127
170
  summary: Symbol Not Found
128
171
  value:
129
- timestamp: '2026-07-27T11:37:23.759Z'
172
+ timestamp: '2026-09-14T08:43:48.408Z'
130
173
  path: /rates/fluctuation
131
174
  code: 404
132
175
  error: SYMBOL_NOT_FOUND
133
176
  message: The symbol is not supported, please visit the documentation for a list of supported symbols
177
+ unresolved:
178
+ FAKESYM:
179
+ message: We don't support this symbol, please visit our symbols page to see supported symbols.
134
180
  noData:
135
181
  summary: No data available for the given date range
136
182
  value:
137
- timestamp: '2026-07-27T11:37:34.167Z'
183
+ timestamp: '2026-09-14T08:44:31.022Z'
138
184
  path: /rates/fluctuation
139
185
  code: 404
140
186
  error: DATA_NOT_FOUND
@@ -174,6 +220,20 @@ components:
174
220
  description: End date of the interval (YYYY-MM-DD).
175
221
  rates:
176
222
  $ref: '#/components/schemas/CommodityFluctuationRates'
223
+ unresolved:
224
+ type: object
225
+ 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.
226
+ additionalProperties:
227
+ type: object
228
+ properties:
229
+ message:
230
+ type: string
231
+ description: Detail message explaining why this symbol was not resolved.
232
+ suggestions:
233
+ type: array
234
+ description: Optional list of supported symbols that closely match the unresolved symbol.
235
+ items:
236
+ type: string
177
237
  description: Commodity fluctuation response containing price change data per symbol over a date range.
178
238
  CommodityFluctuationRates:
179
239
  type: object
@@ -229,6 +289,20 @@ components:
229
289
  type: string
230
290
  format: date-time
231
291
  description: Timestamp when the error occurred (ISO 8601).
292
+ unresolved:
293
+ type: object
294
+ description: Present only on SYMBOL_NOT_FOUND errors. Map of each unresolved symbol to a detail message and optional close-match suggestions.
295
+ additionalProperties:
296
+ type: object
297
+ properties:
298
+ message:
299
+ type: string
300
+ description: Detail message explaining why this symbol was not resolved.
301
+ suggestions:
302
+ type: array
303
+ description: Optional list of supported symbols that closely match the unresolved symbol.
304
+ items:
305
+ type: string
232
306
  headers:
233
307
  X-AF-Credits-Cost:
234
308
  description: Specifies the number of credits consumed by the current request.
@@ -1,14 +1,14 @@
1
1
  openapi: 3.1.1
2
2
  info:
3
3
  title: Live Commodity Prices API - Real Time Market Insights
4
- version: 1.0.0
5
- description: Get real-time prices for 130+ 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 1-minute or 10-minute update frequencies for price freshness. An unsupported symbol or quote currency returns a 404.
4
+ version: 2.0.0
5
+ description: Real-time prices for 245+ commodities in a single request, updated on a rolling ~10 minute cadence. Optionally convert prices into a target quote currency. Unresolved symbols degrade to a 206 partial response instead of failing the whole request.
6
6
  contact:
7
7
  name: APIFreaks Support
8
8
  url: https://apifreaks.com/contact
9
9
  email: support@apifreaks.com
10
10
  servers:
11
- - url: https://api.apifreaks.com/v1.0
11
+ - url: https://api.apifreaks.com/v2.0
12
12
  description: Live Commodity Prices API Server
13
13
  paths:
14
14
  /commodity/rates/latest:
@@ -34,16 +34,6 @@ paths:
34
34
  description: Comma-separated list of commodity symbols (e.g., `XAU`, `WTIOIL-SPOT`).
35
35
  schema:
36
36
  type: string
37
- - name: updates
38
- in: query
39
- required: true
40
- description: 'Update frequency. Accepted values: `1m` (default), `10m`.'
41
- schema:
42
- type: string
43
- enum:
44
- - 1m
45
- - 10m
46
- default: 1m
47
37
  - name: quote
48
38
  in: query
49
39
  required: false
@@ -62,10 +52,10 @@ paths:
62
52
  summary: Successful response
63
53
  value:
64
54
  success: true
65
- timestamp: 1785152172
55
+ timestamp: 1789375397
66
56
  rates:
67
- XAU: 4099.1
68
- WTIOIL-SPOT: 81.88
57
+ XAU: 4313.04
58
+ WTIOIL-SPOT: 100
69
59
  metadata:
70
60
  XAU:
71
61
  unit: T.oz
@@ -77,9 +67,9 @@ paths:
77
67
  summary: Price converted to a target quote currency
78
68
  value:
79
69
  success: true
80
- timestamp: 1785152172
70
+ timestamp: 1789375426
81
71
  rates:
82
- XAU: 3597.734
72
+ XAU: 3739.023
83
73
  metadata:
84
74
  XAU:
85
75
  unit: T.oz
@@ -87,6 +77,47 @@ paths:
87
77
  headers:
88
78
  X-AF-Credits-Cost:
89
79
  $ref: '#/components/headers/X-AF-Credits-Cost'
80
+ '206':
81
+ description: Partial Content — Some requested symbols could not be resolved
82
+ content:
83
+ application/json:
84
+ schema:
85
+ $ref: '#/components/schemas/LiveCommodityPricesResponse'
86
+ examples:
87
+ partial:
88
+ summary: One valid symbol, one unresolved symbol
89
+ value:
90
+ success: true
91
+ timestamp: 1789376193
92
+ rates:
93
+ XAU: 4311.88
94
+ metadata:
95
+ XAU:
96
+ unit: T.oz
97
+ quote: USD
98
+ unresolved:
99
+ FAKESYM:
100
+ message: We don't support this symbol, please visit our symbols page to see supported symbols.
101
+ partialWithSuggestions:
102
+ summary: Unresolved symbol with close-match suggestions
103
+ value:
104
+ success: true
105
+ timestamp: 1789376644
106
+ rates:
107
+ XAU: 4306.06
108
+ metadata:
109
+ XAU:
110
+ unit: T.oz
111
+ quote: USD
112
+ unresolved:
113
+ ZW:
114
+ message: Did you mean ZW-SPOT (Wheat Spot) or ZW-FUT (Wheat Futures)?
115
+ suggestions:
116
+ - ZW-SPOT
117
+ - ZW-FUT
118
+ headers:
119
+ X-AF-Credits-Cost:
120
+ $ref: '#/components/headers/X-AF-Credits-Cost'
90
121
  '400':
91
122
  description: Bad Request — Missing or invalid query parameters
92
123
  content:
@@ -99,17 +130,27 @@ paths:
99
130
  value:
100
131
  error: Invalid Param Exception
101
132
  message: please pass correct parameters
102
- path: /v1.0/commodity/rates/latest
133
+ path: /v2.0/commodity/rates/latest
103
134
  status: 400
104
- timestamp: '2026-07-27T11:36:13.312Z'
105
- invalidUpdates:
106
- summary: updates is not 1m or 10m
135
+ timestamp: '2026-09-14T08:43:43.964Z'
136
+ headers:
137
+ X-AF-Credits-Cost:
138
+ $ref: '#/components/headers/X-AF-Credits-Cost'
139
+ '402':
140
+ description: Payment Required — Maximum symbols per request exceeded
141
+ content:
142
+ application/json:
143
+ schema:
144
+ $ref: '#/components/schemas/CommodityNotFoundError'
145
+ examples:
146
+ maxSymbolsExceeded:
147
+ summary: Too many symbols requested
107
148
  value:
108
- error: Invalid Param Exception
109
- message: please pass correct parameters
110
- path: /v1.0/commodity/rates/latest
111
- status: 400
112
- timestamp: '2026-07-27T11:36:35.755Z'
149
+ timestamp: '2026-09-14T08:43:44.957Z'
150
+ path: /rates/latestRates
151
+ code: 402
152
+ error: PAYMENT_REQUIRED
153
+ message: Maximum symbols per request exceeded
113
154
  headers:
114
155
  X-AF-Credits-Cost:
115
156
  $ref: '#/components/headers/X-AF-Credits-Cost'
@@ -123,15 +164,32 @@ paths:
123
164
  symbolNotFound:
124
165
  summary: Symbol Not Found
125
166
  value:
126
- timestamp: 1781792620618
167
+ timestamp: '2026-09-14T08:43:44.957Z'
168
+ path: /rates/latestRates
169
+ code: 404
170
+ error: SYMBOL_NOT_FOUND
171
+ message: The symbol is not supported, please visit the documentation for a list of supported symbols
172
+ unresolved:
173
+ FAKESYM:
174
+ message: We don't support this symbol, please visit our symbols page to see supported symbols.
175
+ symbolNotFoundWithSuggestions:
176
+ summary: Symbol Not Found, with close-match suggestions
177
+ value:
178
+ timestamp: '2026-09-14T09:04:04.878Z'
127
179
  path: /rates/latestRates
128
180
  code: 404
129
181
  error: SYMBOL_NOT_FOUND
130
182
  message: The symbol is not supported, please visit the documentation for a list of supported symbols
183
+ unresolved:
184
+ ZW:
185
+ message: Did you mean ZW-SPOT (Wheat Spot) or ZW-FUT (Wheat Futures)?
186
+ suggestions:
187
+ - ZW-SPOT
188
+ - ZW-FUT
131
189
  quoteNotFound:
132
190
  summary: Quote Currency Not Found
133
191
  value:
134
- timestamp: 1781792620618
192
+ timestamp: '2026-09-14T08:43:45.461Z'
135
193
  path: /rates/latestRates
136
194
  code: 404
137
195
  error: QUOTE_NOT_FOUND
@@ -170,6 +228,23 @@ components:
170
228
  $ref: '#/components/schemas/CommodityRates'
171
229
  metadata:
172
230
  $ref: '#/components/schemas/CommodityMetadata'
231
+ unresolved:
232
+ type: object
233
+ 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.
234
+ additionalProperties:
235
+ type: object
236
+ properties:
237
+ message:
238
+ type: string
239
+ description: Detail message explaining why this symbol was not resolved.
240
+ suggestions:
241
+ type: array
242
+ description: Optional list of supported symbols that closely match the unresolved symbol.
243
+ items:
244
+ type: string
245
+ warning:
246
+ type: string
247
+ description: Present only when currency conversion for the requested `quote` is temporarily unavailable; rates are returned in each commodity's default currency instead.
173
248
  description: Live commodity prices response containing success status, timestamp, rates, and metadata.
174
249
  CommodityRates:
175
250
  type: object
@@ -219,15 +294,16 @@ components:
219
294
  description: Timestamp when the error occurred (ISO 8601).
220
295
  CommodityNotFoundError:
221
296
  type: object
222
- description: Error envelope returned by the commodity pricing service specifically for unresolvable symbol/quote errors. Uses `code` instead of `status` and a Unix millisecond `timestamp`, unlike the standard ErrorResponse.
297
+ 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.
223
298
  required:
224
299
  - code
225
300
  - error
226
301
  - message
227
302
  properties:
228
303
  timestamp:
229
- type: integer
230
- description: Unix timestamp in milliseconds when the error occurred.
304
+ type: string
305
+ format: date-time
306
+ description: Timestamp when the error occurred (ISO 8601).
231
307
  path:
232
308
  type: string
233
309
  description: Internal service path that produced the error.
@@ -240,6 +316,20 @@ components:
240
316
  message:
241
317
  type: string
242
318
  description: Human-readable error message describing the failure.
319
+ unresolved:
320
+ type: object
321
+ description: Present only on SYMBOL_NOT_FOUND errors. Map of each unresolved symbol to a detail message and optional close-match suggestions.
322
+ additionalProperties:
323
+ type: object
324
+ properties:
325
+ message:
326
+ type: string
327
+ description: Detail message explaining why this symbol was not resolved.
328
+ suggestions:
329
+ type: array
330
+ description: Optional list of supported symbols that closely match the unresolved symbol.
331
+ items:
332
+ type: string
243
333
  headers:
244
334
  X-AF-Credits-Cost:
245
335
  description: Specifies the number of credits consumed by the current request.
@@ -1,14 +1,14 @@
1
1
  openapi: 3.1.1
2
2
  info:
3
3
  title: Commodity Symbols API Reference
4
- version: 1.0.0
5
- 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.
4
+ version: 2.0.0
5
+ description: 'Full catalog of 245+ supported commodities across Metals, Energy, Agriculture, Industrial, Raw Materials, Oils and Meals, Textiles, Meats, Poultry, and Livestock, with pricing currency, unit, and update interval per symbol. Deprecated symbols stay listed with `status: "inactive"` and a `deprecationDate`.'
6
6
  contact:
7
7
  name: APIFreaks Support
8
8
  url: https://apifreaks.com/contact
9
9
  email: support@apifreaks.com
10
10
  servers:
11
- - url: https://api.apifreaks.com/v1.0
11
+ - url: https://api.apifreaks.com/v2.0
12
12
  description: Commodity Symbols API Server
13
13
  paths:
14
14
  /commodity/symbols:
@@ -65,6 +65,32 @@ paths:
65
65
  unit:
66
66
  symbol: MMBtu
67
67
  name: Million British Thermal Units
68
+ - symbol: NG-EU
69
+ name: Natural Gas, Europe
70
+ category: Energy
71
+ status: active
72
+ updateInterval: PER_MONTH
73
+ exchange: World Bank
74
+ currency:
75
+ code: USD
76
+ name: US Dollar
77
+ symbol: $
78
+ unit:
79
+ symbol: MMBtu
80
+ name: Million British Thermal Units
81
+ - symbol: UANEU
82
+ name: Urea Ammonium Nitrate
83
+ category: Industrial
84
+ status: inactive
85
+ updateInterval: PER_MINUTE
86
+ deprecationDate: '2024-04-14'
87
+ currency:
88
+ code: USD
89
+ name: US Dollar
90
+ symbol: $
91
+ unit:
92
+ symbol: T
93
+ name: Metric Ton
68
94
  headers:
69
95
  X-AF-Credits-Cost:
70
96
  $ref: '#/components/headers/X-AF-Credits-Cost'
@@ -110,19 +136,40 @@ components:
110
136
  properties:
111
137
  symbol:
112
138
  type: string
113
- description: Unique identifier/ticker symbol for the commodity (e.g., XAU, NG-FUT).
139
+ description: Unique identifier/ticker symbol for the commodity (e.g., XAU, NG-FUT). Use this value in the `symbols` parameter of the rate endpoints.
114
140
  name:
115
141
  type: string
116
142
  description: Full name of the commodity (e.g., Gold, Natural Gas Futures).
143
+ description:
144
+ type: string
145
+ description: Short description of the commodity. May be an empty string for some symbols.
117
146
  category:
118
147
  type: string
119
- description: Category the commodity belongs to (e.g., Metals, Energy).
148
+ description: Category the commodity belongs to (e.g., Metals, Energy, Agriculture, Industrial, Raw Materials, Oils and Meals, Textiles, Meats, Poultry, Livestock).
120
149
  status:
121
150
  type: string
122
- description: 'Current status of the commodity. Value: active.'
151
+ enum:
152
+ - active
153
+ - inactive
154
+ 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`.'
123
155
  updateInterval:
124
156
  type: string
125
- description: 'Rate at which the price is updated. Values: PER_SECOND, PER_MINUTE.'
157
+ enum:
158
+ - PER_SECOND
159
+ - PER_MINUTE
160
+ - PER_10_MINUTES
161
+ - PER_HOUR
162
+ - PER_DAY
163
+ - PER_WEEK
164
+ - PER_MONTH
165
+ description: Rate at which the price is updated.
166
+ exchange:
167
+ type: string
168
+ description: Optional. Data source for the symbol (e.g., World Bank). Present only for some symbols.
169
+ deprecationDate:
170
+ type: string
171
+ format: date
172
+ description: Optional. Present only when `status` is `inactive`. Date the symbol was deprecated (YYYY-MM-DD).
126
173
  currency:
127
174
  $ref: '#/components/schemas/CommodityCurrency'
128
175
  unit: