Python code and data from the IEC's API for the 2024 National and Regional Elections.
You need Python 3.8
pip install -r requirements.txt
python get-all-voting-station-results.py
python update-voting-station-reults-from-latest-in.py
python convert-voting-station-results-to-province-csv.py
curl https://api.elections.org.za/token -X POST -d "grant_type=password&username=USERNAME&password=PASSWORD"
export IEC_API_TOKEN=TOKENFROMABOVE
curl "https://api.elections.org.za/api/v1/ElectoralEvent" -H "Authorization: Bearer ${IEC_API_TOKEN}"
curl "https://api.elections.org.za/api/v1/ElectoralEvent?ElectoralEventTypeID=1" -H "Authorization: Bearer ${IEC_API_TOKEN}"
export EID=1334
curl "https://api.elections.org.za/api/v1/VotingStations?ElectoralEventID=${EID}" -H "Authorization: Bearer ${IEC_API_TOKEN}"
curl "https://api.elections.org.za/api/v1/VotingStationDetails?VDNumber=54760125" -H "Authorization: Bearer ${IEC_API_TOKEN}"
curl "https://api.elections.org.za/api/v1/LatestResultsIn?ElectoralEventID=${EID}&NumberOfVDs=1000" -H "Authorization: Bearer ${IEC_API_TOKEN}"
curl "https://api.elections.org.za/api/v1/NPEBallotResults?ElectoralEventID=1335&ProvinceID=3&MunicipalityID=3003&VDNumber=32841266" -H "Authorization: Bearer ${IEC_API_TOKEN}"
curl "https://api.elections.org.za/api/v1/Delimitation?ElectoralEventID=${EID}" -H "Authorization: Bearer ${IEC_API_TOKEN}"