@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,233 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: ZIP Code Distance API - Straight-Line Distance Between ZIP & Postal Codes Worldwide
4
+ version: 1.0.0
5
+ description: 'Calculate straight-line distances from a base point to up to 100 comparison postal codes in one request. The base point can be specified by a postal code or by exact latitude/longitude coordinates, but a `country` code is required either way. Supports six distance units: kilometers, miles, yards, meters, feet, and inches. Comparison codes with no match are silently omitted from the results array rather than returned as per-item errors — the array can be shorter than the requested compare list.'
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: ZIP Code Distance API Server
13
+ paths:
14
+ /zipcode/distance:
15
+ post:
16
+ tags:
17
+ - ZIP Code APIs
18
+ summary: Get distance between postal codes
19
+ operationId: getZipcodeDistance
20
+ description: Calculates the distance from a base ZIP/postal code or coordinate pair to up to 100 comparison postal codes.
21
+ parameters:
22
+ - name: format
23
+ in: query
24
+ required: false
25
+ schema:
26
+ type: string
27
+ enum:
28
+ - json
29
+ - xml
30
+ default: json
31
+ description: 'Format of the response. Possible values: json, xml.'
32
+ requestBody:
33
+ required: true
34
+ description: Base point (code or coordinates), country, and the list of postal codes to compare against it.
35
+ content:
36
+ application/json:
37
+ schema:
38
+ $ref: '#/components/schemas/DistanceRequest'
39
+ examples:
40
+ typicalRequest:
41
+ summary: Base point by code
42
+ value:
43
+ code: '90210'
44
+ country: US
45
+ compare:
46
+ - '10001'
47
+ - '94103'
48
+ responses:
49
+ '200':
50
+ description: Successful response with distances. Comparison codes with no match are omitted from results rather than represented as error entries.
51
+ content:
52
+ application/json:
53
+ schema:
54
+ $ref: '#/components/schemas/ZipcodeDistanceResponse'
55
+ examples:
56
+ success:
57
+ summary: Distances to two comparison codes
58
+ value:
59
+ result_count: 2
60
+ results:
61
+ - code: '10001'
62
+ distance: 3948.696
63
+ - code: '94103'
64
+ distance: 544.134
65
+ '400':
66
+ description: Bad Request — Missing/invalid body, country, or unit, or over the 100-code limit
67
+ content:
68
+ application/json:
69
+ schema:
70
+ $ref: '#/components/schemas/ErrorResponse'
71
+ examples:
72
+ InvalidBody:
73
+ summary: compare field missing or malformed
74
+ value:
75
+ timestamp: '2026-07-27T11:20:46.922Z'
76
+ path: /v1.0/zipcode/distance
77
+ status: 400
78
+ error: Request Body Invalid
79
+ message: Request body is missing required fields or is not in the expected format. Please refer to the API documentation.
80
+ MissingCountry:
81
+ summary: country is required even when the base point is given as coordinates
82
+ value:
83
+ timestamp: '2026-07-27T11:20:36.514Z'
84
+ path: /v1.0/zipcode/distance
85
+ status: 400
86
+ error: Country Code Missing
87
+ message: Provide a valid ISO 3166-1 alpha-2 country code.
88
+ BadCountry:
89
+ summary: country is not a valid ISO 3166-1 alpha-2 code
90
+ value:
91
+ timestamp: '2026-07-27T11:20:48.768Z'
92
+ path: /v1.0/zipcode/distance
93
+ status: 400
94
+ error: Invalid Country Code Provided
95
+ message: Only ISO 3166-1 alpha-2 codes country codes are supported.
96
+ InvalidUnit:
97
+ summary: unit is not one of the supported symbols
98
+ value:
99
+ timestamp: '2026-07-27T11:20:48.196Z'
100
+ path: /v1.0/zipcode/distance
101
+ status: 400
102
+ error: Invalid Unit Symbol
103
+ message: The provided unit symbol is invalid. Please refer to the documentation for supported units.
104
+ OverLimit:
105
+ summary: More than 100 compare codes submitted
106
+ value:
107
+ timestamp: '2026-07-27T11:20:47.652Z'
108
+ path: /v1.0/zipcode/distance
109
+ status: 400
110
+ error: Maximum Postal/Zip Code Limit Exceeded
111
+ message: A maximum of 100 postal/zip codes can be processed per request.
112
+ '404':
113
+ description: Not Found — None of the compare codes matched anything
114
+ content:
115
+ application/json:
116
+ schema:
117
+ $ref: '#/components/schemas/ErrorResponse'
118
+ examples:
119
+ NotFound:
120
+ summary: No compare codes matched
121
+ value:
122
+ timestamp: '2026-07-27T11:20:49.310Z'
123
+ path: /v1.0/zipcode/distance
124
+ status: 404
125
+ error: Postal/Zip Codes Not Found
126
+ message: None of the provided postal/zip codes were found in our database.
127
+ components:
128
+ securitySchemes:
129
+ ApiKeyAuthHeader:
130
+ type: apiKey
131
+ in: header
132
+ name: X-apiKey
133
+ description: Pass your API key via the X-apiKey request header.
134
+ ApiKeyAuthQuery:
135
+ type: apiKey
136
+ in: query
137
+ name: apiKey
138
+ description: Pass your API key via the apiKey query parameter.
139
+ schemas:
140
+ ZipcodeDistanceResponse:
141
+ type: object
142
+ description: Distance calculation results for each comparison code that matched.
143
+ required:
144
+ - result_count
145
+ - results
146
+ properties:
147
+ result_count:
148
+ type: integer
149
+ description: Number of distance results returned (may be less than the number of requested compare codes).
150
+ results:
151
+ type: array
152
+ description: Array of distance results, one per matched comparison code. Codes with no match are omitted.
153
+ items:
154
+ $ref: '#/components/schemas/ZipcodeDistanceItem'
155
+ ZipcodeDistanceItem:
156
+ type: object
157
+ description: Distance from the base point to one matched comparison code.
158
+ required:
159
+ - code
160
+ - distance
161
+ properties:
162
+ code:
163
+ type: string
164
+ description: The matched comparison ZIP/postal code.
165
+ distance:
166
+ type: number
167
+ format: float
168
+ description: Distance from the base point to this code, in the unit specified by the unit field (default km).
169
+ DistanceRequest:
170
+ type: object
171
+ description: Request body specifying the base point, country, and comparison codes for distance calculation.
172
+ required:
173
+ - country
174
+ - compare
175
+ properties:
176
+ compare:
177
+ type: array
178
+ description: List of ZIP or postal codes to calculate distance from the base point. Maximum 100 codes.
179
+ items:
180
+ $ref: '#/components/schemas/DistanceCompareCode'
181
+ code:
182
+ type: string
183
+ description: Base ZIP or postal code from which distances are calculated. Alternative to lat/long.
184
+ country:
185
+ type: string
186
+ description: ISO 3166-1 alpha-2 country code for the base point. Required even when the base point is given as lat/long coordinates.
187
+ lat:
188
+ type: number
189
+ format: float
190
+ description: Base latitude coordinate (-90 to 90). Alternative to code.
191
+ long:
192
+ type: number
193
+ format: float
194
+ description: Base longitude coordinate (-180 to 180). Alternative to code.
195
+ unit:
196
+ type: string
197
+ enum:
198
+ - km
199
+ - mi
200
+ - yd
201
+ - m
202
+ - ft
203
+ - in
204
+ default: km
205
+ description: 'Distance unit for the returned values. Default: km.'
206
+ DistanceCompareCode:
207
+ type: string
208
+ description: A ZIP or postal code to compare against the base point.
209
+ ErrorResponse:
210
+ type: object
211
+ description: Standard error envelope returned by the API on failed requests.
212
+ required:
213
+ - message
214
+ properties:
215
+ error:
216
+ type: string
217
+ description: Short error category or exception type.
218
+ message:
219
+ type: string
220
+ description: Human-readable error message describing the failure.
221
+ path:
222
+ type: string
223
+ description: API endpoint path that produced the error.
224
+ status:
225
+ type: integer
226
+ description: HTTP status code returned with the error.
227
+ timestamp:
228
+ type: string
229
+ format: date-time
230
+ description: Timestamp when the error occurred (ISO 8601).
231
+ security:
232
+ - ApiKeyAuthHeader: []
233
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,201 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: 'ZIP Codes Search by City API: Find ZIP Codes for Any City or State/Province/Region'
4
+ version: 1.0.0
5
+ description: Find all ZIP and postal codes for any city worldwide. Provide a city name and country code to retrieve the complete list of codes associated with that location. Supports an optional state_name filter for countries with administrative divisions. Results are paginated; each page returns the codes array plus total result count, total pages, current page, and current page size. An unrecognized city/country combination returns a 404, as does requesting a page beyond the available range.
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: ZIP Codes by City API Server
13
+ paths:
14
+ /zipcode/search/city:
15
+ get:
16
+ tags:
17
+ - ZIP Code APIs
18
+ summary: Search ZIP/postal codes by city
19
+ description: Returns every ZIP/postal code associated with the given city and country, optionally narrowed by state or province.
20
+ operationId: searchZipByCity
21
+ parameters:
22
+ - name: format
23
+ in: query
24
+ required: false
25
+ schema:
26
+ type: string
27
+ enum:
28
+ - json
29
+ - xml
30
+ default: json
31
+ description: 'Format of the response. Possible values: json, xml.'
32
+ - name: city
33
+ in: query
34
+ required: true
35
+ schema:
36
+ type: string
37
+ description: Name of the city to find ZIP/postal codes for.
38
+ - name: country
39
+ in: query
40
+ required: true
41
+ schema:
42
+ type: string
43
+ description: Country code in ISO 3166-1 alpha-2 format.
44
+ - name: state_name
45
+ in: query
46
+ required: false
47
+ schema:
48
+ type: string
49
+ description: Name of the state or province associated with the country. Useful to disambiguate cities with the same name in different states.
50
+ - name: page
51
+ in: query
52
+ required: false
53
+ schema:
54
+ type: integer
55
+ default: 1
56
+ minimum: 1
57
+ description: Page number to retrieve paginated results.
58
+ responses:
59
+ '200':
60
+ description: ZIP/postal codes retrieved successfully
61
+ content:
62
+ application/json:
63
+ schema:
64
+ $ref: '#/components/schemas/ZipcodeSearchCityResponse'
65
+ examples:
66
+ success:
67
+ summary: Codes for a city
68
+ value:
69
+ total_results: 368
70
+ total_pages: 1
71
+ current_page: 1
72
+ current_page_size: 368
73
+ codes:
74
+ - '90001'
75
+ - '90002'
76
+ - '90003'
77
+ - '90210'
78
+ - '90211'
79
+ - '90212'
80
+ '400':
81
+ description: Bad Request — Missing city, invalid country code, or invalid page number
82
+ content:
83
+ application/json:
84
+ schema:
85
+ $ref: '#/components/schemas/ErrorResponse'
86
+ examples:
87
+ MissingCity:
88
+ summary: Missing required city parameter
89
+ value:
90
+ error: Invalid Param Exception
91
+ message: please pass correct parameters
92
+ path: /v1.0/zipcode/search/city
93
+ status: 400
94
+ timestamp: '2026-07-27T11:22:48.293Z'
95
+ BadCountry:
96
+ summary: country is not a valid ISO 3166-1 alpha-2 code
97
+ value:
98
+ timestamp: '2026-07-27T11:22:59.112Z'
99
+ path: /v1.0/zipcode/search/city
100
+ status: 400
101
+ error: Invalid Country Code Provided
102
+ message: Only ISO 3166-1 alpha-2 codes country codes are supported.
103
+ BadPage:
104
+ summary: page is 0 or negative
105
+ value:
106
+ timestamp: '2026-07-27T11:22:59.742Z'
107
+ path: /v1.0/zipcode/search/city
108
+ status: 400
109
+ error: Invalid Page Number
110
+ message: The page number must be greater than 0.
111
+ '404':
112
+ description: Not Found — No codes for the city, or requested page is out of range
113
+ content:
114
+ application/json:
115
+ schema:
116
+ $ref: '#/components/schemas/ErrorResponse'
117
+ examples:
118
+ NotFound:
119
+ summary: No codes found for the given city/country
120
+ value:
121
+ timestamp: '2026-07-27T11:23:00.301Z'
122
+ path: /v1.0/zipcode/search/city
123
+ status: 404
124
+ error: Postal/Zip Codes Not Found
125
+ message: No postal/zip codes found for the provided city Nonexistentcityxyz123 in country US.
126
+ PageNotFound:
127
+ summary: Requested page exceeds total_pages
128
+ value:
129
+ timestamp: '2026-07-27T11:23:00.873Z'
130
+ path: /v1.0/zipcode/search/city
131
+ status: 404
132
+ error: Page Not Found
133
+ message: The requested page exceeds the available page range.
134
+ components:
135
+ securitySchemes:
136
+ ApiKeyAuthHeader:
137
+ type: apiKey
138
+ in: header
139
+ name: X-apiKey
140
+ description: Pass your API key via the X-apiKey request header.
141
+ ApiKeyAuthQuery:
142
+ type: apiKey
143
+ in: query
144
+ name: apiKey
145
+ description: Pass your API key via the apiKey query parameter.
146
+ schemas:
147
+ ZipcodeSearchCityResponse:
148
+ type: object
149
+ description: ZIP/postal codes for the requested city, with pagination metadata.
150
+ required:
151
+ - total_results
152
+ - total_pages
153
+ - current_page
154
+ - current_page_size
155
+ - codes
156
+ properties:
157
+ total_results:
158
+ type: integer
159
+ description: Total number of ZIP/postal codes found, across all pages.
160
+ total_pages:
161
+ type: integer
162
+ description: Total number of pages available.
163
+ current_page:
164
+ type: integer
165
+ description: Current page number.
166
+ current_page_size:
167
+ type: integer
168
+ description: Number of ZIP/postal codes in the current page.
169
+ codes:
170
+ type: array
171
+ description: List of ZIP/postal codes for the current page.
172
+ items:
173
+ $ref: '#/components/schemas/PostalCode'
174
+ PostalCode:
175
+ type: string
176
+ description: A single ZIP or postal code.
177
+ ErrorResponse:
178
+ type: object
179
+ description: Standard error envelope returned by the API on failed requests.
180
+ required:
181
+ - message
182
+ properties:
183
+ error:
184
+ type: string
185
+ description: Short error category or exception type.
186
+ message:
187
+ type: string
188
+ description: Human-readable error message describing the failure.
189
+ path:
190
+ type: string
191
+ description: API endpoint path that produced the error.
192
+ status:
193
+ type: integer
194
+ description: HTTP status code returned with the error.
195
+ timestamp:
196
+ type: string
197
+ format: date-time
198
+ description: Timestamp when the error occurred (ISO 8601).
199
+ security:
200
+ - ApiKeyAuthHeader: []
201
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,200 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: ZIP Codes by Region API Reference
4
+ version: 1.0.0
5
+ description: Find all ZIP and postal codes for any state, province, or region worldwide. Provide a country code and either a region name or region ISO code to retrieve all codes in that administrative division; region_code takes priority when both are supplied. Results are paginated with up to 500 codes per page, and the response includes total result count, total pages, current page, and current page size. An unrecognized region returns a 404, as does requesting a page beyond the available range.
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: ZIP Codes by Region API Server
13
+ paths:
14
+ /zipcode/search/region:
15
+ get:
16
+ tags:
17
+ - ZIP Code APIs
18
+ summary: Search ZIP codes by region
19
+ description: Returns every ZIP/postal code within the given region, state, or province of a country.
20
+ operationId: searchZipByRegion
21
+ parameters:
22
+ - name: format
23
+ in: query
24
+ required: false
25
+ schema:
26
+ type: string
27
+ enum:
28
+ - json
29
+ - xml
30
+ default: json
31
+ description: 'Format of the response. Possible values: json, xml.'
32
+ - name: country
33
+ in: query
34
+ required: true
35
+ schema:
36
+ type: string
37
+ description: Country code in ISO 3166-1 alpha-2 format.
38
+ - name: region
39
+ in: query
40
+ required: false
41
+ schema:
42
+ type: string
43
+ description: Name of the region, state, or province associated with the country. Either region or region_code is required.
44
+ - name: region_code
45
+ in: query
46
+ required: false
47
+ schema:
48
+ type: string
49
+ description: ISO code of the region, state, or province associated with the country. Either region or region_code is required. region_code takes priority if both are given.
50
+ - name: page
51
+ in: query
52
+ required: false
53
+ schema:
54
+ type: integer
55
+ default: 1
56
+ minimum: 1
57
+ description: Page number to retrieve. Each page returns up to 500 results.
58
+ responses:
59
+ '200':
60
+ description: ZIP/postal codes retrieved successfully
61
+ content:
62
+ application/json:
63
+ schema:
64
+ $ref: '#/components/schemas/ZipcodeSearchRegionResponse'
65
+ examples:
66
+ success:
67
+ summary: Codes for a region
68
+ value:
69
+ total_results: 2591
70
+ total_pages: 6
71
+ current_page: 1
72
+ current_page_size: 500
73
+ codes:
74
+ - '90001'
75
+ - '90002'
76
+ - '90003'
77
+ - '90004'
78
+ - '90005'
79
+ '400':
80
+ description: Bad Request — Missing region/region_code, invalid country code, or invalid page number
81
+ content:
82
+ application/json:
83
+ schema:
84
+ $ref: '#/components/schemas/ErrorResponse'
85
+ examples:
86
+ MissingRegion:
87
+ summary: Neither region nor region_code was provided
88
+ value:
89
+ error: Invalid Param Exception
90
+ message: please pass correct parameters
91
+ path: /v1.0/zipcode/search/region
92
+ status: 400
93
+ timestamp: '2026-07-27T11:23:39.623Z'
94
+ BadCountry:
95
+ summary: country is not a valid ISO 3166-1 alpha-2 code
96
+ value:
97
+ timestamp: '2026-07-27T11:23:46.673Z'
98
+ path: /v1.0/zipcode/search/region
99
+ status: 400
100
+ error: Invalid Country Code Provided
101
+ message: Only ISO 3166-1 alpha-2 codes country codes are supported.
102
+ BadPage:
103
+ summary: page is 0 or negative
104
+ value:
105
+ timestamp: '2026-07-27T11:23:47.192Z'
106
+ path: /v1.0/zipcode/search/region
107
+ status: 400
108
+ error: Invalid Page Number
109
+ message: The page number must be greater than 0.
110
+ '404':
111
+ description: Not Found — No codes for the region, or requested page is out of range
112
+ content:
113
+ application/json:
114
+ schema:
115
+ $ref: '#/components/schemas/ErrorResponse'
116
+ examples:
117
+ NotFound:
118
+ summary: No codes found for the given region/country
119
+ value:
120
+ timestamp: '2026-07-27T11:23:47.785Z'
121
+ path: /v1.0/zipcode/search/region
122
+ status: 404
123
+ error: Postal/Zip Codes Not Found
124
+ message: No postal/zip codes found for the provided region Nonexistentregionxyz in country US.
125
+ PageNotFound:
126
+ summary: Requested page exceeds total_pages
127
+ value:
128
+ timestamp: '2026-07-27T11:23:48.312Z'
129
+ path: /v1.0/zipcode/search/region
130
+ status: 404
131
+ error: Page Not Found
132
+ message: The requested page exceeds the available page range.
133
+ components:
134
+ securitySchemes:
135
+ ApiKeyAuthHeader:
136
+ type: apiKey
137
+ in: header
138
+ name: X-apiKey
139
+ description: Pass your API key via the X-apiKey request header.
140
+ ApiKeyAuthQuery:
141
+ type: apiKey
142
+ in: query
143
+ name: apiKey
144
+ description: Pass your API key via the apiKey query parameter.
145
+ schemas:
146
+ ZipcodeSearchRegionResponse:
147
+ type: object
148
+ description: ZIP/postal codes for the requested region, with pagination metadata.
149
+ required:
150
+ - total_results
151
+ - total_pages
152
+ - current_page
153
+ - current_page_size
154
+ - codes
155
+ properties:
156
+ total_results:
157
+ type: integer
158
+ description: Total number of ZIP/postal codes found, across all pages.
159
+ total_pages:
160
+ type: integer
161
+ description: Total number of pages available.
162
+ current_page:
163
+ type: integer
164
+ description: Current page number.
165
+ current_page_size:
166
+ type: integer
167
+ description: Number of ZIP/postal codes in the current page.
168
+ codes:
169
+ type: array
170
+ description: List of ZIP/postal codes for the current page.
171
+ items:
172
+ $ref: '#/components/schemas/PostalCode'
173
+ PostalCode:
174
+ type: string
175
+ description: A single ZIP or postal code.
176
+ ErrorResponse:
177
+ type: object
178
+ description: Standard error envelope returned by the API on failed requests.
179
+ required:
180
+ - message
181
+ properties:
182
+ error:
183
+ type: string
184
+ description: Short error category or exception type.
185
+ message:
186
+ type: string
187
+ description: Human-readable error message describing the failure.
188
+ path:
189
+ type: string
190
+ description: API endpoint path that produced the error.
191
+ status:
192
+ type: integer
193
+ description: HTTP status code returned with the error.
194
+ timestamp:
195
+ type: string
196
+ format: date-time
197
+ description: Timestamp when the error occurred (ISO 8601).
198
+ security:
199
+ - ApiKeyAuthHeader: []
200
+ - ApiKeyAuthQuery: []