@apifreaks/openapi-specs 0.1.0 → 0.1.1
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 +131 -0
- package/dist/index.d.cts +140 -3
- package/dist/index.d.ts +140 -3
- package/dist/index.js +129 -0
- package/dist/specs/commodity/commodity-fluctuation.yaml +225 -0
- package/dist/specs/commodity/commodity-prices.yaml +236 -0
- package/dist/specs/commodity/commodity-symbols.yaml +159 -0
- package/dist/specs/commodity/commodity-time-series.yaml +238 -0
- package/dist/specs/commodity/historical-commodity-prices.yaml +208 -0
- package/dist/specs/currency/currency-converter.yaml +193 -0
- package/dist/specs/currency/currency-fluctuation.yaml +211 -0
- package/dist/specs/currency/currency-historical-data-limit.yaml +112 -0
- package/dist/specs/currency/currency-rate.yaml +173 -0
- package/dist/specs/currency/currency-supported.yaml +176 -0
- package/dist/specs/currency/currency-symbols.yaml +115 -0
- package/dist/specs/currency/currency-time-series.yaml +232 -0
- package/dist/specs/currency/geolocalized-currency-conversion.yaml +214 -0
- package/dist/specs/currency/historical-currency-converter.yaml +195 -0
- package/dist/specs/currency/historical-currency-rate.yaml +180 -0
- package/dist/specs/dns/bulk-dns-lookup.yaml +484 -0
- package/dist/specs/dns/dns-history-lookup.yaml +451 -0
- package/dist/specs/dns/dns-lookup.yaml +360 -0
- package/dist/specs/dns/reverse-dns-lookup.yaml +338 -0
- package/dist/specs/domain/bulk-domain-checker.yaml +198 -0
- package/dist/specs/domain/domain-search-with-suggestions.yaml +196 -0
- package/dist/specs/domain/domain-search.yaml +149 -0
- package/dist/specs/domain/subdomain-lookup.yaml +251 -0
- package/dist/specs/email-validation/bulk-email-validation.yaml +403 -0
- package/dist/specs/email-validation/email-checker.yaml +451 -0
- package/dist/specs/financial/bulk-vat-rates-country.yaml +250 -0
- package/dist/specs/financial/financial-apis-supported-countries.yaml +152 -0
- package/dist/specs/financial/iban-validation.yaml +270 -0
- package/dist/specs/financial/swift-code-finder.yaml +146 -0
- package/dist/specs/financial/swift-code-lookup.yaml +156 -0
- package/dist/specs/financial/vat-number-validation.yaml +205 -0
- package/dist/specs/financial/vat-rates-by-ip.yaml +200 -0
- package/dist/specs/financial/vat-rates-country.yaml +212 -0
- package/dist/specs/general/usage-credits.yaml +188 -0
- package/dist/specs/geocoding/forward-geocoding.yaml +292 -0
- package/dist/specs/geocoding/reverse-geocoding.yaml +237 -0
- package/dist/specs/geodb/administrative-units-details.yaml +180 -0
- package/dist/specs/geodb/administrative-units-levels.yaml +140 -0
- package/dist/specs/geodb/administrative-units.yaml +168 -0
- package/dist/specs/geodb/cities.yaml +209 -0
- package/dist/specs/geodb/countries-details.yaml +207 -0
- package/dist/specs/geodb/countries.yaml +199 -0
- package/dist/specs/geodb/flags-supported.yaml +119 -0
- package/dist/specs/geodb/flags.yaml +170 -0
- package/dist/specs/geodb/regions.yaml +76 -0
- package/dist/specs/geodb/subregions.yaml +158 -0
- package/dist/specs/ip-intelligence/bulk-ip-lookup.yaml +895 -0
- package/dist/specs/ip-intelligence/bulk-ip-threat-intelligence.yaml +310 -0
- package/dist/specs/ip-intelligence/ip-locator.yaml +708 -0
- package/dist/specs/ip-intelligence/ip-threat-intelligence.yaml +230 -0
- package/dist/specs/other/astronomy-data.yaml +632 -0
- package/dist/specs/pdf/delete-pdf-page.yaml +193 -0
- package/dist/specs/pdf/linearize-pdf.yaml +187 -0
- package/dist/specs/pdf/merge-pdf.yaml +193 -0
- package/dist/specs/pdf/pdf-compress.yaml +208 -0
- package/dist/specs/pdf/pdf-decrypt.yaml +202 -0
- package/dist/specs/pdf/pdf-encrypt.yaml +213 -0
- package/dist/specs/pdf/pdf-extract-pages.yaml +199 -0
- package/dist/specs/pdf/pdf-file-status.yaml +148 -0
- package/dist/specs/pdf/pdf-file.yaml +136 -0
- package/dist/specs/pdf/pdf-files.yaml +85 -0
- package/dist/specs/pdf/pdf-resource-download.yaml +117 -0
- package/dist/specs/pdf/pdf-resource-upload-binary.yaml +152 -0
- package/dist/specs/pdf/pdf-resource-upload.yaml +163 -0
- package/dist/specs/pdf/pdf-restrict.yaml +246 -0
- package/dist/specs/pdf/pdf-split-pages.yaml +208 -0
- package/dist/specs/pdf/pdf-task-status.yaml +187 -0
- package/dist/specs/pdf/pdf-to-image.yaml +844 -0
- package/dist/specs/pdf/pdf-unrestrict.yaml +221 -0
- package/dist/specs/pdf/rotate-pdf-pages.yaml +207 -0
- package/dist/specs/phone-validation/bulk-phone-number-validation.yaml +374 -0
- package/dist/specs/phone-validation/phone-number-validation.yaml +344 -0
- package/dist/specs/scraper/web-scraper.yaml +479 -0
- package/dist/specs/screenshot/bulk-screenshot.yaml +728 -0
- package/dist/specs/screenshot/website-screenshot.yaml +822 -0
- package/dist/specs/ssl/ssl-certificate-chain-lookup.yaml +593 -0
- package/dist/specs/ssl/ssl-certificate-lookup.yaml +478 -0
- package/dist/specs/timezone/timezone-converter.yaml +249 -0
- package/dist/specs/timezone/timezone-lookup.yaml +712 -0
- package/dist/specs/user-agent/bulk-user-agent-parser.yaml +340 -0
- package/dist/specs/user-agent/user-agent-parser.yaml +271 -0
- package/dist/specs/weather/air-quality.yaml +590 -0
- package/dist/specs/weather/bulk-live-weather.yaml +654 -0
- package/dist/specs/weather/flood-forecast.yaml +519 -0
- package/dist/specs/weather/historical-weather.yaml +842 -0
- package/dist/specs/weather/live-weather.yaml +633 -0
- package/dist/specs/weather/marine-weather.yaml +806 -0
- package/dist/specs/weather/time-series-weather.yaml +821 -0
- package/dist/specs/weather/weather-forecast.yaml +935 -0
- package/dist/specs/whois/asn-lookup.yaml +618 -0
- package/dist/specs/whois/bulk-whois-lookup.yaml +827 -0
- package/dist/specs/whois/domain-whois-history-lookup.yaml +445 -0
- package/dist/specs/whois/reverse-whois.yaml +566 -0
- package/dist/specs/whois/whois-domain-lookup.yaml +537 -0
- package/dist/specs/whois/whois-ip-lookup.yaml +1123 -0
- package/dist/specs/zip-code/bulk-zip-code-lookup.yaml +232 -0
- package/dist/specs/zip-code/zip-code-api.yaml +216 -0
- package/dist/specs/zip-code/zip-code-distance-match.yaml +239 -0
- package/dist/specs/zip-code/zip-code-distance.yaml +233 -0
- package/dist/specs/zip-code/zip-codes-by-city.yaml +201 -0
- package/dist/specs/zip-code/zip-codes-by-region.yaml +200 -0
- package/dist/specs/zip-code/zip-codes-radius-search.yaml +262 -0
- package/package.json +6 -2
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
openapi: 3.1.1
|
|
2
|
+
info:
|
|
3
|
+
title: Commodities Time Series API
|
|
4
|
+
version: 1.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. 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
|
+
contact:
|
|
7
|
+
name: APIFreaks Support
|
|
8
|
+
url: https://apifreaks.com/contact
|
|
9
|
+
email: support@apifreaks.com
|
|
10
|
+
servers:
|
|
11
|
+
- url: https://api.apifreaks.com/v1.0
|
|
12
|
+
description: Commodity Time Series API Server
|
|
13
|
+
paths:
|
|
14
|
+
/commodity/time-series:
|
|
15
|
+
get:
|
|
16
|
+
tags:
|
|
17
|
+
- Commodity APIs
|
|
18
|
+
summary: Get commodity price time series
|
|
19
|
+
description: Returns day-by-day OHLC data for the requested commodity symbols within a date range.
|
|
20
|
+
operationId: getCommodityTimeSeries
|
|
21
|
+
parameters:
|
|
22
|
+
- name: format
|
|
23
|
+
in: query
|
|
24
|
+
required: false
|
|
25
|
+
description: Response format. Currently only `json` is supported.
|
|
26
|
+
schema:
|
|
27
|
+
type: string
|
|
28
|
+
default: json
|
|
29
|
+
enum:
|
|
30
|
+
- json
|
|
31
|
+
- name: symbols
|
|
32
|
+
in: query
|
|
33
|
+
required: true
|
|
34
|
+
description: Comma-separated list of commodity symbols.
|
|
35
|
+
schema:
|
|
36
|
+
type: string
|
|
37
|
+
- name: startDate
|
|
38
|
+
in: query
|
|
39
|
+
required: true
|
|
40
|
+
description: Start date in `YYYY-MM-DD` format.
|
|
41
|
+
schema:
|
|
42
|
+
type: string
|
|
43
|
+
- name: endDate
|
|
44
|
+
in: query
|
|
45
|
+
required: true
|
|
46
|
+
description: End date in `YYYY-MM-DD` format. Maximum range is 365 days.
|
|
47
|
+
schema:
|
|
48
|
+
type: string
|
|
49
|
+
responses:
|
|
50
|
+
'200':
|
|
51
|
+
description: Successful operation
|
|
52
|
+
content:
|
|
53
|
+
application/json:
|
|
54
|
+
schema:
|
|
55
|
+
$ref: '#/components/schemas/CommodityTimeSeriesResponse'
|
|
56
|
+
examples:
|
|
57
|
+
success:
|
|
58
|
+
summary: Successful response
|
|
59
|
+
value:
|
|
60
|
+
success: true
|
|
61
|
+
startDate: '2025-01-06'
|
|
62
|
+
endDate: '2025-01-08'
|
|
63
|
+
rates:
|
|
64
|
+
'2025-01-06':
|
|
65
|
+
XAU:
|
|
66
|
+
open: 2649.01
|
|
67
|
+
high: 2651.33
|
|
68
|
+
low: 2645.36
|
|
69
|
+
close: 2646.91
|
|
70
|
+
'2025-01-07':
|
|
71
|
+
XAU:
|
|
72
|
+
open: 2662.45
|
|
73
|
+
high: 2663.06
|
|
74
|
+
low: 2655.66
|
|
75
|
+
close: 2658.9
|
|
76
|
+
'2025-01-08':
|
|
77
|
+
XAU:
|
|
78
|
+
open: 2669.69
|
|
79
|
+
high: 2674.68
|
|
80
|
+
low: 2668.58
|
|
81
|
+
close: 2671.8
|
|
82
|
+
'400':
|
|
83
|
+
description: Bad Request — Missing parameters, invalid dates, or date range exceeded
|
|
84
|
+
content:
|
|
85
|
+
application/json:
|
|
86
|
+
examples:
|
|
87
|
+
missingSymbols:
|
|
88
|
+
summary: Missing required symbols parameter
|
|
89
|
+
value:
|
|
90
|
+
error: Invalid Param Exception
|
|
91
|
+
message: please pass correct parameters
|
|
92
|
+
path: /v1.0/commodity/time-series
|
|
93
|
+
status: 400
|
|
94
|
+
timestamp: '2026-07-27T11:38:40.063Z'
|
|
95
|
+
invalidDate:
|
|
96
|
+
summary: Date does not exist on the calendar
|
|
97
|
+
value:
|
|
98
|
+
timestamp: '2026-07-27T11:38:41.234Z'
|
|
99
|
+
path: /rates/time-series
|
|
100
|
+
code: 400
|
|
101
|
+
error: VALIDATION_ERROR
|
|
102
|
+
message: 'Invalid Date: The provided start date or end date does not exist.'
|
|
103
|
+
startAfterEnd:
|
|
104
|
+
summary: startDate is after endDate
|
|
105
|
+
value:
|
|
106
|
+
timestamp: '2026-07-27T11:38:41.234Z'
|
|
107
|
+
path: /rates/time-series
|
|
108
|
+
code: 400
|
|
109
|
+
error: VALIDATION_ERROR
|
|
110
|
+
message: start date cannot be after end date
|
|
111
|
+
dateRangeExceeded:
|
|
112
|
+
summary: Date range exceeds 365 days
|
|
113
|
+
value:
|
|
114
|
+
timestamp: '2026-07-27T11:38:40.699Z'
|
|
115
|
+
path: /rates/time-series
|
|
116
|
+
code: 400
|
|
117
|
+
error: VALIDATION_ERROR
|
|
118
|
+
message: Date range exceeds the allowed limit.
|
|
119
|
+
schema:
|
|
120
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
121
|
+
'404':
|
|
122
|
+
description: Not found - Symbol or data not available
|
|
123
|
+
content:
|
|
124
|
+
application/json:
|
|
125
|
+
schema:
|
|
126
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
127
|
+
examples:
|
|
128
|
+
symbolNotFound:
|
|
129
|
+
summary: Symbol Not Found
|
|
130
|
+
value:
|
|
131
|
+
timestamp: '2026-07-27T11:38:41.234Z'
|
|
132
|
+
path: /rates/time-series
|
|
133
|
+
code: 404
|
|
134
|
+
error: SYMBOL_NOT_FOUND
|
|
135
|
+
message: The symbol is not supported, please visit the documentation for a list of supported symbols
|
|
136
|
+
dataNotFound:
|
|
137
|
+
summary: No data available for the given date range
|
|
138
|
+
value:
|
|
139
|
+
timestamp: '2026-07-27T11:38:41.234Z'
|
|
140
|
+
path: /rates/time-series
|
|
141
|
+
code: 404
|
|
142
|
+
error: DATA_NOT_FOUND
|
|
143
|
+
message: No data found for the specified date range
|
|
144
|
+
components:
|
|
145
|
+
securitySchemes:
|
|
146
|
+
ApiKeyAuthHeader:
|
|
147
|
+
type: apiKey
|
|
148
|
+
in: header
|
|
149
|
+
name: X-apiKey
|
|
150
|
+
description: Pass your API key via the X-apiKey request header.
|
|
151
|
+
ApiKeyAuthQuery:
|
|
152
|
+
type: apiKey
|
|
153
|
+
in: query
|
|
154
|
+
name: apiKey
|
|
155
|
+
description: Pass your API key via the apiKey query parameter.
|
|
156
|
+
schemas:
|
|
157
|
+
CommodityTimeSeriesResponse:
|
|
158
|
+
type: object
|
|
159
|
+
required:
|
|
160
|
+
- success
|
|
161
|
+
- startDate
|
|
162
|
+
- endDate
|
|
163
|
+
- rates
|
|
164
|
+
properties:
|
|
165
|
+
success:
|
|
166
|
+
type: boolean
|
|
167
|
+
description: '`true` for successful requests.'
|
|
168
|
+
startDate:
|
|
169
|
+
type: string
|
|
170
|
+
description: Start date of the time series (YYYY-MM-DD).
|
|
171
|
+
endDate:
|
|
172
|
+
type: string
|
|
173
|
+
description: End date of the time series (YYYY-MM-DD).
|
|
174
|
+
rates:
|
|
175
|
+
$ref: '#/components/schemas/CommodityTimeSeriesRates'
|
|
176
|
+
description: Commodity time series response containing date-indexed OHLC data per symbol.
|
|
177
|
+
CommodityTimeSeriesRates:
|
|
178
|
+
type: object
|
|
179
|
+
description: Map of trading dates to per-symbol OHLC data. Each key is a trading date (YYYY-MM-DD); non-trading days are excluded.
|
|
180
|
+
additionalProperties:
|
|
181
|
+
title: CommodityTimeSeriesSymbolData
|
|
182
|
+
type: object
|
|
183
|
+
description: Map of commodity symbols to their OHLC data for a single trading date. Each key is a commodity symbol (e.g. XAU).
|
|
184
|
+
additionalProperties:
|
|
185
|
+
$ref: '#/components/schemas/CommodityOhlc'
|
|
186
|
+
CommodityOhlc:
|
|
187
|
+
type: object
|
|
188
|
+
description: OHLC price data for a single commodity on a single trading day.
|
|
189
|
+
required:
|
|
190
|
+
- open
|
|
191
|
+
- high
|
|
192
|
+
- low
|
|
193
|
+
- close
|
|
194
|
+
properties:
|
|
195
|
+
open:
|
|
196
|
+
type: number
|
|
197
|
+
format: float
|
|
198
|
+
description: Opening price on the given date.
|
|
199
|
+
high:
|
|
200
|
+
type: number
|
|
201
|
+
format: float
|
|
202
|
+
description: Highest price on the given date.
|
|
203
|
+
low:
|
|
204
|
+
type: number
|
|
205
|
+
format: float
|
|
206
|
+
description: Lowest price on the given date.
|
|
207
|
+
close:
|
|
208
|
+
type: number
|
|
209
|
+
format: float
|
|
210
|
+
description: Closing price on the given date.
|
|
211
|
+
ErrorResponse:
|
|
212
|
+
type: object
|
|
213
|
+
description: Standard error envelope returned by the API on failed requests. Gateway-level validation errors populate status; commodity-service errors (date/symbol/data validation) populate code instead — check whichever is present.
|
|
214
|
+
required:
|
|
215
|
+
- message
|
|
216
|
+
properties:
|
|
217
|
+
error:
|
|
218
|
+
type: string
|
|
219
|
+
description: Short error category or exception type (e.g., Invalid Param Exception, VALIDATION_ERROR, SYMBOL_NOT_FOUND, DATA_NOT_FOUND).
|
|
220
|
+
message:
|
|
221
|
+
type: string
|
|
222
|
+
description: Human-readable error message describing the failure.
|
|
223
|
+
path:
|
|
224
|
+
type: string
|
|
225
|
+
description: API endpoint path (gateway errors) or internal service path (commodity-service errors) that produced the error.
|
|
226
|
+
status:
|
|
227
|
+
type: integer
|
|
228
|
+
description: HTTP status code. Present on gateway-level errors.
|
|
229
|
+
code:
|
|
230
|
+
type: integer
|
|
231
|
+
description: HTTP status code. Present on commodity-service errors instead of status.
|
|
232
|
+
timestamp:
|
|
233
|
+
type: string
|
|
234
|
+
format: date-time
|
|
235
|
+
description: Timestamp when the error occurred (ISO 8601).
|
|
236
|
+
security:
|
|
237
|
+
- ApiKeyAuthHeader: []
|
|
238
|
+
- ApiKeyAuthQuery: []
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
openapi: 3.1.1
|
|
2
|
+
info:
|
|
3
|
+
title: Historical Commodity Prices, Delivered Simply.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: Retrieve OHLC (open, high, low, close) price data for any supported commodity on a specific date. Data is available from January 1990 onwards for 130+ commodities. Accepts one or more comma-separated commodity symbols and a date in YYYY-MM-DD format. The response contains the opening, high, low, and closing price for each symbol on the given date. Returns a 400 error for invalid dates and a 404 error for unsupported symbols or missing rates.
|
|
6
|
+
contact:
|
|
7
|
+
name: APIFreaks Support
|
|
8
|
+
url: https://apifreaks.com/contact
|
|
9
|
+
email: support@apifreaks.com
|
|
10
|
+
servers:
|
|
11
|
+
- url: https://api.apifreaks.com/v1.0
|
|
12
|
+
description: Historical Commodity Prices API Server
|
|
13
|
+
paths:
|
|
14
|
+
/commodity/rates/historical:
|
|
15
|
+
get:
|
|
16
|
+
tags:
|
|
17
|
+
- Commodity APIs
|
|
18
|
+
summary: Get historical commodity prices
|
|
19
|
+
description: Returns OHLC price data for the requested commodity symbols on a specific date.
|
|
20
|
+
operationId: getHistoricalCommodityPrices
|
|
21
|
+
parameters:
|
|
22
|
+
- name: format
|
|
23
|
+
in: query
|
|
24
|
+
required: false
|
|
25
|
+
description: Response format. Currently only `json` is supported.
|
|
26
|
+
schema:
|
|
27
|
+
type: string
|
|
28
|
+
default: json
|
|
29
|
+
enum:
|
|
30
|
+
- json
|
|
31
|
+
- name: symbols
|
|
32
|
+
in: query
|
|
33
|
+
required: true
|
|
34
|
+
description: Comma-separated list of commodity symbols.
|
|
35
|
+
schema:
|
|
36
|
+
type: string
|
|
37
|
+
- name: date
|
|
38
|
+
in: query
|
|
39
|
+
required: true
|
|
40
|
+
description: Date in `YYYY-MM-DD` format. Data available from 1990 onwards.
|
|
41
|
+
schema:
|
|
42
|
+
type: string
|
|
43
|
+
responses:
|
|
44
|
+
'200':
|
|
45
|
+
description: Successful operation
|
|
46
|
+
content:
|
|
47
|
+
application/json:
|
|
48
|
+
schema:
|
|
49
|
+
$ref: '#/components/schemas/HistoricalCommodityPricesResponse'
|
|
50
|
+
examples:
|
|
51
|
+
success:
|
|
52
|
+
summary: Successful response
|
|
53
|
+
value:
|
|
54
|
+
success: true
|
|
55
|
+
date: '2025-01-10'
|
|
56
|
+
rates:
|
|
57
|
+
WTIOIL-SPOT:
|
|
58
|
+
date: '2025-01-10'
|
|
59
|
+
open: 73.77
|
|
60
|
+
high: 77.16
|
|
61
|
+
low: 73.55
|
|
62
|
+
close: 75.97
|
|
63
|
+
XAU:
|
|
64
|
+
date: '2025-01-10'
|
|
65
|
+
open: 2669.93
|
|
66
|
+
high: 2697.85
|
|
67
|
+
low: 2663.61
|
|
68
|
+
close: 2689.44
|
|
69
|
+
'400':
|
|
70
|
+
description: Bad request - Invalid date format
|
|
71
|
+
content:
|
|
72
|
+
application/json:
|
|
73
|
+
schema:
|
|
74
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
75
|
+
examples:
|
|
76
|
+
invalidDateFormat:
|
|
77
|
+
summary: Invalid date format
|
|
78
|
+
value:
|
|
79
|
+
timestamp: 1781792620618
|
|
80
|
+
status: 400
|
|
81
|
+
error: VALIDATION_ERROR
|
|
82
|
+
message: Invalid Date Format (YYYY-MM-DD).
|
|
83
|
+
path: /v1.0/commodity/rates/historical
|
|
84
|
+
dateNotExist:
|
|
85
|
+
summary: Date does not exist
|
|
86
|
+
value:
|
|
87
|
+
timestamp: 1781792620618
|
|
88
|
+
status: 400
|
|
89
|
+
error: VALIDATION_ERROR
|
|
90
|
+
message: 'Invalid Date: The provided date does not exist.'
|
|
91
|
+
path: /v1.0/commodity/rates/historical
|
|
92
|
+
'404':
|
|
93
|
+
description: Not found - Symbol or rate not available
|
|
94
|
+
content:
|
|
95
|
+
application/json:
|
|
96
|
+
schema:
|
|
97
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
98
|
+
examples:
|
|
99
|
+
symbolNotFound:
|
|
100
|
+
summary: Symbol Not Found
|
|
101
|
+
value:
|
|
102
|
+
timestamp: 1781792620618
|
|
103
|
+
status: 404
|
|
104
|
+
error: SYMBOL_NOT_FOUND
|
|
105
|
+
message: The symbol is not supported, please visit the documentation for a list of supported symbols
|
|
106
|
+
path: /v1.0/commodity/rates/historical
|
|
107
|
+
rateNotFound:
|
|
108
|
+
summary: Rate Not Found
|
|
109
|
+
value:
|
|
110
|
+
timestamp: 1781792620618
|
|
111
|
+
status: 404
|
|
112
|
+
error: RATE_NOT_FOUND
|
|
113
|
+
message: no rates found for the specified date
|
|
114
|
+
path: /v1.0/commodity/rates/historical
|
|
115
|
+
components:
|
|
116
|
+
securitySchemes:
|
|
117
|
+
ApiKeyAuthHeader:
|
|
118
|
+
type: apiKey
|
|
119
|
+
in: header
|
|
120
|
+
name: X-apiKey
|
|
121
|
+
description: Pass your API key via the X-apiKey request header.
|
|
122
|
+
ApiKeyAuthQuery:
|
|
123
|
+
type: apiKey
|
|
124
|
+
in: query
|
|
125
|
+
name: apiKey
|
|
126
|
+
description: Pass your API key via the apiKey query parameter.
|
|
127
|
+
schemas:
|
|
128
|
+
HistoricalCommodityPricesResponse:
|
|
129
|
+
type: object
|
|
130
|
+
required:
|
|
131
|
+
- success
|
|
132
|
+
- date
|
|
133
|
+
- rates
|
|
134
|
+
properties:
|
|
135
|
+
success:
|
|
136
|
+
type: boolean
|
|
137
|
+
description: '`true` for successful requests.'
|
|
138
|
+
date:
|
|
139
|
+
type: string
|
|
140
|
+
description: Date for which prices were fetched (YYYY-MM-DD).
|
|
141
|
+
rates:
|
|
142
|
+
$ref: '#/components/schemas/HistoricalCommodityRates'
|
|
143
|
+
description: Historical commodity prices response containing success status, date, and OHLC rate data.
|
|
144
|
+
HistoricalCommodityRates:
|
|
145
|
+
type: object
|
|
146
|
+
description: Object of commodity symbols to their OHLC price data. Each key is a commodity symbol and the value contains date, open, high, low, and close prices.
|
|
147
|
+
properties:
|
|
148
|
+
symbol:
|
|
149
|
+
$ref: '#/components/schemas/HistoricalCommodityRate'
|
|
150
|
+
required:
|
|
151
|
+
- symbol
|
|
152
|
+
HistoricalCommodityRate:
|
|
153
|
+
type: object
|
|
154
|
+
description: OHLC price data for a single commodity on a specific date.
|
|
155
|
+
required:
|
|
156
|
+
- date
|
|
157
|
+
- open
|
|
158
|
+
- high
|
|
159
|
+
- low
|
|
160
|
+
- close
|
|
161
|
+
properties:
|
|
162
|
+
date:
|
|
163
|
+
type: string
|
|
164
|
+
description: Date for which prices were fetched (YYYY-MM-DD).
|
|
165
|
+
open:
|
|
166
|
+
type: number
|
|
167
|
+
format: float
|
|
168
|
+
description: Opening price on the given date.
|
|
169
|
+
high:
|
|
170
|
+
type: number
|
|
171
|
+
format: float
|
|
172
|
+
description: Highest price recorded on the given date.
|
|
173
|
+
low:
|
|
174
|
+
type: number
|
|
175
|
+
format: float
|
|
176
|
+
description: Lowest price recorded on the given date.
|
|
177
|
+
close:
|
|
178
|
+
type: number
|
|
179
|
+
format: float
|
|
180
|
+
description: Closing price on the given date.
|
|
181
|
+
ErrorResponse:
|
|
182
|
+
type: object
|
|
183
|
+
required:
|
|
184
|
+
- timestamp
|
|
185
|
+
- status
|
|
186
|
+
- error
|
|
187
|
+
- message
|
|
188
|
+
- path
|
|
189
|
+
properties:
|
|
190
|
+
timestamp:
|
|
191
|
+
type: integer
|
|
192
|
+
description: Unix timestamp in milliseconds when the error occurred.
|
|
193
|
+
status:
|
|
194
|
+
type: integer
|
|
195
|
+
description: HTTP status code returned with the error.
|
|
196
|
+
error:
|
|
197
|
+
type: string
|
|
198
|
+
description: Specific error type (e.g., SYMBOL_NOT_FOUND, VALIDATION_ERROR).
|
|
199
|
+
message:
|
|
200
|
+
type: string
|
|
201
|
+
description: Human-readable error message describing the failure.
|
|
202
|
+
path:
|
|
203
|
+
type: string
|
|
204
|
+
description: API endpoint path that produced the error.
|
|
205
|
+
description: Standard error envelope returned by the API on failed requests.
|
|
206
|
+
security:
|
|
207
|
+
- ApiKeyAuthHeader: []
|
|
208
|
+
- ApiKeyAuthQuery: []
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
openapi: 3.1.1
|
|
2
|
+
info:
|
|
3
|
+
title: Currency Converter API - Convert 970+ Fiat & Crypto Currencies at Live or Historical Rates
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: Convert an amount from one currency to another using the latest exchange rates. Supports fiat, crypto, and metals. Specify source currency, target currency, and amount to receive the current rate and converted amount with timestamp. All parameters are case-insensitive for both fiat/currency codes and crypto/symbols.
|
|
6
|
+
contact:
|
|
7
|
+
name: APIFreaks Support
|
|
8
|
+
url: https://apifreaks.com/contact
|
|
9
|
+
email: support@apifreaks.com
|
|
10
|
+
servers:
|
|
11
|
+
- url: https://api.apifreaks.com/v1.0
|
|
12
|
+
description: Currency Converter API Server
|
|
13
|
+
paths:
|
|
14
|
+
/currency/converter/latest/prices:
|
|
15
|
+
get:
|
|
16
|
+
tags:
|
|
17
|
+
- Currency APIs
|
|
18
|
+
summary: Convert currency with latest rates
|
|
19
|
+
description: Converts an amount from one currency to another using the latest exchange rates.
|
|
20
|
+
operationId: convertLatest
|
|
21
|
+
parameters:
|
|
22
|
+
- name: format
|
|
23
|
+
in: query
|
|
24
|
+
required: false
|
|
25
|
+
description: 'Response format: `json` (default) or `xml`.'
|
|
26
|
+
schema:
|
|
27
|
+
type: string
|
|
28
|
+
enum:
|
|
29
|
+
- json
|
|
30
|
+
- xml
|
|
31
|
+
default: json
|
|
32
|
+
- name: from
|
|
33
|
+
in: query
|
|
34
|
+
required: true
|
|
35
|
+
description: Source currency code.
|
|
36
|
+
schema:
|
|
37
|
+
type: string
|
|
38
|
+
- name: to
|
|
39
|
+
in: query
|
|
40
|
+
required: true
|
|
41
|
+
description: Target currency code.
|
|
42
|
+
schema:
|
|
43
|
+
type: string
|
|
44
|
+
- name: amount
|
|
45
|
+
in: query
|
|
46
|
+
required: false
|
|
47
|
+
description: Amount to convert, as a decimal. Defaults to `1`. Must be numeric — non-numeric values return a 400 (negative values are accepted despite the error message's wording).
|
|
48
|
+
schema:
|
|
49
|
+
type: string
|
|
50
|
+
default: '1'
|
|
51
|
+
- name: updates
|
|
52
|
+
in: query
|
|
53
|
+
required: false
|
|
54
|
+
description: 'Update frequency: `1m` (default), `10m`, `1h`, or `1d`.'
|
|
55
|
+
schema:
|
|
56
|
+
type: string
|
|
57
|
+
enum:
|
|
58
|
+
- 1m
|
|
59
|
+
- 10m
|
|
60
|
+
- 1h
|
|
61
|
+
- 1d
|
|
62
|
+
default: 1m
|
|
63
|
+
responses:
|
|
64
|
+
'200':
|
|
65
|
+
description: Successful operation
|
|
66
|
+
content:
|
|
67
|
+
application/json:
|
|
68
|
+
schema:
|
|
69
|
+
$ref: '#/components/schemas/LatestCurrencyConverterResponse'
|
|
70
|
+
examples:
|
|
71
|
+
success:
|
|
72
|
+
summary: Successful response
|
|
73
|
+
value:
|
|
74
|
+
date: '2026-07-27 12:05:00+00'
|
|
75
|
+
from: USD
|
|
76
|
+
to: EUR
|
|
77
|
+
rate: '0.87800'
|
|
78
|
+
givenAmount: '100.0'
|
|
79
|
+
convertedAmount: '87.800'
|
|
80
|
+
'400':
|
|
81
|
+
description: Bad request - Invalid amount or updates parameter
|
|
82
|
+
content:
|
|
83
|
+
application/json:
|
|
84
|
+
schema:
|
|
85
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
86
|
+
examples:
|
|
87
|
+
missingParams:
|
|
88
|
+
summary: Missing required from/to parameter
|
|
89
|
+
value:
|
|
90
|
+
error: Invalid Param Exception
|
|
91
|
+
message: please pass correct parameters
|
|
92
|
+
path: /v1.0/currency/converter/latest/prices
|
|
93
|
+
status: 400
|
|
94
|
+
timestamp: '2026-07-27T12:05:29.609Z'
|
|
95
|
+
invalidAmount:
|
|
96
|
+
summary: amount is not numeric
|
|
97
|
+
value:
|
|
98
|
+
timestamp: 1785153941995
|
|
99
|
+
status: 400
|
|
100
|
+
error: Method Argument Type Mismatch
|
|
101
|
+
message: Invalid Amount. Please provide amount in decimal format and greater than 0!
|
|
102
|
+
path: /v2.0/convert/latest
|
|
103
|
+
invalidUpdates:
|
|
104
|
+
summary: updates is not one of 1m/10m/1h/1d
|
|
105
|
+
value:
|
|
106
|
+
timestamp: 1785153942533
|
|
107
|
+
status: 400
|
|
108
|
+
error: Invalid Param Exception
|
|
109
|
+
message: Please provide valid updates parameter (1d,1h,10m,1m)
|
|
110
|
+
path: /v2.0/convert/latest
|
|
111
|
+
'404':
|
|
112
|
+
description: Not found - Currency not available
|
|
113
|
+
content:
|
|
114
|
+
application/json:
|
|
115
|
+
schema:
|
|
116
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
117
|
+
examples:
|
|
118
|
+
invalidBase:
|
|
119
|
+
summary: from currency not supported
|
|
120
|
+
value:
|
|
121
|
+
timestamp: 1785153930704
|
|
122
|
+
status: 404
|
|
123
|
+
error: Not Found Exception
|
|
124
|
+
message: Rates of provided currency ZZZ are not available in our database!
|
|
125
|
+
path: /v2.0/convert/latest
|
|
126
|
+
components:
|
|
127
|
+
securitySchemes:
|
|
128
|
+
ApiKeyAuthHeader:
|
|
129
|
+
type: apiKey
|
|
130
|
+
in: header
|
|
131
|
+
name: X-apiKey
|
|
132
|
+
description: Pass your API key via the X-apiKey request header.
|
|
133
|
+
ApiKeyAuthQuery:
|
|
134
|
+
type: apiKey
|
|
135
|
+
in: query
|
|
136
|
+
name: apiKey
|
|
137
|
+
description: Pass your API key via the apiKey query parameter.
|
|
138
|
+
schemas:
|
|
139
|
+
LatestCurrencyConverterResponse:
|
|
140
|
+
type: object
|
|
141
|
+
required:
|
|
142
|
+
- date
|
|
143
|
+
- from
|
|
144
|
+
- to
|
|
145
|
+
- rate
|
|
146
|
+
- givenAmount
|
|
147
|
+
- convertedAmount
|
|
148
|
+
properties:
|
|
149
|
+
date:
|
|
150
|
+
type: string
|
|
151
|
+
description: Date and time with timezone (UTC) when the rate was recorded.
|
|
152
|
+
from:
|
|
153
|
+
type: string
|
|
154
|
+
description: Source currency code.
|
|
155
|
+
to:
|
|
156
|
+
type: string
|
|
157
|
+
description: Target currency code.
|
|
158
|
+
rate:
|
|
159
|
+
type: string
|
|
160
|
+
description: Conversion rate from source to target currency.
|
|
161
|
+
givenAmount:
|
|
162
|
+
type: string
|
|
163
|
+
description: The amount provided for conversion.
|
|
164
|
+
convertedAmount:
|
|
165
|
+
type: string
|
|
166
|
+
description: The converted amount in the target currency.
|
|
167
|
+
description: Currency conversion response containing the exchange rate and converted amount.
|
|
168
|
+
ErrorResponse:
|
|
169
|
+
type: object
|
|
170
|
+
description: Standard error envelope returned by the API on failed requests. Gateway-level validation errors use an ISO 8601 timestamp and the public endpoint path; currency-service errors use a Unix millisecond timestamp and an internal service path instead.
|
|
171
|
+
required:
|
|
172
|
+
- message
|
|
173
|
+
properties:
|
|
174
|
+
timestamp:
|
|
175
|
+
type:
|
|
176
|
+
- string
|
|
177
|
+
- integer
|
|
178
|
+
description: Timestamp when the error occurred — ISO 8601 string for gateway errors, Unix milliseconds integer for currency-service errors.
|
|
179
|
+
status:
|
|
180
|
+
type: integer
|
|
181
|
+
description: HTTP status code returned with the error.
|
|
182
|
+
error:
|
|
183
|
+
type: string
|
|
184
|
+
description: Specific error type (e.g., Invalid Param Exception, Method Argument Type Mismatch, Not Found Exception).
|
|
185
|
+
message:
|
|
186
|
+
type: string
|
|
187
|
+
description: Human-readable error message describing the failure.
|
|
188
|
+
path:
|
|
189
|
+
type: string
|
|
190
|
+
description: API endpoint path (gateway errors) or internal service path (currency-service errors) that produced the error.
|
|
191
|
+
security:
|
|
192
|
+
- ApiKeyAuthHeader: []
|
|
193
|
+
- ApiKeyAuthQuery: []
|