How to Get Congressional District

143 views
Skip to first unread message

M23

unread,
Jun 27, 2023, 1:56:46 PM6/27/23
to Google Civic Information API
How can I get the congressional district for every state? 
I look for the cd: tag under divisions, which returns for Arkansas in the example below. 
However other states, like Delaware in the example below, are not returning a cd: tag or a congressional district value.

Arkansas

"kind": "civicinfo#representativeInfoResponse",

  "divisions": {

    "ocd-division/country:us/state:ar/sldl:76": {

      "name": "Arkansas State House district 76",

      "officeIndices": [

        1

      ]

    },

    "ocd-division/country:us/state:ar/cd:2": {

      "name": "Arkansas's 2nd congressional district",

      "officeIndices": [

        0

      ]

    },

    "ocd-division/country:us/state:ar/place:little_rock": {

      "name": "Little Rock city",

      "officeIndices": [

        2

      ]

    }

  },

 

Delaware

  "kind": "civicinfo#representativeInfoResponse",

  "divisions": {

    "ocd-division/country:us/state:de/sldl:9": {

      "name": "Delaware State House district 9",

      "officeIndices": [

        1

      ]

    },

    "ocd-division/country:us/state:de": {

      "name": "Delaware",

      "officeIndices": [

        0

      ]

    },

    "ocd-division/country:us/state:de/county:new_castle": {

      "name": "New Castle County",

      "officeIndices": [

        2

      ]

    },

    "ocd-division/country:us/state:de/county:new_castle/council_district:12": {

      "name": "New Castle DE County Council District 12",

      "officeIndices": [

        3

      ]

    }

  },

Google Civic Information API

unread,
Jun 30, 2023, 1:07:52 PM6/30/23
to Google Civic Information API
Hi there,

Looks like you are calling queryRepresentativeInfo, but if you just want a list of districts, you could use divisionSearch instead. 


You could also find a list of all US congressional districts in the official repository, at https://github.com/opencivicdata/ocd-division-ids/blob/master/identifiers/country-us/census_autogenerated/us_congressional_districts.csv

Best,
Mimi on behalf of the Google Civic Information API team
Reply all
Reply to author
Forward
0 new messages