This repository was archived by the owner on Dec 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgeocodio-api.yml
More file actions
783 lines (782 loc) · 21.7 KB
/
geocodio-api.yml
File metadata and controls
783 lines (782 loc) · 21.7 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
openapi: 3.0.1
info:
title: Geocodio
description: |
Geocodio's RESTful API allows you to perform forward and reverse geocoding lookups. We support both batch requests as well as individual lookups.
You can also optionally ask for data appends such as timezone, Congressional districts or similar things of that nature.
termsOfService: https://www.geocod.io/terms-of-use/
contact:
email: hello@geocod.io
version: 1.9.0
externalDocs:
description: Find out more about Geocodio
url: https://www.geocod.io
servers:
- url: https://api.geocod.io/v1.9
description: Standard Geocodio API Endpoint
- url: https://api.enterprise.geocod.io/v1.9
description: Special Geocodio API Endpoint for Enterprise Customers
tags:
- name: geocode
description: Geocode addresses to coordinates
- name: reverse
description: Reverse geocode coordinates to addresses
paths:
/geocode:
get:
tags:
- geocode
summary: Geocode single address
description: |
You can either use the `q` parameter for a full address query or a combination of `street`, `city`, `state`, `postal_code`, and/or `country` for when the address is already stored as separate fields on your end.
operationId: geocodeSingle
parameters:
- name: q
in: query
description: The query (i.e. address) to geocode
schema:
type: string
- name: fields
in: query
description: Comma-separated list of fields to append
schema:
$ref: '#/components/schemas/Fields'
style: form
explode: false
- name: street
in: query
example: 1600 Pennsylvania Ave NW
description: Can be used as an alternative to the `q` parameter
schema:
type: string
- name: street2
in: query
example: Apt 204
description: Can be used as an alternative to the `q` parameter
schema:
type: string
- name: city
in: query
example: Washington
description: Can be used as an alternative to the `q` parameter
schema:
type: string
- name: county
in: query
example: Washington
description: Can be used as an alternative to the `q` parameter
schema:
type: string
- name: state
in: query
example: DC
description: Can be used as an alternative to the `q` parameter
schema:
type: string
- name: postal_code
in: query
example: 20500
description: Can be used as an alternative to the `q` parameter
schema:
type: string
- name: country
in: query
example: US
description: Defaults to USA
schema:
type: string
- name: limit
in: query
example: US
description: Optional parameter. The maximum number of results to return. The default is no limit.
schema:
type: integer
- name: format
in: query
example: simple
description: Optional parameter to change the output format of the JSON response to a different structure
schema:
type: string
enum: [simple]
responses:
200:
description: Successfully geocoded address
content:
application/json:
schema:
$ref: '#/components/schemas/GeocodingResult'
422:
description: A client error prevented the request from executing successfully (e.g. invalid address provided). A JSON object will be returned with an error key containing a full error message
403:
description: Invalid API key, or other reason why access is forbidden.
security:
- geocodioApiKey: []
post:
tags:
- geocode
summary: Geocode batch of addresses
description: Up to 10,000 addresses can be geocoded per batch
operationId: geocodeBatch
parameters:
- name: fields
in: query
description: Comma-separated list of fields to append
schema:
$ref: '#/components/schemas/Fields'
style: form
explode: false
- name: limit
in: query
example: US
description: Optional parameter. The maximum number of results to return. The default is no limit.
schema:
type: integer
requestBody:
description: List of addresses to geocode. Can either be an array or an object with keys of your choice.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/BatchGeocodeArray'
- $ref: '#/components/schemas/BatchGeocodeObject'
required: true
responses:
200:
description: successful operation
content:
application/json:
schema:
type: object
properties:
results:
type: array
items:
type: object
properties:
query:
type: string
response:
$ref: '#/components/schemas/GeocodingResult'
403:
description: Invalid API key, or other reason why access is forbidden.
security:
- geocodioApiKey: []
/reverse:
get:
tags:
- reverse
summary: Reverse geocode single address
operationId: reverseSingle
parameters:
- name: q
in: query
description: The query (i.e. latitude/longitude pair) to reverse geocode
schema:
type: string
example: "38.9002898,-76.9990361"
- name: fields
in: query
description: Comma-separated list of fields to append
schema:
$ref: '#/components/schemas/Fields'
style: form
explode: false
responses:
200:
description: Successfully geocoded coordinate
content:
application/json:
schema:
$ref: '#/components/schemas/ReverseGeocodingResult'
422:
description: A client error prevented the request from executing successfully (e.g. invalid coordinate provided). A JSON object will be returned with an error key containing a full error message
403:
description: Invalid API key, or other reason why access is forbidden.
security:
- geocodioApiKey: []
post:
tags:
- reverse
summary: Reverse geocode batch of coordinates
description: Up to 10,000 coordinates can be reverse geocoded per batch
operationId: reverseBatch
parameters:
- name: fields
in: query
description: Comma-separated list of fields to append
schema:
$ref: '#/components/schemas/Fields'
style: form
explode: false
requestBody:
description: List of coordinates to reverse geocode. Can either be an array or an object with keys of your choice.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/BatchReverseGeocodeArray'
- $ref: '#/components/schemas/BatchReverseGeocodeObject'
required: true
responses:
200:
description: successful operation
content:
application/json:
schema:
type: object
properties:
results:
type: array
items:
type: object
properties:
query:
type: string
response:
$ref: '#/components/schemas/ReverseGeocodingResult'
403:
description: Invalid API key, or other reason why access is forbidden.
security:
- geocodioApiKey: []
components:
schemas:
BatchGeocodeArray:
type: array
items:
type: string
example: "1109 N Highland St, Arlington, VA 22201"
description: "When using a JSON array, results are guaranteed to be returned in the same order as they are requested."
BatchGeocodeObject:
type: object
example:
yourCustomKey: "1109 N Highland St, Arlington, VA 22201"
description: "If a JSON object is posted, you can specify a custom key for each element of your choice. This can be useful to match queries up with your existing data after the request is complete."
BatchReverseGeocodeArray:
type: array
items:
type: string
example: "35.9746000,-77.9658000"
description: "When using a JSON array, results are guaranteed to be returned in the same order as they are requested."
BatchReverseGeocodeObject:
type: object
example:
yourCustomKey: "35.9746000,-77.9658000"
description: "If a JSON object is posted, you can specify a custom key for each element of your choice. This can be useful to match queries up with your existing data after the request is complete."
GeocodingResult:
type: object
properties:
input:
type: object
properties:
address_components:
$ref: '#/components/schemas/AddressComponents'
formatted_address:
type: string
results:
$ref: '#/components/schemas/AddressResult'
ReverseGeocodingResult:
type: object
properties:
results:
$ref: '#/components/schemas/AddressResult'
AddressResult:
type: array
items:
type: object
properties:
address_components:
$ref: '#/components/schemas/AddressComponents'
address_lines:
type: array
items:
type: string
formatted_address:
type: string
location:
type: object
properties:
lat:
type: number
format: float
lng:
type: number
format: float
accuracy:
type: number
format: float
accuracy_type:
type: string
enum:
- rooftop
- point
- range_interpolation
- nearest_rooftop_match
- street_center
- place
- state
source:
type: string
fields:
type: object
properties:
congressional_districts:
$ref: '#/components/schemas/FieldCongressionalDistricts'
state_legislative_districts:
$ref: '#/components/schemas/FieldStateLegislativeDistricts'
school_districts:
$ref: '#/components/schemas/FieldSchoolDistricts'
timezone:
$ref: '#/components/schemas/FieldTimezone'
census:
$ref: '#/components/schemas/FieldCensus'
zip4:
$ref: '#/components/schemas/FieldZip4'
ffiec:
$ref: '#/components/schemas/FieldFFIEC'
FieldCongressionalDistricts:
type: array
items:
type: object
properties:
name:
type: string
district_number:
type: integer
ocd_id:
type: string
congress_number:
type: string
congress_years:
type: string
proportion:
type: number
current_legislators:
$ref: '#/components/schemas/FieldCongressionalDistrictLegislators'
FieldCongressionalDistrictLegislators:
type: array
items:
type: object
properties:
type:
type: string
seniority:
type: string
bio:
type: object
properties:
last_name:
type: string
first_name:
type: string
birthday:
type: string
gender:
type: string
party:
type: string
photo_url:
type: string
photo_attribution:
type: string
contact:
type: object
properties:
url:
type: string
address:
type: string
phone:
type: string
contact_form:
type: string
social:
type: object
properties:
rss_url:
type: string
twitter:
type: string
facebook:
type: string
youtube:
type: string
youtube_id:
type: string
references:
type: object
properties:
bioguide_id:
type: string
thomas_id:
type: string
opensecrets_id:
type: string
lis_id:
type: string
cspan_id:
type: string
govtrack_id:
type: string
votesmart_id:
type: string
ballotpedia_id:
type: string
washington_post_id:
type: string
icpsr_id:
type: string
wikipedia_id:
type: string
source:
type: string
FieldStateLegislativeDistricts:
type: object
properties:
senate:
type: array
items:
$ref: '#/components/schemas/FieldStateLegislativeDistrict'
house:
type: array
items:
$ref: '#/components/schemas/FieldStateLegislativeDistrict'
FieldStateLegislativeDistrict:
type: object
properties:
name:
type: string
district_number:
type: string
ocd_id:
type: string
is_upcoming_state_legislative_district:
type: boolean
proportion:
type: number
current_legislators:
$ref: '#/components/schemas/FieldStateLegislators'
FieldStateLegislators:
type: array
items:
type: object
properties:
type:
type: string
bio:
type: object
properties:
last_name:
type: string
first_name:
type: string
birthday:
type: string
gender:
type: string
party:
type: string
photo_url:
type: string
contact:
type: object
properties:
url:
type: string
address:
type: string
phone:
type: string
email:
type: string
contact_form:
type: string
social:
type: object
properties:
rss_url:
type: string
twitter:
type: string
facebook:
type: string
youtube:
type: string
youtube_id:
type: string
references:
type: object
properties:
votesmart_id:
type: string
ballotpedia_id:
type: string
wikipedia_id:
type: string
openstates_id:
type: string
source:
type: string
FieldSchoolDistricts:
type: object
properties:
elementary:
$ref: '#/components/schemas/FieldSchoolDistrict'
secondary:
$ref: '#/components/schemas/FieldSchoolDistrict'
unified:
$ref: '#/components/schemas/FieldSchoolDistrict'
FieldSchoolDistrict:
type: object
properties:
name:
type: string
lea_code:
type: string
grade_low:
type: string
grade_high:
type: string
FieldTimezone:
type: object
properties:
name:
type: string
utc_offset:
type: number
observes_dst:
type: boolean
abbreviation:
type: string
source:
type: string
FieldCensus:
type: object
properties:
census_year:
type: number
state_fips:
type: string
county_fips:
type: string
place_fips:
type: string
tract_code:
type: string
block_code:
type: string
block_group:
type: string
full_fips:
type: string
metro_micro_statistical_area:
type: object
properties:
name:
type: string
area_code:
type: string
type:
type: string
enum:
- metropolitan
- micropolitan
combined_statistical_area:
type: object
properties:
name:
type: string
area_code:
type: string
metropolitan_division:
type: object
properties:
name:
type: string
area_code:
type: string
source:
type: string
FieldZip4:
type: object
properties:
record_type:
type: object
properties:
code:
type: string
description:
type: string
carrier_route:
type: object
properties:
id:
type: string
description:
type: string
building_or_firm_name:
type: string
plus4:
type: array
items:
type: string
zip9:
type: array
items:
type: string
government_building:
type: boolean
facility_code:
type: object
properties:
code:
type: string
description:
type: string
city_delivery:
type: boolean
valid_delivery_area:
type: boolean
exact_match:
type: boolean
FieldFFIEC:
type: object
properties:
collection_year:
type: number
msa_md_code:
type: string
fips_state_code:
type: string
fips_county_code:
type: string
census_tract:
type: string
principal_city:
type: boolean
small_county:
type: object
properties:
flag:
type: string
description:
type: string
split_tract:
type: object
properties:
flag:
type: string
description:
type: string
demographic_data:
type: object
properties:
flag:
type: string
description:
type: string
urban_rural_flag:
type: object
properties:
flag:
type: string
description:
type: string
msa_md_median_family_income:
type: number
msa_md_median_household_income:
type: number
tract_median_family_income_percentage:
type: number
ffiec_estimated_msa_md_median_family_income:
type: number
income_indicator:
type: string
cra_poverty_criteria:
type: boolean
cra_unemployment_criteria:
type: boolean
cra_distressed_criteria:
type: boolean
cra_remote_rural_low_density_criteria:
type: boolean
previous_year_cra_distressed_criteria:
type: boolean
previous_year_cra_underserved_criterion:
type: boolean
meets_current_previous_criteria:
type: boolean
AddressComponents:
type: object
properties:
number:
type: string
predirectional:
type: string
prefix:
type: string
street:
type: string
suffix:
type: string
postdirectional:
type: string
secondaryunit:
type: string
secondarynumber:
type: string
city:
type: string
county:
type: string
state:
type: string
zip:
type: string
country:
type: string
formatted_street:
type: string
Fields:
type: array
items:
type: string
enum:
- cd
- cd120
- cd119
- cd118
- cd117
- cd116
- cd115
- cd114
- cd113
- stateleg
- school
- timezone
- census
- census2000
- census2010
- census2011
- census2012
- census2013
- census2014
- census2015
- census2016
- census2017
- census2018
- census2019
- census2020
- provriding
- riding
- zip4
- acs-demographics
- acs-economics
- acs-families
- acs-housing
- acs-social
- ffiec
securitySchemes:
geocodioApiKey:
type: apiKey
name: api_key
in: query