@apifreaks/openapi-specs 0.1.0 → 0.1.2

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.
Files changed (108) hide show
  1. package/dist/index.cjs +133 -2
  2. package/dist/index.d.cts +140 -3
  3. package/dist/index.d.ts +140 -3
  4. package/dist/index.js +131 -2
  5. package/dist/specs/commodity/commodity-fluctuation.yaml +225 -0
  6. package/dist/specs/commodity/commodity-prices.yaml +236 -0
  7. package/dist/specs/commodity/commodity-symbols.yaml +159 -0
  8. package/dist/specs/commodity/commodity-time-series.yaml +238 -0
  9. package/dist/specs/commodity/historical-commodity-prices.yaml +208 -0
  10. package/dist/specs/currency/currency-converter.yaml +193 -0
  11. package/dist/specs/currency/currency-fluctuation.yaml +211 -0
  12. package/dist/specs/currency/currency-historical-data-limit.yaml +112 -0
  13. package/dist/specs/currency/currency-rate.yaml +173 -0
  14. package/dist/specs/currency/currency-supported.yaml +176 -0
  15. package/dist/specs/currency/currency-symbols.yaml +115 -0
  16. package/dist/specs/currency/currency-time-series.yaml +232 -0
  17. package/dist/specs/currency/geolocalized-currency-conversion.yaml +214 -0
  18. package/dist/specs/currency/historical-currency-converter.yaml +195 -0
  19. package/dist/specs/currency/historical-currency-rate.yaml +180 -0
  20. package/dist/specs/dns/bulk-dns-lookup.yaml +484 -0
  21. package/dist/specs/dns/dns-history-lookup.yaml +451 -0
  22. package/dist/specs/dns/dns-lookup.yaml +360 -0
  23. package/dist/specs/dns/reverse-dns-lookup.yaml +338 -0
  24. package/dist/specs/domain/bulk-domain-checker.yaml +198 -0
  25. package/dist/specs/domain/domain-search-with-suggestions.yaml +196 -0
  26. package/dist/specs/domain/domain-search.yaml +149 -0
  27. package/dist/specs/domain/subdomain-lookup.yaml +251 -0
  28. package/dist/specs/email-validation/bulk-email-validation.yaml +403 -0
  29. package/dist/specs/email-validation/email-checker.yaml +451 -0
  30. package/dist/specs/financial/bulk-vat-rates-country.yaml +250 -0
  31. package/dist/specs/financial/financial-apis-supported-countries.yaml +152 -0
  32. package/dist/specs/financial/iban-validation.yaml +270 -0
  33. package/dist/specs/financial/swift-code-finder.yaml +146 -0
  34. package/dist/specs/financial/swift-code-lookup.yaml +156 -0
  35. package/dist/specs/financial/vat-number-validation.yaml +205 -0
  36. package/dist/specs/financial/vat-rates-by-ip.yaml +200 -0
  37. package/dist/specs/financial/vat-rates-country.yaml +212 -0
  38. package/dist/specs/general/usage-credits.yaml +188 -0
  39. package/dist/specs/geocoding/forward-geocoding.yaml +292 -0
  40. package/dist/specs/geocoding/reverse-geocoding.yaml +237 -0
  41. package/dist/specs/geodb/administrative-units-details.yaml +180 -0
  42. package/dist/specs/geodb/administrative-units-levels.yaml +140 -0
  43. package/dist/specs/geodb/administrative-units.yaml +168 -0
  44. package/dist/specs/geodb/cities.yaml +209 -0
  45. package/dist/specs/geodb/countries-details.yaml +207 -0
  46. package/dist/specs/geodb/countries.yaml +199 -0
  47. package/dist/specs/geodb/flags-supported.yaml +119 -0
  48. package/dist/specs/geodb/flags.yaml +170 -0
  49. package/dist/specs/geodb/regions.yaml +76 -0
  50. package/dist/specs/geodb/subregions.yaml +158 -0
  51. package/dist/specs/ip-intelligence/bulk-ip-lookup.yaml +895 -0
  52. package/dist/specs/ip-intelligence/bulk-ip-threat-intelligence.yaml +310 -0
  53. package/dist/specs/ip-intelligence/ip-locator.yaml +708 -0
  54. package/dist/specs/ip-intelligence/ip-threat-intelligence.yaml +230 -0
  55. package/dist/specs/other/astronomy-data.yaml +632 -0
  56. package/dist/specs/pdf/delete-pdf-page.yaml +193 -0
  57. package/dist/specs/pdf/linearize-pdf.yaml +187 -0
  58. package/dist/specs/pdf/merge-pdf.yaml +193 -0
  59. package/dist/specs/pdf/pdf-compress.yaml +208 -0
  60. package/dist/specs/pdf/pdf-decrypt.yaml +202 -0
  61. package/dist/specs/pdf/pdf-encrypt.yaml +213 -0
  62. package/dist/specs/pdf/pdf-extract-pages.yaml +199 -0
  63. package/dist/specs/pdf/pdf-file-status.yaml +148 -0
  64. package/dist/specs/pdf/pdf-file.yaml +136 -0
  65. package/dist/specs/pdf/pdf-files.yaml +85 -0
  66. package/dist/specs/pdf/pdf-resource-download.yaml +117 -0
  67. package/dist/specs/pdf/pdf-resource-upload-binary.yaml +152 -0
  68. package/dist/specs/pdf/pdf-resource-upload.yaml +163 -0
  69. package/dist/specs/pdf/pdf-restrict.yaml +246 -0
  70. package/dist/specs/pdf/pdf-split-pages.yaml +208 -0
  71. package/dist/specs/pdf/pdf-task-status.yaml +187 -0
  72. package/dist/specs/pdf/pdf-to-image.yaml +844 -0
  73. package/dist/specs/pdf/pdf-unrestrict.yaml +221 -0
  74. package/dist/specs/pdf/rotate-pdf-pages.yaml +207 -0
  75. package/dist/specs/phone-validation/bulk-phone-number-validation.yaml +374 -0
  76. package/dist/specs/phone-validation/phone-number-validation.yaml +344 -0
  77. package/dist/specs/scraper/web-scraper.yaml +479 -0
  78. package/dist/specs/screenshot/bulk-screenshot.yaml +728 -0
  79. package/dist/specs/screenshot/website-screenshot.yaml +822 -0
  80. package/dist/specs/ssl/ssl-certificate-chain-lookup.yaml +593 -0
  81. package/dist/specs/ssl/ssl-certificate-lookup.yaml +478 -0
  82. package/dist/specs/timezone/timezone-converter.yaml +249 -0
  83. package/dist/specs/timezone/timezone-lookup.yaml +712 -0
  84. package/dist/specs/user-agent/bulk-user-agent-parser.yaml +340 -0
  85. package/dist/specs/user-agent/user-agent-parser.yaml +271 -0
  86. package/dist/specs/weather/air-quality.yaml +590 -0
  87. package/dist/specs/weather/bulk-live-weather.yaml +654 -0
  88. package/dist/specs/weather/flood-forecast.yaml +519 -0
  89. package/dist/specs/weather/historical-weather.yaml +842 -0
  90. package/dist/specs/weather/live-weather.yaml +633 -0
  91. package/dist/specs/weather/marine-weather.yaml +806 -0
  92. package/dist/specs/weather/time-series-weather.yaml +821 -0
  93. package/dist/specs/weather/weather-forecast.yaml +935 -0
  94. package/dist/specs/whois/asn-lookup.yaml +618 -0
  95. package/dist/specs/whois/bulk-whois-lookup.yaml +827 -0
  96. package/dist/specs/whois/domain-whois-history-lookup.yaml +445 -0
  97. package/dist/specs/whois/reverse-whois.yaml +566 -0
  98. package/dist/specs/whois/whois-domain-lookup.yaml +537 -0
  99. package/dist/specs/whois/whois-ip-lookup.yaml +1123 -0
  100. package/dist/specs/zip-code/bulk-zip-code-lookup.yaml +232 -0
  101. package/dist/specs/zip-code/zip-code-api.yaml +216 -0
  102. package/dist/specs/zip-code/zip-code-distance-match.yaml +239 -0
  103. package/dist/specs/zip-code/zip-code-distance.yaml +233 -0
  104. package/dist/specs/zip-code/zip-codes-by-city.yaml +201 -0
  105. package/dist/specs/zip-code/zip-codes-by-region.yaml +200 -0
  106. package/dist/specs/zip-code/zip-codes-radius-search.yaml +262 -0
  107. package/package.json +6 -2
  108. package/specs/pdf/merge-pdf.json +2 -2
