Ostraka is a GraphQL API with three types of queries for district matching.
districtMatch
: coordinates → districtsaddressDistrictMatch
: address → districtszipcodeDistrictMatch
: ZIP code → districtsThe url for the api is https://ostraka-ykmw.onrender.com/api/v1
District matching requires an OAuth 2 Bearer Token. Politech will create and configure a user for you and then supply you with this token. It will authorize you to run the three types of GraphQL queries. You will see results for the district types your user is configured for.
You can pass the token via the Authorization
header. For example, with curl:
curl -X POST <https://ostraka-ykmw.onrender.com/api/v1> --header "Authorization: Bearer [token]" -d "query={[query]}"
All of these functions return a list of districts. Below are the fields of a district object. Data for of these fields can be returned by any of the district matching functions.
districtTypeId
: (Integer) A unique id for the district typedistrictTypeKey
: (string) A key for the district type; for example the key for Congressional District is “cd”.districtTypeLabel
: (string) a more descriptive label for the district typedistrictName
: (string) the name of a district. In some cases this will be a name in others it will be a number. For example districtName for a county would be something like “Santa Cruz” where the districtName for a cd would be “19”.districtCode
: (string) a code for the district. In many cases, this will be a null value, but for counties this will be the fips code and for boundaries drawn by the census, this will be the geoid.