Who is my Representative?
News API About
Enter your zipcode:
API
If you would like to use this data in your application, I offer an API to retrieve it. In it's current state, this involves calling a PHP script directly with the zip information and XML is returned with the congressperson's info. You can optionally have the data returned in JSON by calling the API using "&output=json".

whoismyrep.php

DESCRIPTION: returns data on a representative(s) by zipcode
INPUT: zip, zip4 (optional), output (optional)
RETURNS: name, state, district, phone, office, website
Example: http://whoismyrepresentative.com/whoismyrep.php?zip=20005

whoismysen.php

DESCRIPTION: returns data on a senator by state
INPUT: state , output (optional)
RETURNS: name, state, party, office, phone, website, webform
EXAMPLE: http://whoismyrepresentative.com/whoismysen.php?state=NE

getall_mems.php

DESCRIPTION: returns data on both a representative(s) and senators by zipcode
INPUT: zip, zip4 (optional), output (optional)
RETURNS: the data described above
EXAMPLE: http://whoismyrepresentative.com/getall_mems.php?zip=31023

getall_reps_byname.php

DESCRIPTION: returns data on all reps by lastname
INPUT: lastname, output (optional)
RETURNS: first, last, party, district, state
EXAMPLE: http://whoismyrepresentative.com/getall_reps_byname.php?lastname=smith

getall_reps_bystate.php

DESCRIPTION: returns data on all reps by state
INPUT: state, output (optional)
RETURNS: first, last, party, district
EXAMPLE: http://whoismyrepresentative.com/getall_reps_bystate.php?state=NV

getall_sens_byname.php

DESCRIPTION: returns data on senators by name
INPUT: lastname, output (optional)
RETURNS: first, last, party, state
EXAMPLE: http://whoismyrepresentative.com/getall_sens_byname.php?lastname=smith

getall_sens_bystate.php

DESCRIPTION: returns data on senators by state
INPUT: state, output (optional)
RETURNS: name, state, party, office, phone, website, webform
EXAMPLE: http://whoismyrepresentative.com/getall_sens_bystate.php?state=ME