This API is confusing for multiple reasons.<p>The obvious question is why involve a blockchain at all. I don't think there is a coherent answer to that question.<p>The second is why are we asking people to poll for information instead of broadcasting it to them via something like webhooks? It's much easier to notify people of updates rather than have them constantly ask for updates.
Here is a simple script to grab election results from AP via The Guardian. No API key required. No over-enegineered "ELEX" Python scripts. Just request the JSON and do whatever you want with the numbers.<p>Usage: 1.sh [2-letter state abbrev uppercase]<p>Example: 1.sh PA<p><pre><code> cat > 1.sh
#!/bin/sh
x=$(curl https://interactive.guim.co.uk/2020/11/us-general-election-data/prod/last_updated.json|sed -n '/"time":/{s/{"time":"//;s/"}//;p;}')
curl https://interactive.guim.co.uk/2020/11/us-general-election-data/prod/data-out/$x/president_details.json|sed 's/.*\"'"$1"'\"://;s/\"[A-Z][A-Z]\":.*//;s/,/\
/g;s/"candidates":\[//;'</code></pre>
echo $x<p><pre><code> ^D</code></pre>