@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,198 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.1",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Admin Levels API Reference",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"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.",
|
|
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 Levels API Server"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"paths": {
|
|
20
|
+
"/geo/admin-levels": {
|
|
21
|
+
"get": {
|
|
22
|
+
"tags": ["GeoDB APIs"],
|
|
23
|
+
"summary": "Retrieve administrative level types for a country",
|
|
24
|
+
"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.",
|
|
25
|
+
"operationId": "getAdminLevels",
|
|
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
|
+
"responses": {
|
|
49
|
+
"200": {
|
|
50
|
+
"description": "Successful response with list of administrative levels",
|
|
51
|
+
"content": {
|
|
52
|
+
"application/json": {
|
|
53
|
+
"schema": {
|
|
54
|
+
"$ref": "#/components/schemas/AdminLevelsResponse"
|
|
55
|
+
},
|
|
56
|
+
"examples": {
|
|
57
|
+
"typicalSuccess": {
|
|
58
|
+
"summary": "Typical successful response",
|
|
59
|
+
"value": {
|
|
60
|
+
"admin_levels": [
|
|
61
|
+
"outlying area",
|
|
62
|
+
"district",
|
|
63
|
+
"state",
|
|
64
|
+
"military postal region"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"400": {
|
|
73
|
+
"description": "Bad Request — Missing country parameter, or country is not a valid/known ISO 3166-1 alpha-2 code",
|
|
74
|
+
"content": {
|
|
75
|
+
"application/json": {
|
|
76
|
+
"schema": {
|
|
77
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
78
|
+
},
|
|
79
|
+
"examples": {
|
|
80
|
+
"MissingCountry": {
|
|
81
|
+
"summary": "Missing required country parameter",
|
|
82
|
+
"value": {
|
|
83
|
+
"error": "Invalid Param Exception",
|
|
84
|
+
"message": "please pass correct parameters",
|
|
85
|
+
"path": "/v1.0/geo/admin-levels",
|
|
86
|
+
"status": 400,
|
|
87
|
+
"timestamp": "2026-07-24T10:42:02.477Z"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"InvalidCountryCode": {
|
|
91
|
+
"summary": "Malformed or unrecognized country code (also returned for well-formed but non-existent codes)",
|
|
92
|
+
"value": {
|
|
93
|
+
"timestamp": "2026-07-24T10:42:02.997Z",
|
|
94
|
+
"path": "/v1/admin-levels",
|
|
95
|
+
"status": 400,
|
|
96
|
+
"error": "Invalid Country Code provided",
|
|
97
|
+
"message": "Only ISO 3166-1 alpha-2 codes country codes are supported."
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"404": {
|
|
105
|
+
"description": "Not Found — Country is a recognized ISO 3166-1 alpha-2 code but has no published admin levels (e.g. Vatican City)",
|
|
106
|
+
"content": {
|
|
107
|
+
"application/json": {
|
|
108
|
+
"schema": {
|
|
109
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
110
|
+
},
|
|
111
|
+
"examples": {
|
|
112
|
+
"NoAdminUnits": {
|
|
113
|
+
"summary": "No admin units for this country",
|
|
114
|
+
"value": {
|
|
115
|
+
"timestamp": "2026-07-24T10:42:15.470Z",
|
|
116
|
+
"path": "/v1/admin-levels",
|
|
117
|
+
"status": 404,
|
|
118
|
+
"error": "No Admin Unit present in country",
|
|
119
|
+
"message": "This Country does not have any admin units associated with it."
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"components": {
|
|
131
|
+
"securitySchemes": {
|
|
132
|
+
"ApiKeyAuthHeader": {
|
|
133
|
+
"type": "apiKey",
|
|
134
|
+
"in": "header",
|
|
135
|
+
"name": "X-apiKey",
|
|
136
|
+
"description": "Pass your API key via the X-apiKey request header."
|
|
137
|
+
},
|
|
138
|
+
"ApiKeyAuthQuery": {
|
|
139
|
+
"type": "apiKey",
|
|
140
|
+
"in": "query",
|
|
141
|
+
"name": "apiKey",
|
|
142
|
+
"description": "Pass your API key via the apiKey query parameter."
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"schemas": {
|
|
146
|
+
"AdminLevelsResponse": {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"description": "Response containing the distinct administrative level types defined for the requested country.",
|
|
149
|
+
"required": ["admin_levels"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"admin_levels": {
|
|
152
|
+
"type": "array",
|
|
153
|
+
"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.",
|
|
154
|
+
"items": {
|
|
155
|
+
"type": "string"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"ErrorResponse": {
|
|
161
|
+
"type": "object",
|
|
162
|
+
"description": "Standard error envelope returned by the API on failed requests.",
|
|
163
|
+
"required": ["message"],
|
|
164
|
+
"properties": {
|
|
165
|
+
"error": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"description": "Short error category or exception type."
|
|
168
|
+
},
|
|
169
|
+
"message": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "Human-readable error message describing the failure."
|
|
172
|
+
},
|
|
173
|
+
"path": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"description": "API endpoint path that produced the error."
|
|
176
|
+
},
|
|
177
|
+
"status": {
|
|
178
|
+
"type": "integer",
|
|
179
|
+
"description": "HTTP status code returned with the error."
|
|
180
|
+
},
|
|
181
|
+
"timestamp": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"format": "date-time",
|
|
184
|
+
"description": "Timestamp when the error occurred (ISO 8601)."
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"security": [
|
|
191
|
+
{
|
|
192
|
+
"ApiKeyAuthHeader": []
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"ApiKeyAuthQuery": []
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.1",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Administrative Units API - Get Country Subdivisions & Admin Units",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Retrieve administrative units (states, provinces, governorates, districts) for any country using ISO 3166-1 alpha-2 country codes. Each result includes the unit name, admin code, and admin level type. Optionally filter results by one or more administrative levels using the `admin_level` parameter with comma-separated level names; a level name that matches nothing returns a 200 with an empty admin_units array, not an error. A valid country code is required; countries without published admin units return a 404.",
|
|
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": "Administrative Units API Server"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"paths": {
|
|
20
|
+
"/geo/admin-units": {
|
|
21
|
+
"get": {
|
|
22
|
+
"tags": ["GeoDB APIs"],
|
|
23
|
+
"summary": "Retrieve administrative units for a country with optional level filtering",
|
|
24
|
+
"description": "Returns all administrative units (states, provinces, districts) for a country using ISO 3166-1 alpha-2 country code. Optionally filter by one or more admin levels.",
|
|
25
|
+
"operationId": "getAdminUnits",
|
|
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_level",
|
|
49
|
+
"in": "query",
|
|
50
|
+
"required": false,
|
|
51
|
+
"description": "Comma-separated list to filter results by one or more administrative levels (e.g., state, district). A level name that doesn't exist for the country returns a 200 with an empty admin_units array rather than an error.",
|
|
52
|
+
"schema": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"responses": {
|
|
58
|
+
"200": {
|
|
59
|
+
"description": "Successful response with list of administrative units",
|
|
60
|
+
"content": {
|
|
61
|
+
"application/json": {
|
|
62
|
+
"schema": {
|
|
63
|
+
"$ref": "#/components/schemas/AdminUnitsResponse"
|
|
64
|
+
},
|
|
65
|
+
"examples": {
|
|
66
|
+
"typicalSuccess": {
|
|
67
|
+
"summary": "Typical successful response",
|
|
68
|
+
"value": {
|
|
69
|
+
"admin_units": [
|
|
70
|
+
{
|
|
71
|
+
"name": "California",
|
|
72
|
+
"admin_code": "CA",
|
|
73
|
+
"admin_level": "state"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "Texas",
|
|
77
|
+
"admin_code": "TX",
|
|
78
|
+
"admin_level": "state"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "New York",
|
|
82
|
+
"admin_code": "NY",
|
|
83
|
+
"admin_level": "state"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"400": {
|
|
93
|
+
"description": "Bad Request — Missing country parameter, or country is not a valid/known ISO 3166-1 alpha-2 code",
|
|
94
|
+
"content": {
|
|
95
|
+
"application/json": {
|
|
96
|
+
"schema": {
|
|
97
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
98
|
+
},
|
|
99
|
+
"examples": {
|
|
100
|
+
"MissingCountry": {
|
|
101
|
+
"summary": "Missing required country parameter",
|
|
102
|
+
"value": {
|
|
103
|
+
"error": "Invalid Param Exception",
|
|
104
|
+
"message": "please pass correct parameters",
|
|
105
|
+
"path": "/v1.0/geo/admin-units",
|
|
106
|
+
"status": 400,
|
|
107
|
+
"timestamp": "2026-07-24T10:44:10.185Z"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"InvalidCountryCode": {
|
|
111
|
+
"summary": "Malformed or unrecognized country code (also returned for well-formed but non-existent codes)",
|
|
112
|
+
"value": {
|
|
113
|
+
"timestamp": "2026-07-24T10:44:10.711Z",
|
|
114
|
+
"path": "/v1/admin-units",
|
|
115
|
+
"status": 400,
|
|
116
|
+
"error": "Invalid Country Code provided",
|
|
117
|
+
"message": "Only ISO 3166-1 alpha-2 codes country codes are supported."
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"404": {
|
|
125
|
+
"description": "Not Found — Country is a recognized ISO 3166-1 alpha-2 code but has no published admin units (e.g. Vatican City)",
|
|
126
|
+
"content": {
|
|
127
|
+
"application/json": {
|
|
128
|
+
"schema": {
|
|
129
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
130
|
+
},
|
|
131
|
+
"examples": {
|
|
132
|
+
"NoAdminUnits": {
|
|
133
|
+
"summary": "No admin units for this country",
|
|
134
|
+
"value": {
|
|
135
|
+
"timestamp": "2026-07-24T10:44:11.244Z",
|
|
136
|
+
"path": "/v1/admin-units",
|
|
137
|
+
"status": 404,
|
|
138
|
+
"error": "No Admin Unit present in country",
|
|
139
|
+
"message": "This Country does not have any admin units associated with it."
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"components": {
|
|
151
|
+
"securitySchemes": {
|
|
152
|
+
"ApiKeyAuthHeader": {
|
|
153
|
+
"type": "apiKey",
|
|
154
|
+
"in": "header",
|
|
155
|
+
"name": "X-apiKey",
|
|
156
|
+
"description": "Pass your API key via the X-apiKey request header."
|
|
157
|
+
},
|
|
158
|
+
"ApiKeyAuthQuery": {
|
|
159
|
+
"type": "apiKey",
|
|
160
|
+
"in": "query",
|
|
161
|
+
"name": "apiKey",
|
|
162
|
+
"description": "Pass your API key via the apiKey query parameter."
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"schemas": {
|
|
166
|
+
"AdminUnitsResponse": {
|
|
167
|
+
"type": "object",
|
|
168
|
+
"description": "Response containing the administrative units for the requested country, optionally filtered by admin_level.",
|
|
169
|
+
"required": ["admin_units"],
|
|
170
|
+
"properties": {
|
|
171
|
+
"admin_units": {
|
|
172
|
+
"type": "array",
|
|
173
|
+
"description": "An array of administrative unit objects for the specified country.",
|
|
174
|
+
"items": {
|
|
175
|
+
"$ref": "#/components/schemas/AdminUnit"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"AdminUnit": {
|
|
181
|
+
"type": "object",
|
|
182
|
+
"description": "An administrative unit object.",
|
|
183
|
+
"required": ["name", "admin_code", "admin_level"],
|
|
184
|
+
"properties": {
|
|
185
|
+
"name": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"description": "Name of the administrative unit."
|
|
188
|
+
},
|
|
189
|
+
"admin_code": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"description": "Administrative code of the unit."
|
|
192
|
+
},
|
|
193
|
+
"admin_level": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"description": "Level or type of the administrative unit (e.g., state, district, province)."
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"ErrorResponse": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"description": "Standard error envelope returned by the API on failed requests.",
|
|
202
|
+
"required": ["message"],
|
|
203
|
+
"properties": {
|
|
204
|
+
"error": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"description": "Short error category or exception type."
|
|
207
|
+
},
|
|
208
|
+
"message": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"description": "Human-readable error message describing the failure."
|
|
211
|
+
},
|
|
212
|
+
"path": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"description": "API endpoint path that produced the error."
|
|
215
|
+
},
|
|
216
|
+
"status": {
|
|
217
|
+
"type": "integer",
|
|
218
|
+
"description": "HTTP status code returned with the error."
|
|
219
|
+
},
|
|
220
|
+
"timestamp": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"format": "date-time",
|
|
223
|
+
"description": "Timestamp when the error occurred (ISO 8601)."
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"security": [
|
|
230
|
+
{
|
|
231
|
+
"ApiKeyAuthHeader": []
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"ApiKeyAuthQuery": []
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
}
|