congressapi / legislators.allForZip

legislators.allForZip is a shortcut method that returns all legislators that currently represent some portion of a zipcode. Typically this means it will return two senators and one or more representatives. This is the same data that could be retrieved by using districts.getDistrictsFromZip in combination with legislators.get and getList.

This method was added because it seems to be a common pattern to want all of an individuals representation (see also legislators.allForLatLong).

Parameters

The only parameter accepted by legislators.allForZip is the "zip" parameter which should be a five digit zip code.

Return Value

Legislators are returned either in XML or JSON with all of the fields included in a call to legislators.get and getList.

Examples

legislators.allForZip?zip=27511