ElectionsAPI Documentation: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
(not implemented yet; no docs)
 
==predictionpredictions==
The <code>predictionpredictions</code> endpoint willreturns give you predictionsforecasts on the 2024 US presidential race. Only supports presidential races for now but others may be supported in the future.
 
===/v1/predictions/{type}/{source}===
(not implemented yet; no docs)
 
====Parameters====
*<code>name</code> - Name of the forecast
*<code>url</code> - URL of the forecast
*<code>last_updated</code> - When the forecast was last updated.
*<code>votes_needed</code> - Votes needed to win
*<code>before_biden_dropout</code> - Returns if the forecast was done before Joe Biden dropped out of the race.
*<code>map</code> - Specifies the map to use.
*<code>candidates</code> - The list of candidates in the race.
**<code>name</code> - Candidate's name
**<code>incumbent</code> - Specifies whether the candidate is an incumbent.
**<code>party</code> - Candidate's party
**<code>electoral_votes</code> - The number of electoral votes the candidate received in the prediction
**<code>candidate_color</code> - Specifies the candidate's color on the map
**<code>winner</code> - Specifies if the candidate has been declared the winner.
*<code>region_results</code> - Results of the counties/districts/parishes/boroughs/etc.
**<code>region</code> - The region name
***<code>winner</code> - Specifies the name of the candidate who won the region
***<code>fill</code> Specifies the hex color fill to use on a map
 
Example URL: <code>http://computernewb.com/election/api/v1/predictions/presidential/polymarket</code>
 
===/v1/predictions/{type}/{source}/map===
This endpoint can be used to generate a map. It returns a PNG of a filled out electoral map.
Example URL: <code>https://computernewb.com/election/api/v1/predictions/presidential/polymarket/map</code>
 
==amendment==

Navigation menu