@apifreaks/openapi-specs 0.1.0
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/LICENSE +21 -0
- package/README.md +156 -0
- package/dist/index.cjs +44663 -0
- package/dist/index.d.cts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +44631 -0
- package/package.json +81 -0
- package/specs/commodity/commodity-fluctuation.json +301 -0
- package/specs/commodity/commodity-prices.json +317 -0
- package/specs/commodity/commodity-symbols.json +215 -0
- package/specs/commodity/commodity-time-series.json +329 -0
- package/specs/commodity/historical-commodity-prices.json +273 -0
- package/specs/currency/currency-converter.json +261 -0
- package/specs/currency/currency-fluctuation.json +282 -0
- package/specs/currency/currency-historical-data-limit.json +158 -0
- package/specs/currency/currency-rate.json +229 -0
- package/specs/currency/currency-supported.json +234 -0
- package/specs/currency/currency-symbols.json +161 -0
- package/specs/currency/currency-time-series.json +325 -0
- package/specs/currency/geolocalized-currency-conversion.json +287 -0
- package/specs/currency/historical-currency-converter.json +269 -0
- package/specs/currency/historical-currency-rate.json +246 -0
- package/specs/dns/bulk-dns-lookup.json +624 -0
- package/specs/dns/dns-history-lookup.json +579 -0
- package/specs/dns/dns-lookup.json +466 -0
- package/specs/dns/reverse-dns-lookup.json +414 -0
- package/specs/domain/bulk-domain-checker.json +284 -0
- package/specs/domain/domain-search-with-suggestions.json +280 -0
- package/specs/domain/domain-search.json +206 -0
- package/specs/domain/subdomain-lookup.json +343 -0
- package/specs/email-validation/bulk-email-validation.json +534 -0
- package/specs/email-validation/email-checker.json +586 -0
- package/specs/financial/bulk-vat-rates-country.json +341 -0
- package/specs/financial/financial-apis-supported-countries.json +204 -0
- package/specs/financial/iban-validation.json +328 -0
- package/specs/financial/swift-code-finder.json +192 -0
- package/specs/financial/swift-code-lookup.json +220 -0
- package/specs/financial/vat-number-validation.json +283 -0
- package/specs/financial/vat-rates-by-ip.json +275 -0
- package/specs/financial/vat-rates-country.json +288 -0
- package/specs/general/usage-credits.json +218 -0
- package/specs/geocoding/forward-geocoding.json +402 -0
- package/specs/geocoding/reverse-geocoding.json +326 -0
- package/specs/geodb/administrative-units-details.json +250 -0
- package/specs/geodb/administrative-units-levels.json +198 -0
- package/specs/geodb/administrative-units.json +237 -0
- package/specs/geodb/cities.json +288 -0
- package/specs/geodb/countries-details.json +274 -0
- package/specs/geodb/countries.json +276 -0
- package/specs/geodb/flags-supported.json +166 -0
- package/specs/geodb/flags.json +227 -0
- package/specs/geodb/regions.json +109 -0
- package/specs/geodb/subregions.json +217 -0
- package/specs/ip-intelligence/bulk-ip-lookup.json +1162 -0
- package/specs/ip-intelligence/bulk-ip-threat-intelligence.json +417 -0
- package/specs/ip-intelligence/ip-locator.json +941 -0
- package/specs/ip-intelligence/ip-threat-intelligence.json +316 -0
- package/specs/other/astronomy-data.json +803 -0
- package/specs/pdf/delete-pdf-page.json +286 -0
- package/specs/pdf/linearize-pdf.json +277 -0
- package/specs/pdf/merge-pdf.json +285 -0
- package/specs/pdf/pdf-compress.json +304 -0
- package/specs/pdf/pdf-decrypt.json +297 -0
- package/specs/pdf/pdf-encrypt.json +314 -0
- package/specs/pdf/pdf-extract-pages.json +295 -0
- package/specs/pdf/pdf-file-status.json +208 -0
- package/specs/pdf/pdf-file.json +190 -0
- package/specs/pdf/pdf-files.json +126 -0
- package/specs/pdf/pdf-resource-download.json +168 -0
- package/specs/pdf/pdf-resource-upload-binary.json +218 -0
- package/specs/pdf/pdf-resource-upload.json +248 -0
- package/specs/pdf/pdf-restrict.json +343 -0
- package/specs/pdf/pdf-split-pages.json +281 -0
- package/specs/pdf/pdf-task-status.json +252 -0
- package/specs/pdf/pdf-to-image.json +1219 -0
- package/specs/pdf/pdf-unrestrict.json +324 -0
- package/specs/pdf/rotate-pdf-pages.json +305 -0
- package/specs/phone-validation/bulk-phone-number-validation.json +518 -0
- package/specs/phone-validation/phone-number-validation.json +456 -0
- package/specs/scraper/web-scraper.json +674 -0
- package/specs/screenshot/bulk-screenshot.json +949 -0
- package/specs/screenshot/website-screenshot.json +1147 -0
- package/specs/ssl/ssl-certificate-chain-lookup.json +756 -0
- package/specs/ssl/ssl-certificate-lookup.json +634 -0
- package/specs/timezone/timezone-converter.json +362 -0
- package/specs/timezone/timezone-lookup.json +910 -0
- package/specs/user-agent/bulk-user-agent-parser.json +441 -0
- package/specs/user-agent/user-agent-parser.json +346 -0
- package/specs/weather/air-quality.json +779 -0
- package/specs/weather/bulk-live-weather.json +834 -0
- package/specs/weather/flood-forecast.json +693 -0
- package/specs/weather/historical-weather.json +1019 -0
- package/specs/weather/live-weather.json +789 -0
- package/specs/weather/marine-weather.json +940 -0
- package/specs/weather/time-series-weather.json +1056 -0
- package/specs/weather/weather-forecast.json +1202 -0
- package/specs/whois/asn-lookup.json +729 -0
- package/specs/whois/bulk-whois-lookup.json +698 -0
- package/specs/whois/domain-whois-history-lookup.json +500 -0
- package/specs/whois/reverse-whois.json +625 -0
- package/specs/whois/whois-domain-lookup.json +533 -0
- package/specs/whois/whois-ip-lookup.json +1110 -0
- package/specs/zip-code/bulk-zip-code-lookup.json +318 -0
- package/specs/zip-code/zip-code-api.json +299 -0
- package/specs/zip-code/zip-code-distance-match.json +311 -0
- package/specs/zip-code/zip-code-distance.json +307 -0
- package/specs/zip-code/zip-codes-by-city.json +279 -0
- package/specs/zip-code/zip-codes-by-region.json +278 -0
- package/specs/zip-code/zip-codes-radius-search.json +349 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.1",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Reverse Geocoding API - Convert Coordinates to a Street Address",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Convert a WGS84 latitude/longitude pair into a single human-readable address or place name. Returns the nearest matching location's structured address components (street, city, state, country), a bounding box, and any points of interest, such as a shop or building, at that location. Use the `Accept-Language` header to localize the returned name and address fields to a preferred language, falling back to `en` if the language isn't supported. Both `lat` (-90 to 90) and `lon` (-180 to 180) are required; missing, non-numeric, or out-of-range values return a `400` error.",
|
|
7
|
+
"contact": {
|
|
8
|
+
"name": "APIFreaks Support",
|
|
9
|
+
"url": "https://apifreaks.com/contact",
|
|
10
|
+
"email": "support@apifreaks.com"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"servers": [
|
|
14
|
+
{
|
|
15
|
+
"url": "https://api.apifreaks.com/v1.0",
|
|
16
|
+
"description": "Reverse Geocoding API Server"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"paths": {
|
|
20
|
+
"/geocoder/reverse": {
|
|
21
|
+
"get": {
|
|
22
|
+
"tags": ["Geocoder APIs"],
|
|
23
|
+
"summary": "Convert coordinates into a human-readable address",
|
|
24
|
+
"description": "Look up the nearest address or place name for a given latitude and longitude pair.",
|
|
25
|
+
"operationId": "reverseGeocode",
|
|
26
|
+
"parameters": [
|
|
27
|
+
{
|
|
28
|
+
"name": "lat",
|
|
29
|
+
"in": "query",
|
|
30
|
+
"required": true,
|
|
31
|
+
"description": "WGS84 latitude value, ranging from -90 to 90.",
|
|
32
|
+
"schema": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"format": "float"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "lon",
|
|
39
|
+
"in": "query",
|
|
40
|
+
"required": true,
|
|
41
|
+
"description": "WGS84 longitude value, ranging from -180 to 180.",
|
|
42
|
+
"schema": {
|
|
43
|
+
"type": "number",
|
|
44
|
+
"format": "float"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "Accept-Language",
|
|
49
|
+
"in": "header",
|
|
50
|
+
"required": false,
|
|
51
|
+
"description": "Preferred language order for the result name and address, as a comma-separated list of language codes or a single code. Results are returned in the first matched language, falling back to `en` if none match.",
|
|
52
|
+
"schema": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"responses": {
|
|
58
|
+
"200": {
|
|
59
|
+
"description": "Successful geocoding response",
|
|
60
|
+
"content": {
|
|
61
|
+
"application/json": {
|
|
62
|
+
"schema": {
|
|
63
|
+
"$ref": "#/components/schemas/GeocodeResponse"
|
|
64
|
+
},
|
|
65
|
+
"examples": {
|
|
66
|
+
"typicalSuccess": {
|
|
67
|
+
"summary": "Typical successful response",
|
|
68
|
+
"value": {
|
|
69
|
+
"lat": 40.7489669,
|
|
70
|
+
"lon": -73.985399,
|
|
71
|
+
"name": "LensCrafters",
|
|
72
|
+
"category": "shop",
|
|
73
|
+
"type": "optician",
|
|
74
|
+
"poi": [
|
|
75
|
+
{
|
|
76
|
+
"name": "LensCrafters",
|
|
77
|
+
"category": "shop",
|
|
78
|
+
"type": "optician"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "7",
|
|
82
|
+
"category": "place",
|
|
83
|
+
"type": "house_number"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"street": "West 34th Street",
|
|
87
|
+
"area": "Manhattan, New York County",
|
|
88
|
+
"postcode": "10001",
|
|
89
|
+
"city": "New York",
|
|
90
|
+
"state_code": "US-NY",
|
|
91
|
+
"state": "New York",
|
|
92
|
+
"country_code": "US",
|
|
93
|
+
"country": "United States",
|
|
94
|
+
"full_address": "LensCrafters, 7, West 34th Street, Midtown South, Manhattan Community Board 5, Manhattan, New York County, New York, 10001, United States",
|
|
95
|
+
"bounding_box": [
|
|
96
|
+
"40.7489169",
|
|
97
|
+
"40.7490169",
|
|
98
|
+
"-73.9854490",
|
|
99
|
+
"-73.9853490"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"400": {
|
|
108
|
+
"description": "Bad Request — Invalid or missing parameters",
|
|
109
|
+
"content": {
|
|
110
|
+
"application/json": {
|
|
111
|
+
"schema": {
|
|
112
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
113
|
+
},
|
|
114
|
+
"examples": {
|
|
115
|
+
"missingParams": {
|
|
116
|
+
"summary": "Missing required `lat` or `lon` parameter",
|
|
117
|
+
"value": {
|
|
118
|
+
"error": "Invalid Param Exception",
|
|
119
|
+
"message": "please pass correct parameters",
|
|
120
|
+
"path": "/v1.0/geocoder/reverse",
|
|
121
|
+
"status": 400,
|
|
122
|
+
"timestamp": "2026-07-22T14:29:45.148Z"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"invalidLatitudeRange": {
|
|
126
|
+
"summary": "`lat` outside the -90 to 90 range",
|
|
127
|
+
"value": {
|
|
128
|
+
"error": "Invalid Latitude Provided",
|
|
129
|
+
"message": "Latitude must be between -90 and 90.",
|
|
130
|
+
"path": "/v1.0/geocoder/reverse",
|
|
131
|
+
"status": 400,
|
|
132
|
+
"timestamp": "2026-07-22T14:29:45.727Z"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"invalidLongitudeRange": {
|
|
136
|
+
"summary": "`lon` outside the -180 to 180 range",
|
|
137
|
+
"value": {
|
|
138
|
+
"error": "Invalid Longitude Provided",
|
|
139
|
+
"message": "Longitude must be between -180 and 180.",
|
|
140
|
+
"path": "/v1.0/geocoder/reverse",
|
|
141
|
+
"status": 400,
|
|
142
|
+
"timestamp": "2026-07-22T14:29:46.267Z"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"nonNumericValue": {
|
|
146
|
+
"summary": "`lat` or `lon` is not a valid number",
|
|
147
|
+
"value": {
|
|
148
|
+
"error": "Invalid Parameters Provided",
|
|
149
|
+
"message": "Please provide valid parameters.",
|
|
150
|
+
"path": "/v1.0/geocoder/reverse",
|
|
151
|
+
"status": 400,
|
|
152
|
+
"timestamp": "2026-07-22T14:29:46.809Z"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"components": {
|
|
164
|
+
"securitySchemes": {
|
|
165
|
+
"ApiKeyAuthHeader": {
|
|
166
|
+
"type": "apiKey",
|
|
167
|
+
"in": "header",
|
|
168
|
+
"name": "X-apiKey",
|
|
169
|
+
"description": "Pass your API key via the X-apiKey request header."
|
|
170
|
+
},
|
|
171
|
+
"ApiKeyAuthQuery": {
|
|
172
|
+
"type": "apiKey",
|
|
173
|
+
"in": "query",
|
|
174
|
+
"name": "apiKey",
|
|
175
|
+
"description": "Pass your API key via the apiKey query parameter."
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"schemas": {
|
|
179
|
+
"ErrorResponse": {
|
|
180
|
+
"type": "object",
|
|
181
|
+
"required": ["message"],
|
|
182
|
+
"properties": {
|
|
183
|
+
"error": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"description": "Short error category or exception type."
|
|
186
|
+
},
|
|
187
|
+
"message": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"description": "Human-readable error message describing the failure."
|
|
190
|
+
},
|
|
191
|
+
"path": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"description": "API endpoint path that produced the error."
|
|
194
|
+
},
|
|
195
|
+
"status": {
|
|
196
|
+
"type": "integer",
|
|
197
|
+
"description": "HTTP status code returned with the error."
|
|
198
|
+
},
|
|
199
|
+
"timestamp": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"format": "date-time",
|
|
202
|
+
"description": "Timestamp when the error occurred (ISO 8601)."
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"GeocodeResponse": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"description": "The nearest geocoded location to the given coordinates, with structured address components.",
|
|
209
|
+
"required": [
|
|
210
|
+
"lat",
|
|
211
|
+
"lon",
|
|
212
|
+
"country_code",
|
|
213
|
+
"country",
|
|
214
|
+
"full_address",
|
|
215
|
+
"bounding_box"
|
|
216
|
+
],
|
|
217
|
+
"properties": {
|
|
218
|
+
"lat": {
|
|
219
|
+
"type": "number",
|
|
220
|
+
"format": "float",
|
|
221
|
+
"description": "WGS84 latitude value for the location."
|
|
222
|
+
},
|
|
223
|
+
"lon": {
|
|
224
|
+
"type": "number",
|
|
225
|
+
"format": "float",
|
|
226
|
+
"description": "WGS84 longitude value for the location."
|
|
227
|
+
},
|
|
228
|
+
"name": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"description": "Name for the primary place searched."
|
|
231
|
+
},
|
|
232
|
+
"category": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"description": "High-level category of the place, e.g. amenity, place, natural, building, highway."
|
|
235
|
+
},
|
|
236
|
+
"type": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"description": "Specific kind within the category, e.g. fast_food, city, park, residential, house_number."
|
|
239
|
+
},
|
|
240
|
+
"poi": {
|
|
241
|
+
"type": "array",
|
|
242
|
+
"description": "Points of interest at this location.",
|
|
243
|
+
"items": {
|
|
244
|
+
"$ref": "#/components/schemas/PointOfInterest"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"street": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"description": "Street or road name."
|
|
250
|
+
},
|
|
251
|
+
"area": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"description": "Intra-city area below city level, e.g. suburb, borough, quarter, ward, district, sector, zone, tehsil, taluka, neighbourhood."
|
|
254
|
+
},
|
|
255
|
+
"postcode": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"description": "Postal code of the area."
|
|
258
|
+
},
|
|
259
|
+
"city": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"description": "Settlement label appropriate to the country, e.g. city, town, municipality."
|
|
262
|
+
},
|
|
263
|
+
"county": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"description": "Second-tier administrative area, e.g. county, district, shire, prefecture."
|
|
266
|
+
},
|
|
267
|
+
"state_code": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"description": "Subdivision code when available, typically ISO-3166-2 (e.g. US-TX, PK-PB)."
|
|
270
|
+
},
|
|
271
|
+
"state": {
|
|
272
|
+
"type": "string",
|
|
273
|
+
"description": "First-tier administrative area; varies by country, e.g. state, region, province, division, autonomous community."
|
|
274
|
+
},
|
|
275
|
+
"country_code": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"description": "Two-letter country code in upper case, ISO-3166-1 alpha-2."
|
|
278
|
+
},
|
|
279
|
+
"country": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"description": "Country name of the searched place."
|
|
282
|
+
},
|
|
283
|
+
"full_address": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"description": "Single-line, human-readable address of the location."
|
|
286
|
+
},
|
|
287
|
+
"bounding_box": {
|
|
288
|
+
"type": "array",
|
|
289
|
+
"description": "Extent of the feature as `[lat_min, lat_max, lon_min, lon_max]` (south, north, west, east) in WGS84 decimal degrees.",
|
|
290
|
+
"items": {
|
|
291
|
+
"type": "string"
|
|
292
|
+
},
|
|
293
|
+
"minItems": 4,
|
|
294
|
+
"maxItems": 4
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"PointOfInterest": {
|
|
299
|
+
"type": "object",
|
|
300
|
+
"description": "A point of interest located at or near a geocoded result.",
|
|
301
|
+
"properties": {
|
|
302
|
+
"name": {
|
|
303
|
+
"type": "string",
|
|
304
|
+
"description": "Name of the point of interest."
|
|
305
|
+
},
|
|
306
|
+
"category": {
|
|
307
|
+
"type": "string",
|
|
308
|
+
"description": "High-level category of the point of interest, e.g. amenity, place, natural, building, highway."
|
|
309
|
+
},
|
|
310
|
+
"type": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"description": "Specific kind within the category, e.g. fast_food, city, park, residential, house_number."
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"security": [
|
|
319
|
+
{
|
|
320
|
+
"ApiKeyAuthHeader": []
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"ApiKeyAuthQuery": []
|
|
324
|
+
}
|
|
325
|
+
]
|
|
326
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.1",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Admin Unit Details API Reference",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Get detailed information about a specific administrative unit identified by its country code and admin unit code. Returns the unit name, admin code, ISO 3166-2 code, admin level type, country ISO code, and country name. Both the `country` and `admin_unit` parameters are required; invalid or unmatched combinations return a 400 or 404 error respectively.",
|
|
7
|
+
"contact": {
|
|
8
|
+
"name": "APIFreaks Support",
|
|
9
|
+
"url": "https://apifreaks.com/contact",
|
|
10
|
+
"email": "support@apifreaks.com"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"servers": [
|
|
14
|
+
{
|
|
15
|
+
"url": "https://api.apifreaks.com/v1.0",
|
|
16
|
+
"description": "Admin Unit Details API Server"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"paths": {
|
|
20
|
+
"/geo/admin-unit/details": {
|
|
21
|
+
"get": {
|
|
22
|
+
"tags": ["GeoDB APIs"],
|
|
23
|
+
"summary": "Retrieve detailed information about a specific administrative unit",
|
|
24
|
+
"description": "Returns comprehensive details for a single administrative unit identified by country code and admin code.",
|
|
25
|
+
"operationId": "getAdminUnitDetails",
|
|
26
|
+
"parameters": [
|
|
27
|
+
{
|
|
28
|
+
"name": "format",
|
|
29
|
+
"in": "query",
|
|
30
|
+
"required": false,
|
|
31
|
+
"description": "Format of the response. Possible values: json, xml.",
|
|
32
|
+
"schema": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": ["json", "xml"],
|
|
35
|
+
"default": "json"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "country",
|
|
40
|
+
"in": "query",
|
|
41
|
+
"required": true,
|
|
42
|
+
"description": "Country code in ISO 3166-1 alpha-2 format (e.g., US, PK).",
|
|
43
|
+
"schema": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "admin_unit",
|
|
49
|
+
"in": "query",
|
|
50
|
+
"required": true,
|
|
51
|
+
"description": "Admin code of the administrative unit being requested.",
|
|
52
|
+
"schema": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"responses": {
|
|
58
|
+
"200": {
|
|
59
|
+
"description": "Successful response with admin unit details",
|
|
60
|
+
"content": {
|
|
61
|
+
"application/json": {
|
|
62
|
+
"schema": {
|
|
63
|
+
"$ref": "#/components/schemas/AdminUnitDetailsResponse"
|
|
64
|
+
},
|
|
65
|
+
"examples": {
|
|
66
|
+
"typicalSuccess": {
|
|
67
|
+
"summary": "Unit with a real ISO 3166-2 subdivision code",
|
|
68
|
+
"value": {
|
|
69
|
+
"name": "California",
|
|
70
|
+
"admin_code": "CA",
|
|
71
|
+
"admin_iso3166_2": "US-CA",
|
|
72
|
+
"admin_level": "state",
|
|
73
|
+
"country_iso3166_2": "US",
|
|
74
|
+
"country_name": "United States"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"noIso3166_2": {
|
|
78
|
+
"summary": "Unit with no real ISO 3166-2 code (e.g. US military postal regions) — admin_iso3166_2 is absent",
|
|
79
|
+
"value": {
|
|
80
|
+
"name": "Armed Forces of the Americas",
|
|
81
|
+
"admin_code": "AA",
|
|
82
|
+
"admin_level": "military postal region",
|
|
83
|
+
"country_iso3166_2": "US",
|
|
84
|
+
"country_name": "United States"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"400": {
|
|
92
|
+
"description": "Bad Request — Missing country/admin_unit parameter, invalid country code, or invalid admin code",
|
|
93
|
+
"content": {
|
|
94
|
+
"application/json": {
|
|
95
|
+
"schema": {
|
|
96
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
97
|
+
},
|
|
98
|
+
"examples": {
|
|
99
|
+
"MissingParams": {
|
|
100
|
+
"summary": "Missing required country or admin_unit parameter",
|
|
101
|
+
"value": {
|
|
102
|
+
"error": "Invalid Param Exception",
|
|
103
|
+
"message": "please pass correct parameters",
|
|
104
|
+
"path": "/v1.0/geo/admin-unit/details",
|
|
105
|
+
"status": 400,
|
|
106
|
+
"timestamp": "2026-07-24T10:46:22.210Z"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"InvalidCountryCode": {
|
|
110
|
+
"summary": "Malformed or unrecognized country code",
|
|
111
|
+
"value": {
|
|
112
|
+
"timestamp": "2026-07-24T10:46:23.231Z",
|
|
113
|
+
"path": "/v1/admin-unit/details",
|
|
114
|
+
"status": 400,
|
|
115
|
+
"error": "Invalid Country Code provided",
|
|
116
|
+
"message": "Only ISO 3166-1 alpha-2 codes country codes are supported."
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"InvalidAdminCode": {
|
|
120
|
+
"summary": "admin_unit code does not exist for the given country",
|
|
121
|
+
"value": {
|
|
122
|
+
"timestamp": "2026-07-24T10:46:23.768Z",
|
|
123
|
+
"path": "/v1/admin-unit/details",
|
|
124
|
+
"status": 400,
|
|
125
|
+
"error": "Invalid Admin Code provided",
|
|
126
|
+
"message": "Please provide a valid admin code."
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"404": {
|
|
134
|
+
"description": "Not Found — Country is a recognized ISO 3166-1 alpha-2 code but has no published admin units (e.g. Vatican City)",
|
|
135
|
+
"content": {
|
|
136
|
+
"application/json": {
|
|
137
|
+
"schema": {
|
|
138
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
139
|
+
},
|
|
140
|
+
"examples": {
|
|
141
|
+
"NoAdminUnits": {
|
|
142
|
+
"summary": "No admin units for this country",
|
|
143
|
+
"value": {
|
|
144
|
+
"timestamp": "2026-07-24T10:46:24.259Z",
|
|
145
|
+
"path": "/v1/admin-unit/details",
|
|
146
|
+
"status": 404,
|
|
147
|
+
"error": "No Admin Unit present in country",
|
|
148
|
+
"message": "This Country does not have any admin units associated with it."
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"components": {
|
|
160
|
+
"securitySchemes": {
|
|
161
|
+
"ApiKeyAuthHeader": {
|
|
162
|
+
"type": "apiKey",
|
|
163
|
+
"in": "header",
|
|
164
|
+
"name": "X-apiKey",
|
|
165
|
+
"description": "Pass your API key via the X-apiKey request header."
|
|
166
|
+
},
|
|
167
|
+
"ApiKeyAuthQuery": {
|
|
168
|
+
"type": "apiKey",
|
|
169
|
+
"in": "query",
|
|
170
|
+
"name": "apiKey",
|
|
171
|
+
"description": "Pass your API key via the apiKey query parameter."
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"schemas": {
|
|
175
|
+
"AdminUnitDetailsResponse": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"description": "Detailed information for a single administrative unit resolved from a country code and admin unit code.",
|
|
178
|
+
"required": [
|
|
179
|
+
"name",
|
|
180
|
+
"admin_code",
|
|
181
|
+
"admin_level",
|
|
182
|
+
"country_iso3166_2",
|
|
183
|
+
"country_name"
|
|
184
|
+
],
|
|
185
|
+
"properties": {
|
|
186
|
+
"name": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"description": "Name of the administrative unit."
|
|
189
|
+
},
|
|
190
|
+
"admin_code": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"description": "Administrative code of the unit."
|
|
193
|
+
},
|
|
194
|
+
"admin_iso3166_2": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"description": "The unit's full ISO 3166-2 code, formed as {country}-{admin_code} (e.g., US-CA, PK-BA, TV-FUN)."
|
|
197
|
+
},
|
|
198
|
+
"admin_level": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"description": "Level or type of the administrative unit (e.g., province, region, state)."
|
|
201
|
+
},
|
|
202
|
+
"country_iso3166_2": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"description": "Country code in ISO 3166-1 alpha-2 format."
|
|
205
|
+
},
|
|
206
|
+
"country_name": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"description": "Name of the country."
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"ErrorResponse": {
|
|
213
|
+
"type": "object",
|
|
214
|
+
"description": "Standard error envelope returned by the API on failed requests.",
|
|
215
|
+
"required": ["message"],
|
|
216
|
+
"properties": {
|
|
217
|
+
"error": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"description": "Short error category or exception type."
|
|
220
|
+
},
|
|
221
|
+
"message": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"description": "Human-readable error message describing the failure."
|
|
224
|
+
},
|
|
225
|
+
"path": {
|
|
226
|
+
"type": "string",
|
|
227
|
+
"description": "API endpoint path that produced the error."
|
|
228
|
+
},
|
|
229
|
+
"status": {
|
|
230
|
+
"type": "integer",
|
|
231
|
+
"description": "HTTP status code returned with the error."
|
|
232
|
+
},
|
|
233
|
+
"timestamp": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"format": "date-time",
|
|
236
|
+
"description": "Timestamp when the error occurred (ISO 8601)."
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"security": [
|
|
243
|
+
{
|
|
244
|
+
"ApiKeyAuthHeader": []
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"ApiKeyAuthQuery": []
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
}
|