@apifreaks/openapi-specs 0.4.1 → 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 +693 -116
- package/dist/index.js +693 -116
- 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/dist/specs/whois/bulk-whois-lookup.yaml +21 -9
- package/dist/specs/whois/domain-whois-history-lookup.yaml +12 -6
- package/dist/specs/whois/reverse-whois.yaml +9 -4
- package/dist/specs/whois/whois-domain-lookup.yaml +21 -9
- package/package.json +1 -1
- package/specs/README.md +3 -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
- package/specs/whois/bulk-whois-lookup.json +9 -9
- package/specs/whois/domain-whois-history-lookup.json +6 -6
- package/specs/whois/reverse-whois.json +8 -4
- package/specs/whois/whois-domain-lookup.json +9 -9
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
openapi: 3.1.1
|
|
2
2
|
info:
|
|
3
3
|
title: 'Commodity Fluctuation API '
|
|
4
|
-
version:
|
|
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: 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, rounded to 2 decimal places. For monthly-updated commodities, the fluctuation is computed between the first day of the start month and the first day of the end month. There is no limit on the date range. Accepts one or more comma-separated commodity symbols with a start and end date in YYYY-MM-DD format. If some requested symbols can't be resolved, a 206 Partial Content response is returned with the resolved rates plus an `unresolved` object. 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.
|
|
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/
|
|
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: /
|
|
112
|
+
path: /v2.0/commodity/fluctuation
|
|
88
113
|
status: 400
|
|
89
|
-
timestamp: '2026-
|
|
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-
|
|
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-
|
|
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:
|
|
5
|
-
description: Get real-time prices for
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
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.
|
|
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/
|
|
11
|
+
- url: https://api.apifreaks.com/v2.0
|
|
12
12
|
description: Live Commodity Prices API Server
|
|
13
13
|
paths:
|
|
14
14
|
/commodity/rates/latest:
|
|
@@ -37,13 +37,13 @@ paths:
|
|
|
37
37
|
- name: updates
|
|
38
38
|
in: query
|
|
39
39
|
required: true
|
|
40
|
-
description: 'Update frequency. Accepted values: `
|
|
40
|
+
description: 'Update frequency. Accepted values: `10m` (default), `1m`.'
|
|
41
41
|
schema:
|
|
42
42
|
type: string
|
|
43
43
|
enum:
|
|
44
|
-
- 1m
|
|
45
44
|
- 10m
|
|
46
|
-
|
|
45
|
+
- 1m
|
|
46
|
+
default: 10m
|
|
47
47
|
- name: quote
|
|
48
48
|
in: query
|
|
49
49
|
required: false
|
|
@@ -59,13 +59,13 @@ paths:
|
|
|
59
59
|
$ref: '#/components/schemas/LiveCommodityPricesResponse'
|
|
60
60
|
examples:
|
|
61
61
|
success:
|
|
62
|
-
summary: Successful response
|
|
62
|
+
summary: Successful response (10m update frequency)
|
|
63
63
|
value:
|
|
64
64
|
success: true
|
|
65
|
-
timestamp:
|
|
65
|
+
timestamp: 1789375397
|
|
66
66
|
rates:
|
|
67
|
-
XAU:
|
|
68
|
-
WTIOIL-SPOT:
|
|
67
|
+
XAU: 4313.04
|
|
68
|
+
WTIOIL-SPOT: 100
|
|
69
69
|
metadata:
|
|
70
70
|
XAU:
|
|
71
71
|
unit: T.oz
|
|
@@ -77,9 +77,9 @@ paths:
|
|
|
77
77
|
summary: Price converted to a target quote currency
|
|
78
78
|
value:
|
|
79
79
|
success: true
|
|
80
|
-
timestamp:
|
|
80
|
+
timestamp: 1789375426
|
|
81
81
|
rates:
|
|
82
|
-
XAU:
|
|
82
|
+
XAU: 3739.023
|
|
83
83
|
metadata:
|
|
84
84
|
XAU:
|
|
85
85
|
unit: T.oz
|
|
@@ -87,6 +87,47 @@ paths:
|
|
|
87
87
|
headers:
|
|
88
88
|
X-AF-Credits-Cost:
|
|
89
89
|
$ref: '#/components/headers/X-AF-Credits-Cost'
|
|
90
|
+
'206':
|
|
91
|
+
description: Partial Content — Some requested symbols could not be resolved
|
|
92
|
+
content:
|
|
93
|
+
application/json:
|
|
94
|
+
schema:
|
|
95
|
+
$ref: '#/components/schemas/LiveCommodityPricesResponse'
|
|
96
|
+
examples:
|
|
97
|
+
partial:
|
|
98
|
+
summary: One valid symbol, one unresolved symbol
|
|
99
|
+
value:
|
|
100
|
+
success: true
|
|
101
|
+
timestamp: 1789376193
|
|
102
|
+
rates:
|
|
103
|
+
XAU: 4311.88
|
|
104
|
+
metadata:
|
|
105
|
+
XAU:
|
|
106
|
+
unit: T.oz
|
|
107
|
+
quote: USD
|
|
108
|
+
unresolved:
|
|
109
|
+
FAKESYM:
|
|
110
|
+
message: We don't support this symbol, please visit our symbols page to see supported symbols.
|
|
111
|
+
partialWithSuggestions:
|
|
112
|
+
summary: Unresolved symbol with close-match suggestions
|
|
113
|
+
value:
|
|
114
|
+
success: true
|
|
115
|
+
timestamp: 1789376644
|
|
116
|
+
rates:
|
|
117
|
+
XAU: 4306.06
|
|
118
|
+
metadata:
|
|
119
|
+
XAU:
|
|
120
|
+
unit: T.oz
|
|
121
|
+
quote: USD
|
|
122
|
+
unresolved:
|
|
123
|
+
ZW:
|
|
124
|
+
message: Did you mean ZW-SPOT (Wheat Spot) or ZW-FUT (Wheat Futures)?
|
|
125
|
+
suggestions:
|
|
126
|
+
- ZW-SPOT
|
|
127
|
+
- ZW-FUT
|
|
128
|
+
headers:
|
|
129
|
+
X-AF-Credits-Cost:
|
|
130
|
+
$ref: '#/components/headers/X-AF-Credits-Cost'
|
|
90
131
|
'400':
|
|
91
132
|
description: Bad Request — Missing or invalid query parameters
|
|
92
133
|
content:
|
|
@@ -99,17 +140,35 @@ paths:
|
|
|
99
140
|
value:
|
|
100
141
|
error: Invalid Param Exception
|
|
101
142
|
message: please pass correct parameters
|
|
102
|
-
path: /
|
|
143
|
+
path: /v2.0/commodity/rates/latest
|
|
103
144
|
status: 400
|
|
104
|
-
timestamp: '2026-
|
|
145
|
+
timestamp: '2026-09-14T08:43:43.964Z'
|
|
105
146
|
invalidUpdates:
|
|
106
|
-
summary: updates is not
|
|
147
|
+
summary: updates is not 10m or 1m
|
|
107
148
|
value:
|
|
108
149
|
error: Invalid Param Exception
|
|
109
150
|
message: please pass correct parameters
|
|
110
|
-
path: /
|
|
151
|
+
path: /v2.0/commodity/rates/latest
|
|
111
152
|
status: 400
|
|
112
|
-
timestamp: '2026-
|
|
153
|
+
timestamp: '2026-09-14T08:43:44.440Z'
|
|
154
|
+
headers:
|
|
155
|
+
X-AF-Credits-Cost:
|
|
156
|
+
$ref: '#/components/headers/X-AF-Credits-Cost'
|
|
157
|
+
'402':
|
|
158
|
+
description: Payment Required — Maximum symbols per request exceeded
|
|
159
|
+
content:
|
|
160
|
+
application/json:
|
|
161
|
+
schema:
|
|
162
|
+
$ref: '#/components/schemas/CommodityNotFoundError'
|
|
163
|
+
examples:
|
|
164
|
+
maxSymbolsExceeded:
|
|
165
|
+
summary: Too many symbols requested
|
|
166
|
+
value:
|
|
167
|
+
timestamp: '2026-09-14T08:43:44.957Z'
|
|
168
|
+
path: /rates/latestRates
|
|
169
|
+
code: 402
|
|
170
|
+
error: PAYMENT_REQUIRED
|
|
171
|
+
message: Maximum symbols per request exceeded
|
|
113
172
|
headers:
|
|
114
173
|
X-AF-Credits-Cost:
|
|
115
174
|
$ref: '#/components/headers/X-AF-Credits-Cost'
|
|
@@ -123,15 +182,32 @@ paths:
|
|
|
123
182
|
symbolNotFound:
|
|
124
183
|
summary: Symbol Not Found
|
|
125
184
|
value:
|
|
126
|
-
timestamp:
|
|
185
|
+
timestamp: '2026-09-14T08:43:44.957Z'
|
|
186
|
+
path: /rates/latestRates
|
|
187
|
+
code: 404
|
|
188
|
+
error: SYMBOL_NOT_FOUND
|
|
189
|
+
message: The symbol is not supported, please visit the documentation for a list of supported symbols
|
|
190
|
+
unresolved:
|
|
191
|
+
FAKESYM:
|
|
192
|
+
message: We don't support this symbol, please visit our symbols page to see supported symbols.
|
|
193
|
+
symbolNotFoundWithSuggestions:
|
|
194
|
+
summary: Symbol Not Found, with close-match suggestions
|
|
195
|
+
value:
|
|
196
|
+
timestamp: '2026-09-14T09:04:04.878Z'
|
|
127
197
|
path: /rates/latestRates
|
|
128
198
|
code: 404
|
|
129
199
|
error: SYMBOL_NOT_FOUND
|
|
130
200
|
message: The symbol is not supported, please visit the documentation for a list of supported symbols
|
|
201
|
+
unresolved:
|
|
202
|
+
ZW:
|
|
203
|
+
message: Did you mean ZW-SPOT (Wheat Spot) or ZW-FUT (Wheat Futures)?
|
|
204
|
+
suggestions:
|
|
205
|
+
- ZW-SPOT
|
|
206
|
+
- ZW-FUT
|
|
131
207
|
quoteNotFound:
|
|
132
208
|
summary: Quote Currency Not Found
|
|
133
209
|
value:
|
|
134
|
-
timestamp:
|
|
210
|
+
timestamp: '2026-09-14T08:43:45.461Z'
|
|
135
211
|
path: /rates/latestRates
|
|
136
212
|
code: 404
|
|
137
213
|
error: QUOTE_NOT_FOUND
|
|
@@ -170,6 +246,23 @@ components:
|
|
|
170
246
|
$ref: '#/components/schemas/CommodityRates'
|
|
171
247
|
metadata:
|
|
172
248
|
$ref: '#/components/schemas/CommodityMetadata'
|
|
249
|
+
unresolved:
|
|
250
|
+
type: object
|
|
251
|
+
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.
|
|
252
|
+
additionalProperties:
|
|
253
|
+
type: object
|
|
254
|
+
properties:
|
|
255
|
+
message:
|
|
256
|
+
type: string
|
|
257
|
+
description: Detail message explaining why this symbol was not resolved.
|
|
258
|
+
suggestions:
|
|
259
|
+
type: array
|
|
260
|
+
description: Optional list of supported symbols that closely match the unresolved symbol.
|
|
261
|
+
items:
|
|
262
|
+
type: string
|
|
263
|
+
warning:
|
|
264
|
+
type: string
|
|
265
|
+
description: Present only when currency conversion for the requested `quote` is temporarily unavailable; rates are returned in each commodity's default currency instead.
|
|
173
266
|
description: Live commodity prices response containing success status, timestamp, rates, and metadata.
|
|
174
267
|
CommodityRates:
|
|
175
268
|
type: object
|
|
@@ -219,15 +312,16 @@ components:
|
|
|
219
312
|
description: Timestamp when the error occurred (ISO 8601).
|
|
220
313
|
CommodityNotFoundError:
|
|
221
314
|
type: object
|
|
222
|
-
description: Error envelope returned by the commodity pricing service specifically for unresolvable symbol/quote errors. Uses `code` instead of `status` and
|
|
315
|
+
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
316
|
required:
|
|
224
317
|
- code
|
|
225
318
|
- error
|
|
226
319
|
- message
|
|
227
320
|
properties:
|
|
228
321
|
timestamp:
|
|
229
|
-
type:
|
|
230
|
-
|
|
322
|
+
type: string
|
|
323
|
+
format: date-time
|
|
324
|
+
description: Timestamp when the error occurred (ISO 8601).
|
|
231
325
|
path:
|
|
232
326
|
type: string
|
|
233
327
|
description: Internal service path that produced the error.
|
|
@@ -240,6 +334,20 @@ components:
|
|
|
240
334
|
message:
|
|
241
335
|
type: string
|
|
242
336
|
description: Human-readable error message describing the failure.
|
|
337
|
+
unresolved:
|
|
338
|
+
type: object
|
|
339
|
+
description: Present only on SYMBOL_NOT_FOUND errors. Map of each unresolved symbol to a detail message and optional close-match suggestions.
|
|
340
|
+
additionalProperties:
|
|
341
|
+
type: object
|
|
342
|
+
properties:
|
|
343
|
+
message:
|
|
344
|
+
type: string
|
|
345
|
+
description: Detail message explaining why this symbol was not resolved.
|
|
346
|
+
suggestions:
|
|
347
|
+
type: array
|
|
348
|
+
description: Optional list of supported symbols that closely match the unresolved symbol.
|
|
349
|
+
items:
|
|
350
|
+
type: string
|
|
243
351
|
headers:
|
|
244
352
|
X-AF-Credits-Cost:
|
|
245
353
|
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:
|
|
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: '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.'
|
|
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/
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
openapi: 3.1.1
|
|
2
2
|
info:
|
|
3
3
|
title: Commodities Time Series API
|
|
4
|
-
version:
|
|
5
|
-
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.
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
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.
|
|
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/
|
|
11
|
+
- url: https://api.apifreaks.com/v2.0
|
|
12
12
|
description: Commodity Time Series API Server
|
|
13
13
|
paths:
|
|
14
14
|
/commodity/time-series:
|
|
@@ -82,6 +82,44 @@ paths:
|
|
|
82
82
|
headers:
|
|
83
83
|
X-AF-Credits-Cost:
|
|
84
84
|
$ref: '#/components/headers/X-AF-Credits-Cost'
|
|
85
|
+
'206':
|
|
86
|
+
description: Partial Content — Some requested symbols could not be resolved
|
|
87
|
+
content:
|
|
88
|
+
application/json:
|
|
89
|
+
schema:
|
|
90
|
+
$ref: '#/components/schemas/CommodityTimeSeriesResponse'
|
|
91
|
+
examples:
|
|
92
|
+
partial:
|
|
93
|
+
summary: One valid symbol, one unresolved symbol
|
|
94
|
+
value:
|
|
95
|
+
success: true
|
|
96
|
+
startDate: '2025-01-06'
|
|
97
|
+
endDate: '2025-01-08'
|
|
98
|
+
rates:
|
|
99
|
+
'2025-01-06':
|
|
100
|
+
XAU:
|
|
101
|
+
open: 2649.01
|
|
102
|
+
high: 2651.33
|
|
103
|
+
low: 2645.36
|
|
104
|
+
close: 2646.91
|
|
105
|
+
'2025-01-07':
|
|
106
|
+
XAU:
|
|
107
|
+
open: 2662.45
|
|
108
|
+
high: 2663.06
|
|
109
|
+
low: 2655.66
|
|
110
|
+
close: 2658.9
|
|
111
|
+
'2025-01-08':
|
|
112
|
+
XAU:
|
|
113
|
+
open: 2669.69
|
|
114
|
+
high: 2674.68
|
|
115
|
+
low: 2668.58
|
|
116
|
+
close: 2671.8
|
|
117
|
+
unresolved:
|
|
118
|
+
FAKESYM:
|
|
119
|
+
message: We don't support this symbol, please visit our symbols page to see supported symbols.
|
|
120
|
+
headers:
|
|
121
|
+
X-AF-Credits-Cost:
|
|
122
|
+
$ref: '#/components/headers/X-AF-Credits-Cost'
|
|
85
123
|
'400':
|
|
86
124
|
description: Bad Request — Missing parameters, invalid dates, or date range exceeded
|
|
87
125
|
content:
|
|
@@ -92,9 +130,9 @@ paths:
|
|
|
92
130
|
value:
|
|
93
131
|
error: Invalid Param Exception
|
|
94
132
|
message: please pass correct parameters
|
|
95
|
-
path: /
|
|
133
|
+
path: /v2.0/commodity/time-series
|
|
96
134
|
status: 400
|
|
97
|
-
timestamp: '2026-
|
|
135
|
+
timestamp: '2026-09-14T08:43:58.547Z'
|
|
98
136
|
invalidDate:
|
|
99
137
|
summary: Date does not exist on the calendar
|
|
100
138
|
value:
|
|
@@ -124,6 +162,24 @@ paths:
|
|
|
124
162
|
headers:
|
|
125
163
|
X-AF-Credits-Cost:
|
|
126
164
|
$ref: '#/components/headers/X-AF-Credits-Cost'
|
|
165
|
+
'402':
|
|
166
|
+
description: Payment Required — Maximum symbols per request exceeded
|
|
167
|
+
content:
|
|
168
|
+
application/json:
|
|
169
|
+
schema:
|
|
170
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
171
|
+
examples:
|
|
172
|
+
maxSymbolsExceeded:
|
|
173
|
+
summary: Too many symbols requested
|
|
174
|
+
value:
|
|
175
|
+
timestamp: '2026-09-14T08:44:00.586Z'
|
|
176
|
+
path: /rates/time-series
|
|
177
|
+
code: 402
|
|
178
|
+
error: PAYMENT_REQUIRED
|
|
179
|
+
message: Maximum symbols per request exceeded
|
|
180
|
+
headers:
|
|
181
|
+
X-AF-Credits-Cost:
|
|
182
|
+
$ref: '#/components/headers/X-AF-Credits-Cost'
|
|
127
183
|
'404':
|
|
128
184
|
description: Not found - Symbol or data not available
|
|
129
185
|
content:
|
|
@@ -134,15 +190,18 @@ paths:
|
|
|
134
190
|
symbolNotFound:
|
|
135
191
|
summary: Symbol Not Found
|
|
136
192
|
value:
|
|
137
|
-
timestamp: '2026-
|
|
193
|
+
timestamp: '2026-09-14T08:44:00.586Z'
|
|
138
194
|
path: /rates/time-series
|
|
139
195
|
code: 404
|
|
140
196
|
error: SYMBOL_NOT_FOUND
|
|
141
197
|
message: The symbol is not supported, please visit the documentation for a list of supported symbols
|
|
198
|
+
unresolved:
|
|
199
|
+
FAKESYM:
|
|
200
|
+
message: We don't support this symbol, please visit our symbols page to see supported symbols.
|
|
142
201
|
dataNotFound:
|
|
143
202
|
summary: No data available for the given date range
|
|
144
203
|
value:
|
|
145
|
-
timestamp: '2026-
|
|
204
|
+
timestamp: '2026-09-14T08:44:31.547Z'
|
|
146
205
|
path: /rates/time-series
|
|
147
206
|
code: 404
|
|
148
207
|
error: DATA_NOT_FOUND
|
|
@@ -182,6 +241,20 @@ components:
|
|
|
182
241
|
description: End date of the time series (YYYY-MM-DD).
|
|
183
242
|
rates:
|
|
184
243
|
$ref: '#/components/schemas/CommodityTimeSeriesRates'
|
|
244
|
+
unresolved:
|
|
245
|
+
type: object
|
|
246
|
+
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.
|
|
247
|
+
additionalProperties:
|
|
248
|
+
type: object
|
|
249
|
+
properties:
|
|
250
|
+
message:
|
|
251
|
+
type: string
|
|
252
|
+
description: Detail message explaining why this symbol was not resolved.
|
|
253
|
+
suggestions:
|
|
254
|
+
type: array
|
|
255
|
+
description: Optional list of supported symbols that closely match the unresolved symbol.
|
|
256
|
+
items:
|
|
257
|
+
type: string
|
|
185
258
|
description: Commodity time series response containing date-indexed OHLC data per symbol.
|
|
186
259
|
CommodityTimeSeriesRates:
|
|
187
260
|
type: object
|
|
@@ -242,6 +315,20 @@ components:
|
|
|
242
315
|
type: string
|
|
243
316
|
format: date-time
|
|
244
317
|
description: Timestamp when the error occurred (ISO 8601).
|
|
318
|
+
unresolved:
|
|
319
|
+
type: object
|
|
320
|
+
description: Present only on SYMBOL_NOT_FOUND errors. Map of each unresolved symbol to a detail message and optional close-match suggestions.
|
|
321
|
+
additionalProperties:
|
|
322
|
+
type: object
|
|
323
|
+
properties:
|
|
324
|
+
message:
|
|
325
|
+
type: string
|
|
326
|
+
description: Detail message explaining why this symbol was not resolved.
|
|
327
|
+
suggestions:
|
|
328
|
+
type: array
|
|
329
|
+
description: Optional list of supported symbols that closely match the unresolved symbol.
|
|
330
|
+
items:
|
|
331
|
+
type: string
|
|
245
332
|
headers:
|
|
246
333
|
X-AF-Credits-Cost:
|
|
247
334
|
description: Specifies the number of credits consumed by the current request.
|