@@ -0,0 +1,237 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: Reverse Geocoding API - Convert Coordinates to a Street Address
4
+ version: 1.0.0
5
+ 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.
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: Reverse Geocoding API Server
13
+ paths:
14
+ /geocoder/reverse:
15
+ get:
16
+ tags:
17
+ - Geocoder APIs
18
+ summary: Convert coordinates into a human-readable address
19
+ description: Look up the nearest address or place name for a given latitude and longitude pair.
20
+ operationId: reverseGeocode
21
+ parameters:
22
+ - name: lat
23
+ in: query
24
+ required: true
25
+ description: WGS84 latitude value, ranging from -90 to 90.
26
+ schema:
27
+ type: number
28
+ format: float
29
+ - name: lon
30
+ in: query
31
+ required: true
32
+ description: WGS84 longitude value, ranging from -180 to 180.
33
+ schema:
34
+ type: number
35
+ format: float
36
+ - name: Accept-Language
37
+ in: header
38
+ required: false
39
+ 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.
40
+ schema:
41
+ type: string
42
+ responses:
43
+ '200':
44
+ description: Successful geocoding response
45
+ content:
46
+ application/json:
47
+ schema:
48
+ $ref: '#/components/schemas/GeocodeResponse'
49
+ examples:
50
+ typicalSuccess:
51
+ summary: Typical successful response
52
+ value:
53
+ lat: 40.7489669
54
+ lon: -73.985399
55
+ name: LensCrafters
56
+ category: shop
57
+ type: optician
58
+ poi:
59
+ - name: LensCrafters
60
+ category: shop
61
+ type: optician
62
+ - name: '7'
63
+ category: place
64
+ type: house_number
65
+ street: West 34th Street
66
+ area: Manhattan, New York County
67
+ postcode: '10001'
68
+ city: New York
69
+ state_code: US-NY
70
+ state: New York
71
+ country_code: US
72
+ country: United States
73
+ full_address: LensCrafters, 7, West 34th Street, Midtown South, Manhattan Community Board 5, Manhattan, New York County, New York, 10001, United States
74
+ bounding_box:
75
+ - '40.7489169'
76
+ - '40.7490169'
77
+ - '-73.9854490'
78
+ - '-73.9853490'
79
+ '400':
80
+ description: Bad Request — Invalid or missing parameters
81
+ content:
82
+ application/json:
83
+ schema:
84
+ $ref: '#/components/schemas/ErrorResponse'
85
+ examples:
86
+ missingParams:
87
+ summary: Missing required `lat` or `lon` parameter
88
+ value:
89
+ error: Invalid Param Exception
90
+ message: please pass correct parameters
91
+ path: /v1.0/geocoder/reverse
92
+ status: 400
93
+ timestamp: '2026-07-22T14:29:45.148Z'
94
+ invalidLatitudeRange:
95
+ summary: '`lat` outside the -90 to 90 range'
96
+ value:
97
+ error: Invalid Latitude Provided
98
+ message: Latitude must be between -90 and 90.
99
+ path: /v1.0/geocoder/reverse
100
+ status: 400
101
+ timestamp: '2026-07-22T14:29:45.727Z'
102
+ invalidLongitudeRange:
103
+ summary: '`lon` outside the -180 to 180 range'
104
+ value:
105
+ error: Invalid Longitude Provided
106
+ message: Longitude must be between -180 and 180.
107
+ path: /v1.0/geocoder/reverse
108
+ status: 400
109
+ timestamp: '2026-07-22T14:29:46.267Z'
110
+ nonNumericValue:
111
+ summary: '`lat` or `lon` is not a valid number'
112
+ value:
113
+ error: Invalid Parameters Provided
114
+ message: Please provide valid parameters.
115
+ path: /v1.0/geocoder/reverse
116
+ status: 400
117
+ timestamp: '2026-07-22T14:29:46.809Z'
118
+ components:
119
+ securitySchemes:
120
+ ApiKeyAuthHeader:
121
+ type: apiKey
122
+ in: header
123
+ name: X-apiKey
124
+ description: Pass your API key via the X-apiKey request header.
125
+ ApiKeyAuthQuery:
126
+ type: apiKey
127
+ in: query
128
+ name: apiKey
129
+ description: Pass your API key via the apiKey query parameter.
130
+ schemas:
131
+ ErrorResponse:
132
+ type: object
133
+ required:
134
+ - message
135
+ properties:
136
+ error:
137
+ type: string
138
+ description: Short error category or exception type.
139
+ message:
140
+ type: string
141
+ description: Human-readable error message describing the failure.
142
+ path:
143
+ type: string
144
+ description: API endpoint path that produced the error.
145
+ status:
146
+ type: integer
147
+ description: HTTP status code returned with the error.
148
+ timestamp:
149
+ type: string
150
+ format: date-time
151
+ description: Timestamp when the error occurred (ISO 8601).
152
+ GeocodeResponse:
153
+ type: object
154
+ description: The nearest geocoded location to the given coordinates, with structured address components.
155
+ required:
156
+ - lat
157
+ - lon
158
+ - country_code
159
+ - country
160
+ - full_address
161
+ - bounding_box
162
+ properties:
163
+ lat:
164
+ type: number
165
+ format: float
166
+ description: WGS84 latitude value for the location.
167
+ lon:
168
+ type: number
169
+ format: float
170
+ description: WGS84 longitude value for the location.
171
+ name:
172
+ type: string
173
+ description: Name for the primary place searched.
174
+ category:
175
+ type: string
176
+ description: High-level category of the place, e.g. amenity, place, natural, building, highway.
177
+ type:
178
+ type: string
179
+ description: Specific kind within the category, e.g. fast_food, city, park, residential, house_number.
180
+ poi:
181
+ type: array
182
+ description: Points of interest at this location.
183
+ items:
184
+ $ref: '#/components/schemas/PointOfInterest'
185
+ street:
186
+ type: string
187
+ description: Street or road name.
188
+ area:
189
+ type: string
190
+ description: Intra-city area below city level, e.g. suburb, borough, quarter, ward, district, sector, zone, tehsil, taluka, neighbourhood.
191
+ postcode:
192
+ type: string
193
+ description: Postal code of the area.
194
+ city:
195
+ type: string
196
+ description: Settlement label appropriate to the country, e.g. city, town, municipality.
197
+ county:
198
+ type: string
199
+ description: Second-tier administrative area, e.g. county, district, shire, prefecture.
200
+ state_code:
201
+ type: string
202
+ description: Subdivision code when available, typically ISO-3166-2 (e.g. US-TX, PK-PB).
203
+ state:
204
+ type: string
205
+ description: First-tier administrative area; varies by country, e.g. state, region, province, division, autonomous community.
206
+ country_code:
207
+ type: string
208
+ description: Two-letter country code in upper case, ISO-3166-1 alpha-2.
209
+ country:
210
+ type: string
211
+ description: Country name of the searched place.
212
+ full_address:
213
+ type: string
214
+ description: Single-line, human-readable address of the location.
215
+ bounding_box:
216
+ type: array
217
+ description: Extent of the feature as `[lat_min, lat_max, lon_min, lon_max]` (south, north, west, east) in WGS84 decimal degrees.
218
+ items:
219
+ type: string
220
+ minItems: 4
221
+ maxItems: 4
222
+ PointOfInterest:
223
+ type: object
224
+ description: A point of interest located at or near a geocoded result.
225
+ properties:
226
+ name:
227
+ type: string
228
+ description: Name of the point of interest.
229
+ category:
230
+ type: string
231
+ description: High-level category of the point of interest, e.g. amenity, place, natural, building, highway.
232
+ type:
233
+ type: string
234
+ description: Specific kind within the category, e.g. fast_food, city, park, residential, house_number.
235
+ security:
236
+ - ApiKeyAuthHeader: []
237
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,180 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: Admin Unit Details API Reference
4
+ version: 1.0.0
5
+ 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.
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: Admin Unit Details API Server
13
+ paths:
14
+ /geo/admin-unit/details:
15
+ get:
16
+ tags:
17
+ - GeoDB APIs
18
+ summary: Retrieve detailed information about a specific administrative unit
19
+ description: Returns comprehensive details for a single administrative unit identified by country code and admin code.
20
+ operationId: getAdminUnitDetails
21
+ parameters:
22
+ - name: format
23
+ in: query
24
+ required: false
25
+ description: 'Format of the response. Possible values: json, xml.'
26
+ schema:
27
+ type: string
28
+ enum:
29
+ - json
30
+ - xml
31
+ default: json
32
+ - name: country
33
+ in: query
34
+ required: true
35
+ description: Country code in ISO 3166-1 alpha-2 format (e.g., US, PK).
36
+ schema:
37
+ type: string
38
+ - name: admin_unit
39
+ in: query
40
+ required: true
41
+ description: Admin code of the administrative unit being requested.
42
+ schema:
43
+ type: string
44
+ responses:
45
+ '200':
46
+ description: Successful response with admin unit details
47
+ content:
48
+ application/json:
49
+ schema:
50
+ $ref: '#/components/schemas/AdminUnitDetailsResponse'
51
+ examples:
52
+ typicalSuccess:
53
+ summary: Unit with a real ISO 3166-2 subdivision code
54
+ value:
55
+ name: California
56
+ admin_code: CA
57
+ admin_iso3166_2: US-CA
58
+ admin_level: state
59
+ country_iso3166_2: US
60
+ country_name: United States
61
+ noIso3166_2:
62
+ summary: Unit with no real ISO 3166-2 code (e.g. US military postal regions) — admin_iso3166_2 is absent
63
+ value:
64
+ name: Armed Forces of the Americas
65
+ admin_code: AA
66
+ admin_level: military postal region
67
+ country_iso3166_2: US
68
+ country_name: United States
69
+ '400':
70
+ description: Bad Request — Missing country/admin_unit parameter, invalid country code, or invalid admin code
71
+ content:
72
+ application/json:
73
+ schema:
74
+ $ref: '#/components/schemas/ErrorResponse'
75
+ examples:
76
+ MissingParams:
77
+ summary: Missing required country or admin_unit parameter
78
+ value:
79
+ error: Invalid Param Exception
80
+ message: please pass correct parameters
81
+ path: /v1.0/geo/admin-unit/details
82
+ status: 400
83
+ timestamp: '2026-07-24T10:46:22.210Z'
84
+ InvalidCountryCode:
85
+ summary: Malformed or unrecognized country code
86
+ value:
87
+ timestamp: '2026-07-24T10:46:23.231Z'
88
+ path: /v1/admin-unit/details
89
+ status: 400
90
+ error: Invalid Country Code provided
91
+ message: Only ISO 3166-1 alpha-2 codes country codes are supported.
92
+ InvalidAdminCode:
93
+ summary: admin_unit code does not exist for the given country
94
+ value:
95
+ timestamp: '2026-07-24T10:46:23.768Z'
96
+ path: /v1/admin-unit/details
97
+ status: 400
98
+ error: Invalid Admin Code provided
99
+ message: Please provide a valid admin code.
100
+ '404':
101
+ description: Not Found — Country is a recognized ISO 3166-1 alpha-2 code but has no published admin units (e.g. Vatican City)
102
+ content:
103
+ application/json:
104
+ schema:
105
+ $ref: '#/components/schemas/ErrorResponse'
106
+ examples:
107
+ NoAdminUnits:
108
+ summary: No admin units for this country
109
+ value:
110
+ timestamp: '2026-07-24T10:46:24.259Z'
111
+ path: /v1/admin-unit/details
112
+ status: 404
113
+ error: No Admin Unit present in country
114
+ message: This Country does not have any admin units associated with it.
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
+ AdminUnitDetailsResponse:
129
+ type: object
130
+ description: Detailed information for a single administrative unit resolved from a country code and admin unit code.
131
+ required:
132
+ - name
133
+ - admin_code
134
+ - admin_level
135
+ - country_iso3166_2
136
+ - country_name
137
+ properties:
138
+ name:
139
+ type: string
140
+ description: Name of the administrative unit.
141
+ admin_code:
142
+ type: string
143
+ description: Administrative code of the unit.
144
+ admin_iso3166_2:
145
+ type: string
146
+ description: The unit's full ISO 3166-2 code, formed as {country}-{admin_code} (e.g., US-CA, PK-BA, TV-FUN).
147
+ admin_level:
148
+ type: string
149
+ description: Level or type of the administrative unit (e.g., province, region, state).
150
+ country_iso3166_2:
151
+ type: string
152
+ description: Country code in ISO 3166-1 alpha-2 format.
153
+ country_name:
154
+ type: string
155
+ description: Name of the country.
156
+ ErrorResponse:
157
+ type: object
158
+ description: Standard error envelope returned by the API on failed requests.
159
+ required:
160
+ - message
161
+ properties:
162
+ error:
163
+ type: string
164
+ description: Short error category or exception type.
165
+ message:
166
+ type: string
167
+ description: Human-readable error message describing the failure.
168
+ path:
169
+ type: string
170
+ description: API endpoint path that produced the error.
171
+ status:
172
+ type: integer
173
+ description: HTTP status code returned with the error.
174
+ timestamp:
175
+ type: string
176
+ format: date-time
177
+ description: Timestamp when the error occurred (ISO 8601).
178
+ security:
179
+ - ApiKeyAuthHeader: []
180
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,140 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: Admin Levels API Reference
4
+ version: 1.0.0
5
+ description: Retrieve the administrative level hierarchy for any country using ISO 3166-1 alpha-2 country codes. Returns the distinct administrative level types defined for that country (e.g., state, district, province, outlying area) as a flat array of strings. Use the returned level names with the Administrative Units endpoint to filter results by one or more specific levels. A valid two-letter country code is required; invalid codes return a 400 error and countries without published admin levels return a 404.
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: Admin Levels API Server
13
+ paths:
14
+ /geo/admin-levels:
15
+ get:
16
+ tags:
17
+ - GeoDB APIs
18
+ summary: Retrieve administrative level types for a country
19
+ description: Returns the distinct administrative level types (e.g., province, district, state) defined for a given country using ISO 3166-1 alpha-2 country code.
20
+ operationId: getAdminLevels
21
+ parameters:
22
+ - name: format
23
+ in: query
24
+ required: false
25
+ description: 'Format of the response. Possible values: json, xml.'
26
+ schema:
27
+ type: string
28
+ enum:
29
+ - json
30
+ - xml
31
+ default: json
32
+ - name: country
33
+ in: query
34
+ required: true
35
+ description: Country code in ISO 3166-1 alpha-2 format (e.g., US, PK).
36
+ schema:
37
+ type: string
38
+ responses:
39
+ '200':
40
+ description: Successful response with list of administrative levels
41
+ content:
42
+ application/json:
43
+ schema:
44
+ $ref: '#/components/schemas/AdminLevelsResponse'
45
+ examples:
46
+ typicalSuccess:
47
+ summary: Typical successful response
48
+ value:
49
+ admin_levels:
50
+ - outlying area
51
+ - district
52
+ - state
53
+ - military postal region
54
+ '400':
55
+ description: Bad Request — Missing country parameter, or country is not a valid/known ISO 3166-1 alpha-2 code
56
+ content:
57
+ application/json:
58
+ schema:
59
+ $ref: '#/components/schemas/ErrorResponse'
60
+ examples:
61
+ MissingCountry:
62
+ summary: Missing required country parameter
63
+ value:
64
+ error: Invalid Param Exception
65
+ message: please pass correct parameters
66
+ path: /v1.0/geo/admin-levels
67
+ status: 400
68
+ timestamp: '2026-07-24T10:42:02.477Z'
69
+ InvalidCountryCode:
70
+ summary: Malformed or unrecognized country code (also returned for well-formed but non-existent codes)
71
+ value:
72
+ timestamp: '2026-07-24T10:42:02.997Z'
73
+ path: /v1/admin-levels
74
+ status: 400
75
+ error: Invalid Country Code provided
76
+ message: Only ISO 3166-1 alpha-2 codes country codes are supported.
77
+ '404':
78
+ description: Not Found — Country is a recognized ISO 3166-1 alpha-2 code but has no published admin levels (e.g. Vatican City)
79
+ content:
80
+ application/json:
81
+ schema:
82
+ $ref: '#/components/schemas/ErrorResponse'
83
+ examples:
84
+ NoAdminUnits:
85
+ summary: No admin units for this country
86
+ value:
87
+ timestamp: '2026-07-24T10:42:15.470Z'
88
+ path: /v1/admin-levels
89
+ status: 404
90
+ error: No Admin Unit present in country
91
+ message: This Country does not have any admin units associated with it.
92
+ components:
93
+ securitySchemes:
94
+ ApiKeyAuthHeader:
95
+ type: apiKey
96
+ in: header
97
+ name: X-apiKey
98
+ description: Pass your API key via the X-apiKey request header.
99
+ ApiKeyAuthQuery:
100
+ type: apiKey
101
+ in: query
102
+ name: apiKey
103
+ description: Pass your API key via the apiKey query parameter.
104
+ schemas:
105
+ AdminLevelsResponse:
106
+ type: object
107
+ description: Response containing the distinct administrative level types defined for the requested country.
108
+ required:
109
+ - admin_levels
110
+ properties:
111
+ admin_levels:
112
+ type: array
113
+ description: An array of unique administrative level types defined for the specified country. Each value represents a category of administrative division, such as state, district, or outlying area.
114
+ items:
115
+ type: string
116
+ ErrorResponse:
117
+ type: object
118
+ description: Standard error envelope returned by the API on failed requests.
119
+ required:
120
+ - message
121
+ properties:
122
+ error:
123
+ type: string
124
+ description: Short error category or exception type.
125
+ message:
126
+ type: string
127
+ description: Human-readable error message describing the failure.
128
+ path:
129
+ type: string
130
+ description: API endpoint path that produced the error.
131
+ status:
132
+ type: integer
133
+ description: HTTP status code returned with the error.
134
+ timestamp:
135
+ type: string
136
+ format: date-time
137
+ description: Timestamp when the error occurred (ISO 8601).
138
+ security:
139
+ - ApiKeyAuthHeader: []
140
+ - ApiKeyAuthQuery: []