-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-docs.yaml
More file actions
2016 lines (1929 loc) · 61.1 KB
/
Copy pathapi-docs.yaml
File metadata and controls
2016 lines (1929 loc) · 61.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Geocoding API
description: |
A fast and comprehensive REST API for US ZIP code geocoding, Ohio address lookup, and county boundary data.
## 🔐 Authentication Required
Most endpoints require an API key. To get started:
1. **Register**: Visit the web interface and create an account
2. **Get API Key**: Create an API key in your dashboard
3. **Authenticate**: Use either authentication method:
- `Authorization: Bearer your-api-key` header, OR
- `X-API-Key: your-api-key` header
4. **Test**: Use the "Authorize" button below to set your API key for all requests
## ✨ Features
- **Lightning Fast**: PostgreSQL + PostGIS backed with optimized spatial indexes
- **Multi-Level Coverage**: ZIP codes, cities, addresses, and county boundaries
- **Comprehensive Data**: Population, density, coordinates, and geographic boundaries
- **Flexible Search**: Multiple search modes with proximity and filtering
- **ZIP Code Fallback**: City-based ZIP code lookup for flexible address searching
- **Rich Metadata**: Timezone, county weights, administrative data
- **GeoJSON Support**: Ready-to-use geographic data for mapping applications
- **Usage Tracking**: Monitor your API usage and billing
## 📊 Data Coverage
### **🏙️ City Data**
- **31,000+ US Cities**: Nationwide city coverage with demographics
- **ZIP Code Associations**: All ZIP codes for each city
- **Population & Density**: Demographic statistics
- **Coordinates**: Precise latitude/longitude for each city
- **Fallback Search**: Find addresses when ZIP code is unknown or incorrect
### **🏠 Address-Level Data**
- **5.5+ Million Ohio Addresses**: Complete street-level geocoding
- **Precise Coordinates**: PostGIS geometry with spatial indexing
- **Administrative Data**: City, county, ZIP code associations
### **📮 ZIP Code Data**
- **33,000+ US ZIP Codes**: Comprehensive national coverage
- **Geographic Coordinates**: Latitude/longitude with precision indicators
- **Demographics**: Population and density statistics
- **Administrative**: County associations and timezone data
### **🗺️ County Boundaries**
- **89 Ohio Counties**: Complete polygon boundary data
- **GeoJSON Format**: Ready for Leaflet, Mapbox, OpenLayers
- **Spatial Queries**: Bounding box intersections and proximity searches
- **Statistics**: Address counts and administrative metadata
version: 1.0.0
contact:
name: API Support
url: https://github.com/keonik/geocoding-api
email: john.k.fay@gmail.com
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: http://localhost:8080/api/v1
description: Development server
- url: https://geocode.jfay.dev/api/v1
description: Production server
paths:
/health:
get:
summary: Health Check
description: Returns the current health status of the API service
operationId: healthCheck
tags:
- System
responses:
'200':
description: Service is healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: "healthy"
service:
type: string
example: "geocoding-api"
version:
type: string
example: "1.0.0"
/geocode/{zipcode}:
get:
summary: Get ZIP Code Details
description: |
Retrieve comprehensive geographic and demographic information for a specific US ZIP code.
Returns detailed location data including coordinates, population statistics,
administrative boundaries, and timezone information.
**Authentication Required**: This endpoint requires a valid API key using either `X-API-Key` header or `Authorization: Bearer` format.
operationId: getZipCode
security:
- ApiKeyAuth: []
tags:
- Geocoding
parameters:
- name: zipcode
in: path
required: true
description: US ZIP code (5 or 9 digits)
schema:
type: string
pattern: '^\d{5}(-\d{4})?$'
example: "10001"
responses:
'200':
description: ZIP code found successfully
content:
application/json:
schema:
$ref: '#/components/schemas/GeocodeResponse'
examples:
manhattan_zip:
summary: Manhattan ZIP code example
value:
success: true
data:
zip_code: "10001"
city_name: "New York"
state_code: "NY"
state_name: "New York"
zcta: true
population: 21102.0
density: 35400.5
primary_county_code: "36061"
primary_county_name: "New York"
county_weights:
"36061": "100"
county_names: ["New York"]
county_codes: ["36061"]
imprecise: false
military: false
timezone: "America/New_York"
latitude: 40.75066
longitude: -73.99670
count: 1
'400':
description: Invalid ZIP code format
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error: "Invalid ZIP code format"
'404':
description: ZIP code not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error: "ZIP code not found"
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/search:
get:
summary: Search ZIP Codes by City
description: |
Search for ZIP codes by city name with optional state filtering.
Supports partial city name matching and returns multiple results.
Useful for autocomplete functionality or when exact ZIP code is unknown.
operationId: searchZipCodes
security:
- ApiKeyAuth: []
tags:
- Search
parameters:
- name: city
in: query
required: true
description: City name or partial city name to search for
schema:
type: string
minLength: 2
example: "Springfield"
- name: state
in: query
required: false
description: Two-letter state code to filter results
schema:
type: string
pattern: '^[A-Z]{2}$'
example: "IL"
- name: limit
in: query
required: false
description: Maximum number of results to return
schema:
type: integer
minimum: 1
maximum: 100
default: 50
example: 25
responses:
'200':
description: Search completed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/SearchResponse'
examples:
springfield_search:
summary: Springfield search results
value:
success: true
data:
- zip_code: "62701"
city_name: "Springfield"
state_code: "IL"
state_name: "Illinois"
latitude: 39.78172
longitude: -89.64371
- zip_code: "62702"
city_name: "Springfield"
state_code: "IL"
state_name: "Illinois"
latitude: 39.76009
longitude: -89.60733
count: 2
'400':
description: Invalid search parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/distance/{from}/{to}:
get:
summary: Calculate Distance Between ZIP Codes
description: |
Calculate the precise distance between two ZIP codes using the Haversine formula.
Returns distance in both miles and kilometers for accurate geographic calculations.
Perfect for logistics, delivery radius validation, and distance-based searches.
operationId: calculateDistance
security:
- ApiKeyAuth: []
tags:
- Distance
parameters:
- name: from
in: path
required: true
description: Starting ZIP code
schema:
type: string
pattern: '^\d{5}(-\d{4})?$'
example: "10001"
- name: to
in: path
required: true
description: Destination ZIP code
schema:
type: string
pattern: '^\d{5}(-\d{4})?$'
example: "90210"
responses:
'200':
description: Distance calculated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/DistanceResponse'
example:
success: true
data:
from_zip_code: "10001"
to_zip_code: "90210"
distance_miles: 2445.5
distance_km: 3936.2
count: 1
'400':
description: Invalid ZIP code format
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/nearby/{zipcode}:
get:
summary: Find Nearby ZIP Codes
description: |
Find all ZIP codes within a specified radius of a center ZIP code.
Returns ZIP codes sorted by distance with complete location data.
Ideal for location-based services, delivery zones, and proximity marketing.
operationId: findNearbyZipCodes
security:
- ApiKeyAuth: []
tags:
- Distance
parameters:
- name: zipcode
in: path
required: true
description: Center ZIP code to search around
schema:
type: string
pattern: '^\d{5}(-\d{4})?$'
example: "10001"
- name: radius
in: query
required: false
description: Search radius in miles
schema:
type: number
format: double
minimum: 0.1
maximum: 100
default: 1
example: 5
- name: limit
in: query
required: false
description: Maximum number of results to return
schema:
type: integer
minimum: 1
maximum: 200
default: 50
example: 25
responses:
'200':
description: Nearby ZIP codes found successfully
content:
application/json:
schema:
$ref: '#/components/schemas/NearbyResponse'
examples:
nearby_results:
summary: ZIP codes within 5 miles of Manhattan
value:
success: true
data:
- zip_code:
zip_code: "10002"
city_name: "New York"
state_code: "NY"
latitude: 40.71571
longitude: -73.98803
distance_miles: 0.8
distance_km: 1.3
- zip_code:
zip_code: "10003"
city_name: "New York"
state_code: "NY"
latitude: 40.73168
longitude: -73.98975
distance_miles: 1.2
distance_km: 1.9
count: 2
'400':
description: Invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/proximity/{center}/{target}:
get:
summary: Check ZIP Code Proximity
description: |
Check if a target ZIP code is within a specified radius of a center ZIP code.
Returns boolean result with actual distance for precise proximity checking.
Useful for validation, filtering, and business rule enforcement.
operationId: checkZipCodeProximity
security:
- ApiKeyAuth: []
tags:
- Distance
parameters:
- name: center
in: path
required: true
description: Center ZIP code for proximity check
schema:
type: string
pattern: '^\d{5}(-\d{4})?$'
example: "10001"
- name: target
in: path
required: true
description: Target ZIP code to check proximity for
schema:
type: string
pattern: '^\d{5}(-\d{4})?$'
example: "10002"
- name: radius
in: query
required: false
description: Radius in miles for proximity check
schema:
type: number
format: double
minimum: 0.1
maximum: 100
default: 1
example: 1
responses:
'200':
description: Proximity check completed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ProximityResponse'
example:
success: true
data:
center_zip_code: "10001"
target_zip_code: "10002"
radius_miles: 1
is_within_radius: true
actual_distance_miles: 0.5
actual_distance_km: 0.8
count: 1
'400':
description: Invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/addresses:
get:
summary: Search Ohio Addresses
description: |
Search for addresses within Ohio with flexible filtering and intelligent full-text search.
**Enhanced Full-Text Search**: The `query` parameter now searches the complete formatted address,
making it easier to find addresses with partial information in any order:
- `query=123 main columbus` → Finds "123 Main St, Columbus, OH 43215"
- `query=main st 43215` → Finds Main Street addresses in ZIP 43215
- `query=franklin county main` → Finds Main Street in Franklin County
The search uses relevance scoring with the formatted full address getting highest priority,
followed by individual fields (street, house number, city, ZIP code, county).
**Features:**
- Flexible text search across all address components
- Specific field filtering (city, county, ZIP code)
- Proximity search by coordinates and radius
- Relevance-based result ranking
- Pagination support
Perfect for address validation, autocomplete, and location-based services.
operationId: searchOhioAddresses
security:
- ApiKeyAuth: []
tags:
- Ohio Addresses
parameters:
- name: query
in: query
required: false
description: General search query (searches across address fields)
schema:
type: string
example: "123 Main St"
- name: house_number
in: query
required: false
description: House number to search for
schema:
type: string
example: "123"
- name: street
in: query
required: false
description: Street name to search for
schema:
type: string
example: "Main St"
- name: city
in: query
required: false
description: City name to filter by
schema:
type: string
example: "Columbus"
- name: county
in: query
required: false
description: County name to filter by
schema:
type: string
example: "Franklin"
- name: postcode
in: query
required: false
description: ZIP code to filter by
schema:
type: string
example: "43215"
- name: lat
in: query
required: false
description: Latitude for proximity search (requires lon and radius)
schema:
type: number
format: double
example: 39.9612
- name: lon
in: query
required: false
description: Longitude for proximity search (requires lat and radius)
schema:
type: number
format: double
example: -82.9988
- name: radius
in: query
required: false
description: Search radius in miles for proximity search
schema:
type: number
format: double
minimum: 0.1
maximum: 50
default: 1
example: 5
- name: limit
in: query
required: false
description: Maximum number of results to return
schema:
type: integer
minimum: 1
maximum: 1000
default: 100
example: 50
- name: offset
in: query
required: false
description: Number of results to skip for pagination
schema:
type: integer
minimum: 0
default: 0
example: 0
- name: sort
in: query
required: false
description: Sort order for results
schema:
type: string
enum: [distance, address, city, county]
default: address
example: distance
responses:
'200':
description: Address search completed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AddressSearchResponse'
'400':
description: Invalid search parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/addresses/search:
get:
summary: Full-Text Address Search
description: |
Fast full-text search across complete formatted addresses using the indexed `full_address` column.
**Simple and Fast**: Just search the complete address string as you'd type it:
- `q=7 westerfield drive` → Finds "7 Westerfield Dr, City, OH 12345"
- `q=123 main st columbus` → Finds Main Street addresses in Columbus
- `q=maple street 43215` → Finds Maple Street in ZIP 43215
This endpoint uses PostgreSQL's trigram indexes for blazing-fast partial matches
on the full formatted address. Perfect for autocomplete and quick address lookups.
**Use this when:**
- You want simple, Google-like address search
- You need fast autocomplete suggestions
- You have a partial or complete address string
**Use `/addresses` when:**
- You need to filter by specific fields (county, city, ZIP)
- You want proximity/radius search
- You need pagination for large result sets
operationId: fullTextSearchAddresses
security:
- ApiKeyAuth: []
tags:
- Ohio Addresses
parameters:
- name: q
in: query
required: true
description: Address search query (partial or complete address)
schema:
type: string
minLength: 2
example: "7 westerfield drive"
- name: limit
in: query
required: false
description: Maximum number of results to return (1-500)
schema:
type: integer
minimum: 1
maximum: 500
default: 50
example: 10
responses:
'200':
description: Search completed successfully
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: true
data:
type: array
items:
$ref: '#/components/schemas/OhioAddress'
count:
type: integer
description: Number of addresses returned
example: 5
query:
type: string
description: The search query that was executed
example: "7 westerfield drive"
example:
success: true
data:
- id: 12345
house_number: "7"
street: "Westerfield Dr"
city: "Columbus"
county: "Franklin"
postcode: "43215"
full_address: "7 Westerfield Dr, Columbus, OH 43215"
latitude: 39.9612
longitude: -82.9988
count: 1
query: "7 westerfield drive"
'400':
description: Invalid search parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/addresses/{id}:
get:
summary: Get Address Details
description: |
Retrieve detailed information for a specific Ohio address by its unique ID.
Returns complete address information including coordinates and administrative data.
operationId: getOhioAddress
security:
- ApiKeyAuth: []
tags:
- Ohio Addresses
parameters:
- name: id
in: path
required: true
description: Unique address ID
schema:
type: integer
example: 12345
responses:
'200':
description: Address found successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AddressResponse'
'404':
description: Address not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/counties:
get:
summary: List Ohio Counties
description: |
Retrieve a list of all Ohio counties with basic information and address counts.
Supports filtering by name, address count ranges, and pagination.
Perfect for building county selectors and administrative dashboards.
operationId: getCounties
security:
- ApiKeyAuth: []
tags:
- County Boundaries
parameters:
- name: name
in: query
required: false
description: Filter counties by name (partial match)
schema:
type: string
example: "Franklin"
- name: min_addresses
in: query
required: false
description: Minimum number of addresses per county
schema:
type: integer
minimum: 0
example: 10000
- name: max_addresses
in: query
required: false
description: Maximum number of addresses per county
schema:
type: integer
minimum: 0
example: 500000
- name: limit
in: query
required: false
description: Maximum number of results to return
schema:
type: integer
minimum: 1
maximum: 1000
default: 100
example: 25
- name: offset
in: query
required: false
description: Number of results to skip for pagination
schema:
type: integer
minimum: 0
default: 0
example: 0
responses:
'200':
description: Counties retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/CountyListResponse'
'400':
description: Invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/counties/{name}:
get:
summary: Get County Details
description: |
Retrieve detailed information about a specific Ohio county.
Returns county metadata, statistics, and administrative information.
operationId: getCountyDetail
security:
- ApiKeyAuth: []
tags:
- County Boundaries
parameters:
- name: name
in: path
required: true
description: County name (case-insensitive)
schema:
type: string
example: "Franklin"
responses:
'200':
description: County found successfully
content:
application/json:
schema:
$ref: '#/components/schemas/CountyResponse'
'404':
description: County not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/counties/{name}/boundary:
get:
summary: Get County Boundary
description: |
Retrieve the geographic boundary polygon for a specific Ohio county in GeoJSON format.
Returns GeoJSON FeatureCollection ready for use with mapping libraries like Leaflet, Mapbox, or OpenLayers.
Perfect for visualizing county boundaries on interactive maps.
operationId: getCountyBoundary
security:
- ApiKeyAuth: []
tags:
- County Boundaries
parameters:
- name: name
in: path
required: true
description: County name (case-insensitive)
schema:
type: string
example: "Franklin"
responses:
'200':
description: County boundary retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/GeoJSONFeatureCollection'
example:
type: "FeatureCollection"
features:
- type: "Feature"
properties:
county_name: "Franklin"
source_name: "franklin-addresses-county"
layer: "addresses"
address_count: 852417
stats: {}
geometry:
type: "Polygon"
coordinates: [[]]
'404':
description: County not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/counties/bounds/search:
get:
summary: Find Counties in Bounding Box
description: |
Find all Ohio counties that intersect with a specified geographic bounding box.
Returns counties sorted by address count. Useful for map-based applications
where you need to know which counties are visible in the current viewport.
operationId: getCountiesInBounds
security:
- ApiKeyAuth: []
tags:
- County Boundaries
parameters:
- name: min_lat
in: query
required: true
description: Minimum latitude of bounding box
schema:
type: number
format: double
example: 39.5
- name: min_lon
in: query
required: true
description: Minimum longitude of bounding box
schema:
type: number
format: double
example: -84.5
- name: max_lat
in: query
required: true
description: Maximum latitude of bounding box
schema:
type: number
format: double
example: 40.5
- name: max_lon
in: query
required: true
description: Maximum longitude of bounding box
schema:
type: number
format: double
example: -82.5
responses:
'200':
description: Counties in bounds retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/CountyBoundsResponse'
'400':
description: Invalid bounding box parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/cities:
get:
summary: Search US Cities
description: |
Search for US cities using various filters including name, state, county, population, and location-based queries.
The endpoint supports fuzzy text matching on city names and can filter by:
- City name (partial match)
- State (by ID or name)
- County name
- Minimum population
- Geographic proximity (latitude/longitude with radius)