Santa Fe County logo

Santa Fe County

Turnout Command Center

V1.2.3
API Reference

Voter Turnout API Documentation

Integration guide for turnout, election, jurisdiction, and party endpoints used by this dashboard, including the party pie chart feed. All examples below are based on your configured API base URL.

Base URL

https://santafe.electionsnm.com/DistrictTurnout

Endpoint Directory

Current public endpoints exposed by this API.

Method Path Description Returns
GET /api/elections/active Gets the active election header for the dashboard. ElectionDTO
GET /api/jurisdictions/types Lists available jurisdiction types. string[]
GET /api/turnout/total County-level turnout totals and percentages. TurnoutTotalsDTO
GET /api/party/totals Party totals by absentee, early voting, and election day for the Party Totals Matrix card. PartyDynamicDTO[]
GET /api/party/votes Party vote totals for the Primary Votes by Party pie chart. Returns party, votes, and color. PartyVotesDTO[]
GET /api/turnout/by-jurisdiction
Query: JurisdictionType, ViewType
Turnout rows by jurisdiction type and view mode. TurnoutDTO[]
GET /api/turnout/chart
Query: JurisdictionType
Raw chart-oriented turnout rows by jurisdiction type. TurnoutRow[]
GET /api/absentee/statuses Status counts for Absentee Requests. AbsenteeStatusCountDTO[]
GET /api/widget/lastupdate Gets the information of the last update to the data. LastUpdateDTO
GET /api/diagnostics/procedures Lists SQL procedures available in the configured DB. string[]

DTO Definitions

Payload contracts used by the API responses and request filters.

ElectionDTO

Response model for /api/elections/active.

Field Type Description
electionId int Unique election identifier.
electionName string Election display name.

TurnoutTotalsDTO

County-wide totals from /api/turnout/total.

Includes the nested TurnoutTotalsPercentagesDTO object.

Field Type Description
totalVotes int Total votes cast.
earlyVotes int Early voting count.
electionDayVotes int Election day voting count.
absenteeVotes int Absentee voting count.
percentages TurnoutTotalsPercentagesDTO Nested turnout percentages.

TurnoutTotalsPercentagesDTO

Nested percentage strings under TurnoutTotalsDTO.percentages.

Field Type Description
total string Total turnout percentage.
early string Early voting percentage.
electionDay string Election day voting percentage.
absentee string Absentee voting percentage.

PartyDynamicDTO

Row model from /api/party/totals.

Used by the Party Totals Matrix card on the dashboard.

Field Type Description
party string Party label (DEM, REP, DTS, OTHER, etc.).
absentee int Absentee total for the party.
earlyVoting int Early voting total for the party.
electionDay int Election day total for the party.

PartyVotesDTO

Row model from /api/party/votes.

Used by the Primary Votes by Party pie chart. Color is returned as a hex value so the client can render the slice and legend directly.

Field Type Description
party string Party label returned by the query.
color string Hex color for the party slice and legend item.
votes int Vote total for that party.

TurnoutDTO

Jurisdiction row model from /api/turnout/by-jurisdiction.

In both modes, absentee/earlyVoting/electionDay are strings by design.

Field Type Description
jurisdictionName string Jurisdiction display name.
registeredVoters int Registered voter count.
absentee string Absentee metric as API string.
earlyVoting string Early voting metric as API string.
electionDay string Election day metric as API string.
totalVoted decimal? Total voted; can be null in percent mode.

AbsenteeStatusCountDTO

Absentee Request counts by Status

Field Type Description
Status string Status Type (ApplicationReceived, BallotMailed, BallotReceived, VotedInPerson, BallotAccepted, BallotRejected)
Count int Number of Absentee Requests for a status.

LastUpdateDTO

Information on data's last update

Field Type Description
LastUpdateDateTime DateTime? DateTime of last update to the data.

TurnoutRow

Raw row shape returned by /api/turnout/chart.

Includes both numeric counts and SQL-computed percent strings.

