districts.getZipsFromDistrict
districts.getZipsFromDistrict gets all zips within a given congressional district
Parameters
There are two required parameters for getZipsFromDistrict:- state: 2 letter code for a state
- district: number for a district (0 for At-Large)
Return Value
Zips are returned either in XML or JSON in the format shown below.Errors
Errors are indicated by setting the HTTP status code to 400 and returning a text string describing the error. The following errors may be encountered in districts.getZipsFromDistrict:- Missing Parameter - returned if state or district parameter is not provided
Examples
districts.getZipsFromDistrict.json?state=NY&district=29
{"response":
{"zips": ["14009", "14024", "14029", "14030", "14041", "14042", "14060",
"14065", "14070", "14081", "14101", "14129", "14133", "14138", "14141",
"14168", "14171", "14173", "14414", "14415", "14418", "14423", "14424",
"14425", "14428", "14432", "14437", "14441", "14445", "14450", "14453",
"14456", "14461", "14463", "14466", "14467", "14469", "14471", "14472",
"14475", "14478", "14482", "14485", "14487", "14489", "14502", "14504",
"14506", "14507", "14512", "14513", "14514", "14518", "14522", "14526",
"14527", "14529", "14532", "14534", "14536", "14543", "14544", "14546",
"14547", "14548", "14559", "14560", "14561", "14564", "14572", "14585",
"14586", "14606", "14610", "14618", "14620", "14623", "14624", "14625",
"14706", "14707", "14708", "14709", "14711", "14714", "14715", "14717",
"14719", "14721", "14726", "14727", "14729", "14730", "14731", "14735",
"14737", "14738", "14739", "14741", "14743", "14744", "14745", "14747",
"14748", "14751", "14753", "14754", "14755", "14760", "14766", "14770",
"14772", "14774", "14777", "14778", "14779", "14783", "14786", "14788",
"14801", "14802", "14803", "14804", "14805", "14806", "14807", "14808",
"14809", "14810", "14812", "14813", "14814", "14815", "14816", "14818",
"14819", "14820", "14821", "14822", "14823", "14824", "14825", "14826",
"14827", "14830", "14831", "14836", "14837", "14838", "14839", "14840",
"14841", "14842", "14843", "14844", "14845", "14846", "14855", "14856",
"14857", "14858", "14859", "14861", "14863", "14864", "14865", "14867",
"14869", "14870", "14871", "14872", "14873", "14874", "14876", "14877",
"14878", "14879", "14880", "14884", "14885", "14886", "14887", "14889",
"14891", "14892", "14893", "14894", "14895", "14897", "14898", "14901",
"14902", "14903", "14904", "14905", "14925"]}}