@apifreaks/openapi-specs 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/index.cjs +131 -0
  2. package/dist/index.d.cts +140 -3
  3. package/dist/index.d.ts +140 -3
  4. package/dist/index.js +129 -0
  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
@@ -0,0 +1,232 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: Bulk ZIP Code Lookup API Reference
4
+ version: 1.0.0
5
+ description: Look up multiple ZIP or postal codes in a single POST request, up to 100 codes per batch. Each matched code returns city, region, region code, locality, country code, latitude, and longitude. Accepts an optional `country` field in the request body to limit results to one country. Codes with no match are silently omitted from the `results` array instead of appearing as per-item error entries — the array can be shorter than the requested `codes` list. A malformed request body or invalid country code returns a 400; if none of the submitted codes match anything, the whole request returns 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: Bulk ZIP Code Lookup API Server
13
+ paths:
14
+ /zipcode/lookup:
15
+ post:
16
+ tags:
17
+ - ZIP Code APIs
18
+ summary: Look up multiple ZIP/postal codes in one request
19
+ operationId: bulkLookupZipCodes
20
+ description: Looks up up to 100 ZIP/postal codes in a single request and returns matching location data for each code that resolves.
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
+ content:
35
+ application/json:
36
+ schema:
37
+ $ref: '#/components/schemas/BulkZipRequest'
38
+ examples:
39
+ typicalRequest:
40
+ summary: Typical bulk lookup request
41
+ value:
42
+ codes:
43
+ - '10001'
44
+ - '90210'
45
+ country: US
46
+ responses:
47
+ '200':
48
+ description: Successful response. `results` contains one entry per code that matched, in match order — codes with no match are omitted rather than represented as error entries, so the array can be shorter than the requested `codes` list.
49
+ content:
50
+ application/json:
51
+ schema:
52
+ $ref: '#/components/schemas/ZipcodeLookupResponse'
53
+ examples:
54
+ typicalSuccess:
55
+ summary: All requested codes matched
56
+ value:
57
+ results:
58
+ - code: '10001'
59
+ country_code: US
60
+ region: New York
61
+ region_code: NY
62
+ city: New York County
63
+ locality: Manhattan
64
+ latitude: 40.748436
65
+ longitude: -73.99402
66
+ - code: '90210'
67
+ country_code: US
68
+ region: California
69
+ region_code: CA
70
+ city: Los Angeles
71
+ locality: Beverly Hills (Beverly Hills)
72
+ latitude: 34.10313
73
+ longitude: -118.41625
74
+ partialMatch:
75
+ summary: One of two requested codes matched — the unmatched code is simply absent
76
+ value:
77
+ results:
78
+ - code: '10001'
79
+ country_code: US
80
+ region: New York
81
+ region_code: NY
82
+ city: New York County
83
+ locality: Manhattan
84
+ latitude: 40.748436
85
+ longitude: -73.99402
86
+ '400':
87
+ description: Bad Request — Malformed body, invalid country code, or over the 100-code limit
88
+ content:
89
+ application/json:
90
+ schema:
91
+ $ref: '#/components/schemas/ErrorResponse'
92
+ examples:
93
+ InvalidBody:
94
+ summary: codes field missing or malformed
95
+ value:
96
+ timestamp: '2026-07-27T11:18:38.639Z'
97
+ path: /v1.0/zipcode/lookup
98
+ status: 400
99
+ error: Request Body Invalid
100
+ message: Request body is missing required fields or is not in the expected format. Please refer to the API documentation.
101
+ InvalidCountryCode:
102
+ summary: country is not a valid ISO 3166-1 alpha-2 code
103
+ value:
104
+ timestamp: '2026-07-27T11:18:39.139Z'
105
+ path: /v1.0/zipcode/lookup
106
+ status: 400
107
+ error: Invalid Country Code Provided
108
+ message: Only ISO 3166-1 alpha-2 codes country codes are supported.
109
+ BulkLimitExceeded:
110
+ summary: More than 100 codes submitted
111
+ value:
112
+ timestamp: '2026-07-27T11:18:48.850Z'
113
+ path: /v1.0/zipcode/lookup
114
+ status: 400
115
+ error: Maximum Postal/Zip Code Limit Exceeded
116
+ message: A maximum of 100 postal/zip codes can be processed per request.
117
+ '404':
118
+ description: Not Found — None of the submitted codes matched anything
119
+ content:
120
+ application/json:
121
+ schema:
122
+ $ref: '#/components/schemas/ErrorResponse'
123
+ examples:
124
+ ZipNotFound:
125
+ summary: No codes matched
126
+ value:
127
+ timestamp: '2026-07-27T11:18:39.650Z'
128
+ path: /v1.0/zipcode/lookup
129
+ status: 404
130
+ error: Postal/Zip Codes Not Found
131
+ message: None of the provided postal/zip codes were found in our database.
132
+ components:
133
+ securitySchemes:
134
+ ApiKeyAuthHeader:
135
+ type: apiKey
136
+ in: header
137
+ name: X-apiKey
138
+ description: Pass your API key via the X-apiKey request header.
139
+ ApiKeyAuthQuery:
140
+ type: apiKey
141
+ in: query
142
+ name: apiKey
143
+ description: Pass your API key via the apiKey query parameter.
144
+ schemas:
145
+ ZipcodeLookupResponse:
146
+ type: object
147
+ description: ZIP code lookup result containing an array of matched postal codes with location details.
148
+ required:
149
+ - results
150
+ properties:
151
+ results:
152
+ type: array
153
+ description: Array of matched ZIP code results. Codes with no match are omitted, so this array can be shorter than the requested codes list.
154
+ items:
155
+ $ref: '#/components/schemas/ZipResultItem'
156
+ ZipResultItem:
157
+ type: object
158
+ description: A ZIP code result containing location details.
159
+ required:
160
+ - code
161
+ - country_code
162
+ - region
163
+ - region_code
164
+ - city
165
+ - latitude
166
+ - longitude
167
+ properties:
168
+ code:
169
+ type: string
170
+ description: Postal/ZIP code of the location.
171
+ country_code:
172
+ type: string
173
+ description: Country code in ISO 3166-1 alpha-2 format.
174
+ region:
175
+ type: string
176
+ description: Region, state, or province associated with the postal code.
177
+ region_code:
178
+ type: string
179
+ description: Region code or abbreviation.
180
+ city:
181
+ type: string
182
+ description: City associated with the postal code.
183
+ locality:
184
+ type: string
185
+ description: Locality or neighborhood associated with the postal code. Can be an empty string when no locality-level data exists.
186
+ latitude:
187
+ type: number
188
+ format: float
189
+ description: Latitude coordinate of the postal code location.
190
+ longitude:
191
+ type: number
192
+ format: float
193
+ description: Longitude coordinate of the postal code location.
194
+ BulkZipRequest:
195
+ type: object
196
+ description: Request body for bulk ZIP/postal code lookup.
197
+ required:
198
+ - codes
199
+ properties:
200
+ codes:
201
+ type: array
202
+ description: Array of ZIP or postal codes to look up. Maximum 100 codes per request.
203
+ items:
204
+ type: string
205
+ country:
206
+ type: string
207
+ description: ISO 3166-1 alpha-2 country code to limit the search to. Applies to every code in the batch.
208
+ ErrorResponse:
209
+ type: object
210
+ description: Standard error envelope returned by the API on failed requests.
211
+ required:
212
+ - message
213
+ properties:
214
+ error:
215
+ type: string
216
+ description: Short error category or exception type.
217
+ message:
218
+ type: string
219
+ description: Human-readable error message describing the failure.
220
+ path:
221
+ type: string
222
+ description: API endpoint path that produced the error.
223
+ status:
224
+ type: integer
225
+ description: HTTP status code returned with the error.
226
+ timestamp:
227
+ type: string
228
+ format: date-time
229
+ description: Timestamp when the error occurred (ISO 8601).
230
+ security:
231
+ - ApiKeyAuthHeader: []
232
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,216 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: ZIP Code API - Global ZIP & Postal Code Lookup and Validation
4
+ version: 1.0.0
5
+ description: Look up and validate a single ZIP or postal code worldwide, returning every location that uses it. Returns city, region, region code, locality, country code, latitude, and longitude for each matching location. A postal code can map to multiple locations across different countries (e.g. "90210" matches places in the US, Ukraine, Kenya, Mexico, and Pakistan) unless the optional `country` parameter narrows the search to one country. Only one code is accepted per request — for multiple codes in one call, use the Bulk ZIP Code Lookup API instead. Invalid country codes return a 400, and codes with no match 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: ZIP Code Lookup API Server
13
+ paths:
14
+ /zipcode/lookup:
15
+ get:
16
+ tags:
17
+ - ZIP Code APIs
18
+ summary: Look up a ZIP/postal code
19
+ description: Returns every location worldwide that matches the given postal/ZIP code, optionally narrowed to one country.
20
+ operationId: lookupZipCode
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: code
33
+ in: query
34
+ required: true
35
+ schema:
36
+ type: string
37
+ description: The postal/ZIP code to look up. Only one code is accepted per request.
38
+ - name: country
39
+ in: query
40
+ required: false
41
+ schema:
42
+ type: string
43
+ description: Country code in ISO 3166-1 alpha-2 format. Limits results to that country. If not provided, matching locations from all countries are returned.
44
+ responses:
45
+ '200':
46
+ description: Successful response with matching ZIP code locations
47
+ content:
48
+ application/json:
49
+ schema:
50
+ $ref: '#/components/schemas/ZipcodeLookupResponse'
51
+ examples:
52
+ success:
53
+ summary: Code matched in one country
54
+ value:
55
+ results:
56
+ - code: '90210'
57
+ country_code: US
58
+ region: California
59
+ region_code: CA
60
+ city: Los Angeles
61
+ locality: Beverly Hills (Beverly Hills)
62
+ latitude: 34.10313
63
+ longitude: -118.41625
64
+ multipleCountryMatches:
65
+ summary: Same code matched across multiple countries (no country filter)
66
+ value:
67
+ results:
68
+ - code: '90210'
69
+ country_code: US
70
+ region: California
71
+ region_code: CA
72
+ city: Los Angeles
73
+ locality: Beverly Hills (Beverly Hills)
74
+ latitude: 34.10313
75
+ longitude: -118.41625
76
+ - code: '90210'
77
+ country_code: UA
78
+ region: Zakarpattia Oblast
79
+ region_code: '21'
80
+ city: Batovo Settlement Hromada
81
+ locality: Svoboda
82
+ latitude: 48.35717
83
+ longitude: 22.367962
84
+ - code: '90210'
85
+ country_code: KE
86
+ region: Kitui
87
+ region_code: '18'
88
+ city: Matinyani
89
+ locality: Kalia
90
+ latitude: -1.310763
91
+ longitude: 37.969997
92
+ '400':
93
+ description: Bad Request — Missing code or invalid country code
94
+ content:
95
+ application/json:
96
+ schema:
97
+ $ref: '#/components/schemas/ErrorResponse'
98
+ examples:
99
+ MissingCode:
100
+ summary: Missing required code parameter
101
+ value:
102
+ error: Invalid Param Exception
103
+ message: please pass correct parameters
104
+ path: /v1.0/zipcode/lookup
105
+ status: 400
106
+ timestamp: '2026-07-27T11:17:13.351Z'
107
+ InvalidCountryCode:
108
+ summary: country is not a valid ISO 3166-1 alpha-2 code
109
+ value:
110
+ timestamp: '2026-07-27T11:17:13.872Z'
111
+ path: /v1.0/zipcode/lookup
112
+ status: 400
113
+ error: Invalid Country Code Provided
114
+ message: Only ISO 3166-1 alpha-2 codes country codes are supported.
115
+ '404':
116
+ description: Not Found — No location matches the given code
117
+ content:
118
+ application/json:
119
+ schema:
120
+ $ref: '#/components/schemas/ErrorResponse'
121
+ examples:
122
+ ZipNotFound:
123
+ summary: Postal/ZIP code not found
124
+ value:
125
+ timestamp: '2026-07-27T11:17:14.474Z'
126
+ path: /v1.0/zipcode/lookup
127
+ status: 404
128
+ error: Postal/Zip Code Not Found
129
+ message: Provided postal/zip code was not found in our database.
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
+ ApiKeyAuthQuery:
138
+ type: apiKey
139
+ in: query
140
+ name: apiKey
141
+ description: Pass your API key via the apiKey query parameter.
142
+ schemas:
143
+ ZipcodeLookupResponse:
144
+ type: object
145
+ description: ZIP code lookup result containing an array of matching postal codes with location details.
146
+ required:
147
+ - results
148
+ properties:
149
+ results:
150
+ type: array
151
+ description: Array of ZIP code results matching the requested code. When multiple locations worldwide share the same postal code, each appears as a separate entry.
152
+ items:
153
+ $ref: '#/components/schemas/ZipResultItem'
154
+ ZipResultItem:
155
+ type: object
156
+ description: A ZIP code result containing location details.
157
+ required:
158
+ - code
159
+ - country_code
160
+ - region
161
+ - region_code
162
+ - city
163
+ - latitude
164
+ - longitude
165
+ properties:
166
+ code:
167
+ type: string
168
+ description: Postal/ZIP code of the location.
169
+ country_code:
170
+ type: string
171
+ description: Country code in ISO 3166-1 alpha-2 format.
172
+ region:
173
+ type: string
174
+ description: Region, state, or province associated with the postal code.
175
+ region_code:
176
+ type: string
177
+ description: Region code or abbreviation.
178
+ city:
179
+ type: string
180
+ description: City associated with the postal code.
181
+ locality:
182
+ type: string
183
+ description: Locality or neighborhood associated with the postal code. Can be an empty string when no locality-level data exists.
184
+ latitude:
185
+ type: number
186
+ format: float
187
+ description: Latitude coordinate of the postal code location.
188
+ longitude:
189
+ type: number
190
+ format: float
191
+ description: Longitude coordinate of the postal code location.
192
+ ErrorResponse:
193
+ type: object
194
+ description: Standard error envelope returned by the API on failed requests.
195
+ required:
196
+ - message
197
+ properties:
198
+ error:
199
+ type: string
200
+ description: Short error category or exception type.
201
+ message:
202
+ type: string
203
+ description: Human-readable error message describing the failure.
204
+ path:
205
+ type: string
206
+ description: API endpoint path that produced the error.
207
+ status:
208
+ type: integer
209
+ description: HTTP status code returned with the error.
210
+ timestamp:
211
+ type: string
212
+ format: date-time
213
+ description: Timestamp when the error occurred (ISO 8601).
214
+ security:
215
+ - ApiKeyAuthHeader: []
216
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,239 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: ZIP Code Distance Match API Reference
4
+ version: 1.0.0
5
+ description: 'Find all pairs of postal codes within a specified distance threshold from a list of up to 100 input codes. Specify a maximum distance and receive every pair of codes whose separation is at or below that value; if no pairs fall within the threshold, a 200 with an empty results array is returned rather than a 404. Supports six distance units: kilometers, miles, yards, meters, feet, and inches. A `country` code is always required. Results include each matched pair with its calculated distance.'
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 Match API Server
13
+ paths:
14
+ /zipcode/distance/match:
15
+ post:
16
+ tags:
17
+ - ZIP Code APIs
18
+ summary: Get matching ZIP/postal code pairs within a distance
19
+ operationId: getZipcodeDistanceMatch
20
+ description: Returns every pair of the requested ZIP/postal codes whose distance from each other is at or below the given threshold.
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: The list of codes, their country, and an optional distance threshold and unit.
35
+ content:
36
+ application/json:
37
+ schema:
38
+ $ref: '#/components/schemas/DistanceMatchRequest'
39
+ examples:
40
+ typicalRequest:
41
+ summary: Find pairs within 5km
42
+ value:
43
+ codes:
44
+ - '90210'
45
+ - '90211'
46
+ - '90212'
47
+ - '10001'
48
+ country: US
49
+ distance: 5
50
+ responses:
51
+ '200':
52
+ description: Successful response with matching ZIP code pairs. If none of the codes are within the distance threshold of each other, results is an empty array — this is not a 404.
53
+ content:
54
+ application/json:
55
+ schema:
56
+ $ref: '#/components/schemas/ZipcodeDistanceMatchResponse'
57
+ examples:
58
+ success:
59
+ summary: Pairs within threshold
60
+ value:
61
+ result_count: 2
62
+ results:
63
+ - code_1: '90211'
64
+ code_2: '90212'
65
+ distance: 1.958
66
+ - code_1: '90210'
67
+ code_2: '90212'
68
+ distance: 4.704
69
+ noPairsWithinThreshold:
70
+ summary: No pairs within the threshold
71
+ value:
72
+ result_count: 0
73
+ results: []
74
+ '400':
75
+ description: Bad Request — Missing/invalid body, country, or unit, or over the 100-code limit
76
+ content:
77
+ application/json:
78
+ schema:
79
+ $ref: '#/components/schemas/ErrorResponse'
80
+ examples:
81
+ InvalidBody:
82
+ summary: codes field missing or malformed
83
+ value:
84
+ timestamp: '2026-07-27T11:21:58.473Z'
85
+ path: /v1.0/zipcode/distance/match
86
+ status: 400
87
+ error: Request Body Invalid
88
+ message: Request body is missing required fields or is not in the expected format. Please refer to the API documentation.
89
+ MissingCountry:
90
+ summary: Missing required country field
91
+ value:
92
+ timestamp: '2026-07-27T11:21:42.483Z'
93
+ path: /v1.0/zipcode/distance/match
94
+ status: 400
95
+ error: Country Code Missing
96
+ message: Provide a valid ISO 3166-1 alpha-2 country code.
97
+ BadCountry:
98
+ summary: country is not a valid ISO 3166-1 alpha-2 code
99
+ value:
100
+ timestamp: '2026-07-27T11:21:57.332Z'
101
+ path: /v1.0/zipcode/distance/match
102
+ status: 400
103
+ error: Invalid Country Code Provided
104
+ message: Only ISO 3166-1 alpha-2 codes country codes are supported.
105
+ InvalidUnit:
106
+ summary: unit is not one of the supported symbols
107
+ value:
108
+ timestamp: '2026-07-27T11:21:56.749Z'
109
+ path: /v1.0/zipcode/distance/match
110
+ status: 400
111
+ error: Invalid Unit Symbol
112
+ message: The provided unit symbol is invalid. Please refer to the documentation for supported units.
113
+ OverLimit:
114
+ summary: More than 100 codes submitted
115
+ value:
116
+ timestamp: '2026-07-27T11:21:57.961Z'
117
+ path: /v1.0/zipcode/distance/match
118
+ status: 400
119
+ error: Maximum Postal/Zip Code Limit Exceeded
120
+ message: A maximum of 100 postal/zip codes can be processed per request.
121
+ '404':
122
+ description: Not Found — None of the submitted codes matched anything
123
+ content:
124
+ application/json:
125
+ schema:
126
+ $ref: '#/components/schemas/ErrorResponse'
127
+ examples:
128
+ NotFound:
129
+ summary: No codes matched
130
+ value:
131
+ timestamp: '2026-07-27T11:21:59.589Z'
132
+ path: /v1.0/zipcode/distance/match
133
+ status: 404
134
+ error: Postal/Zip Codes Not Found
135
+ message: None of the provided postal/zip codes were found in our database.
136
+ components:
137
+ securitySchemes:
138
+ ApiKeyAuthHeader:
139
+ type: apiKey
140
+ in: header
141
+ name: X-apiKey
142
+ description: Pass your API key via the X-apiKey request header.
143
+ ApiKeyAuthQuery:
144
+ type: apiKey
145
+ in: query
146
+ name: apiKey
147
+ description: Pass your API key via the apiKey query parameter.
148
+ schemas:
149
+ ZipcodeDistanceMatchResponse:
150
+ type: object
151
+ description: Matching ZIP/postal code pairs within the requested distance threshold.
152
+ required:
153
+ - result_count
154
+ - results
155
+ properties:
156
+ result_count:
157
+ type: integer
158
+ description: Number of matching ZIP/postal code pairs returned. Zero when no pairs fall within the threshold.
159
+ results:
160
+ type: array
161
+ description: Array of matching code pairs within the requested distance threshold.
162
+ items:
163
+ $ref: '#/components/schemas/ZipcodeDistanceMatchItem'
164
+ ZipcodeDistanceMatchItem:
165
+ type: object
166
+ description: A single matched pair of ZIP/postal codes with the distance between them.
167
+ required:
168
+ - code_1
169
+ - code_2
170
+ - distance
171
+ properties:
172
+ code_1:
173
+ type: string
174
+ description: First ZIP/postal code in the pair.
175
+ code_2:
176
+ type: string
177
+ description: Second ZIP/postal code in the pair.
178
+ distance:
179
+ type: number
180
+ format: float
181
+ description: Distance between the ZIP/postal code pair, in the unit specified by the unit field (default km).
182
+ DistanceMatchRequest:
183
+ type: object
184
+ description: Request body specifying the codes, country, and distance threshold to match pairs within.
185
+ required:
186
+ - codes
187
+ - country
188
+ properties:
189
+ codes:
190
+ type: array
191
+ description: List of ZIP or postal codes to find pairs within the specified distance. Maximum 100 codes.
192
+ items:
193
+ $ref: '#/components/schemas/DistanceMatchInputCode'
194
+ country:
195
+ type: string
196
+ description: Country of the codes in ISO 3166-1 alpha-2 format. Required.
197
+ distance:
198
+ type: number
199
+ format: float
200
+ description: Maximum distance threshold. All pairs within this distance are returned. If omitted, the API applies a default threshold.
201
+ unit:
202
+ type: string
203
+ enum:
204
+ - km
205
+ - mi
206
+ - yd
207
+ - m
208
+ - ft
209
+ - in
210
+ default: km
211
+ description: 'Distance unit. Default: km.'
212
+ DistanceMatchInputCode:
213
+ type: string
214
+ description: A ZIP or postal code to find distance matches for.
215
+ ErrorResponse:
216
+ type: object
217
+ description: Standard error envelope returned by the API on failed requests.
218
+ required:
219
+ - message
220
+ properties:
221
+ error:
222
+ type: string
223
+ description: Short error category or exception type.
224
+ message:
225
+ type: string
226
+ description: Human-readable error message describing the failure.
227
+ path:
228
+ type: string
229
+ description: API endpoint path that produced the error.
230
+ status:
231
+ type: integer
232
+ description: HTTP status code returned with the error.
233
+ timestamp:
234
+ type: string
235
+ format: date-time
236
+ description: Timestamp when the error occurred (ISO 8601).
237
+ security:
238
+ - ApiKeyAuthHeader: []
239
+ - ApiKeyAuthQuery: []