Field Type Description
jurisdictionType string Jurisdiction type bucket.
jurisdictionName string Jurisdiction display name.
absentee int Absentee count.
absenteePercent string Absentee percent string.
earlyVoting int Early voting count.
earlyVotingPercent string Early voting percent string.
electionDay int Election day count.
electionDayPercent string Election day percent string.
registeredVoters int Registered voter count.
totalVoted int Total voted count.
jurisdictionPercent string Jurisdiction turnout percent string.

TurnoutViewType Enum

Numeric enum values accepted by query model binding.

Name Value Meaning
Count 0 Returns turnout metrics as count strings.
Percent 1 Returns turnout metrics as percent strings.

Primary Integration: Turnout by Jurisdiction

Use this endpoint to populate jurisdiction rows for either count or percent mode.

No Auth Required
Method
GET
Path
/api/turnout/by-jurisdiction
Full URL
https://santafe.electionsnm.com/DistrictTurnout/api/turnout/by-jurisdiction?JurisdictionType=Precinct&ViewType=Count
Query Parameter Type Required Description
JurisdictionType string Yes Jurisdiction group to query (example: Precinct, Commission, etc.).
ViewType enum (Count | Percent) Yes Controls turnout mode. Numeric mapping: Count=0, Percent=1.
Response Field Type Description
jurisdictionName string Display name for the jurisdiction row.
registeredVoters int Registered voters in that jurisdiction.
absentee string Absentee metric value as returned by API.
earlyVoting string Early voting metric value as returned by API.
electionDay string Election day metric value as returned by API.
totalVoted decimal? Total voted. Can be null in percent mode.

Copyable Examples

Use these snippets as a starting point for integrations.

cURL
curl -X GET "https://santafe.electionsnm.com/DistrictTurnout/api/turnout/by-jurisdiction?JurisdictionType=Precinct&ViewType=Count" \
  -H "Accept: application/json"
JavaScript (fetch)
const response = await fetch("https://santafe.electionsnm.com/DistrictTurnout/api/turnout/by-jurisdiction?JurisdictionType=Precinct&ViewType=Count", {
    method: "GET",
    headers: {
    "Accept": "application/json"
    }
});

if (!response.ok) {
    throw new Error(`Request failed: ${response.status}`);
}

const rows = await response.json();
console.log(rows);
C# (HttpClient)
using System.Net.Http.Json;

var http = new HttpClient();
var url = "https://santafe.electionsnm.com/DistrictTurnout/api/turnout/by-jurisdiction?JurisdictionType=Precinct&ViewType=Count";

var turnoutRows = await http.GetFromJsonAsync<List<TurnoutDto>>(url);

public sealed class TurnoutDto
{
    public string JurisdictionName { get; set; } = "";
    public int RegisteredVoters { get; set; }
    public string Absentee { get; set; } = "";
    public string EarlyVoting { get; set; } = "";
    public string ElectionDay { get; set; } = "";
    public decimal? TotalVoted { get; set; }
}
Sample JSON Response
[
    {
        "jurisdictionName": "PRECINCT 001",
        "registeredVoters": 3278,
        "absentee": "104",
        "earlyVoting": "557",
        "electionDay": "689",
        "totalVoted": 1350
    },
    {
        "jurisdictionName": "PRECINCT 002",
        "registeredVoters": 4126,
        "absentee": "3.18%",
        "earlyVoting": "19.45%",
        "electionDay": "21.06%",
        "totalVoted": null
    }
]

Implementation Notes

  • ViewType supports Count and Percent.
  • Absentee, EarlyVoting, and ElectionDay are strings in the response so your client can render exactly what the API returns.
  • TotalVoted may be null when using percent mode.
  • /api/party/votes is the feed for the Primary Votes by Party pie chart.
  • PartyVotesDTO.Color is intentionally returned by the API so the pie slices and legend stay in sync.
  • The diagnostics endpoint (/api/diagnostics/procedures) is intended for internal troubleshooting.