{"info":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","description":"<html><head></head><body><p><a href=\"https://developer.ap.org/ap-elections-api/\">https://developer.ap.org/ap-elections-api/</a></p>\n<p>Integrate your election systems with AP Elections API. Your election results delivery application (for example, a results loader that powers your election websites) retrieves election race information from AP Elections API.</p>\n<ol>\n<li>Request election race information, including vote updates and race calls.</li>\n</ol>\n<p>During the election, your application polls the API at regular intervals to retrieve election race information and updates in the races of interest; for example, all races in your state or Top-of-the-Ticket races in all states. Election race information includes:</p>\n<p>Reference information about each race and each candidate\nVote counts and if applicable, delegate counts\nRace calls (races that have been called are the races where a winner has been declared and the races that are advancing to a runoff)\n2. Request election reports.</p>\n<p>Throughout the election, your application polls the API at regular intervals to retrieve election reports; for example, delegate reports for presidential primaries.</p>\n<p>Getting Started - Query Explorer\nAP Elections API Query Explorer, an interactive tool for creating API requests, helps you get familiar with the API parameters and allows you to view available elections data. Please note that available data may change daily.</p>\n<p>An API key is required for accessing the Query Explorer and making API calls:\n<a href=\"https://api.ap.org/v2/elections/xplor?apiKey=%7BapiKey%7D\">https://api.ap.org/v2/elections/xplor?apiKey={apiKey}</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"12890183","collectionId":"bd3b121c-361e-4953-bf84-288b04b0531d","publishedId":"TVKHVG7R","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-09-27T23:54:37.000Z"},"item":[{"name":"Examples","item":[{"name":"Example: Filtering by Race IDs","id":"51691860-8480-4f7c-a205-601d159fa881","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2012-04-24?statePostal=PA&raceID=39290,39593&format=json","description":"<p>Election data in the JSON format for the specified race IDs in Pennsylvania from the 4‑24-2012 election.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2012-04-24"],"host":["api","ap","org"],"query":[{"key":"statePostal","value":"PA"},{"key":"raceID","value":"39290,39593"},{"key":"format","value":"json"}],"variable":[]}},"response":[],"_postman_id":"51691860-8480-4f7c-a205-601d159fa881"},{"name":"Example 2","id":"a63354b7-43b6-43f9-85be-8e436ba0ff52","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2012-04-24?statePostal=PA&officeID=S,H&raceTypeID=D,R","description":"<p>4/24/12 election data for all Democrat and Republican US Senate and US House primary races in Pennsylvania.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2012-04-24"],"host":["api","ap","org"],"query":[{"key":"statePostal","value":"PA"},{"key":"officeID","value":"S,H"},{"key":"raceTypeID","value":"D,R"}],"variable":[]}},"response":[],"_postman_id":"a63354b7-43b6-43f9-85be-8e436ba0ff52"},{"name":"Example 3","id":"5cffec24-ccb9-4478-b6b6-6ef33dfd5db2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2012-04-24?statePostal=NY,PA&officeID=P&raceTypeID=R","description":"<p>4/24/12 election data for Republican presidential primary races in New York and Pennsylvania.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2012-04-24"],"host":["api","ap","org"],"query":[{"key":"statePostal","value":"NY,PA"},{"key":"officeID","value":"P"},{"key":"raceTypeID","value":"R"}],"variable":[]}},"response":[],"_postman_id":"5cffec24-ccb9-4478-b6b6-6ef33dfd5db2"},{"name":"Example 4","id":"870547ba-718c-4a1f-bc53-8d6239021c8f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2012-04-24?officeID=H&winner=X","description":"<p>4/24/12 election data for all US House races where a winner has been declared.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2012-04-24"],"host":["api","ap","org"],"query":[{"key":"officeID","value":"H"},{"key":"winner","value":"X"}],"variable":[]}},"response":[],"_postman_id":"870547ba-718c-4a1f-bc53-8d6239021c8f"},{"name":"Example 5","id":"017df540-003f-4284-be34-5e247e4cd1b9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2014-08-26?statePostal=VT&officeID=H,G&party=GOP","description":"<p>8/26/14 election data for Republican primary races for U.S. House and Governor in Vermont.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2014-08-26"],"host":["api","ap","org"],"query":[{"key":"statePostal","value":"VT"},{"key":"officeID","value":"H,G"},{"key":"party","value":"GOP"}],"variable":[]}},"response":[],"_postman_id":"017df540-003f-4284-be34-5e247e4cd1b9"},{"name":"Example 6","id":"946a93e7-c8ca-42c7-8bf9-fd0bcde9f55a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2012-04-24?statePostal=PA&officeID=H&raceTypeID=D&format=json","description":"<p>4/24/12 election data in the JSON format for Democrat US House primary races in Pennsylvania.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2012-04-24"],"host":["api","ap","org"],"query":[{"key":"statePostal","value":"PA"},{"key":"officeID","value":"H"},{"key":"raceTypeID","value":"D"},{"key":"format","value":"json"}],"variable":[]}},"response":[],"_postman_id":"946a93e7-c8ca-42c7-8bf9-fd0bcde9f55a"},{"name":"Example 7","id":"7cd520ea-0425-44c5-9875-3613237d830c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2012-11-06?national=true&statepostal=WA","description":"<p>The GE 2012 data showing all national races for WA - President, Governor, U.S. Senate, U.S. House and two ballot initiatives that were deemed by the AP to be of national interest.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2012-11-06"],"host":["api","ap","org"],"query":[{"key":"national","value":"true"},{"key":"statepostal","value":"WA"}],"variable":[]}},"response":[],"_postman_id":"7cd520ea-0425-44c5-9875-3613237d830c"}],"id":"e60c7416-b30f-440d-a35b-28330cfe3917","_postman_id":"e60c7416-b30f-440d-a35b-28330cfe3917","description":"","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}}},{"name":"Elections Request","id":"460ffe3c-3fa0-4a45-86d6-384fc24baf10","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2020-11-03?format=json","description":"<p><a href=\"https://aphelp.ap.org/Content/SupportDocs/Elections/API/#t=Elections_Request.htm\">https://aphelp.ap.org/Content/SupportDocs/Elections/API/#t=Elections_Request.htm</a></p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2020-11-03"],"host":["api","ap","org"],"query":[{"disabled":true,"description":{"content":"<p>Single-character race type ID. Multiple values must be separated by commas. Possible values are: D (Dem Primary), R (GOP Primary), G (General), E (Dem Caucus), S (GOP Caucus), X (Open Primary or special use cases).</p>\n","type":"text/plain"},"key":"raceTypeID","value":""},{"disabled":true,"description":{"content":"<p>Single-character Office Type ID; for example: P (President), S (U.S. Senate), H (U.S. House) and G (Governor). Multiple characters must be separated by commas. For a list of possible values, see Office ID Examples.</p>\n","type":"text/plain"},"key":"officeID","value":""},{"disabled":true,"description":{"content":"<p>Two-character state postal code. The value of “US” may be used during the general election in a presidential year to receive presidential popular votes and electoral counts at the U.S. national rolled-up summary level. Multiple values must be separated by commas. (Note: When used in conjunction with the raceID parameter, this parameter is required, and multiple values are not allowed.)</p>\n","type":"text/plain"},"key":"statePostal","value":"US"},{"disabled":true,"description":{"content":"<p>Determines the granularity of the returned races. Valid options are:</p>\n<p>state (this is the default). Returns the races for each of the specified states, without the details for each of the reporting units. For the general election in a presidential year, also returns presidential popular and electoral votes at the state and U.S. national rolled-up summary levels.</p>\n<p>   Notes: Reporting units are the units at which AP is reporting the results: cities and towns for the New England states and counties for the other states.</p>\n<p>In Alaska (AK), AP tabulates votes only at the statewide level.</p>\n<p>RU. Returns the races for both the specified states and each of the reporting units within each state.</p>\n<p>Note:FIPS codes at the county level are returned for each reporting unit (see <a href=\"https://www.census.gov/library/reference/code-lists/ansi/ansi-codes-for-states.html\">https://www.census.gov/library/reference/code-lists/ansi/ansi-codes-for-states.html</a>).</p>\n<p>FIPScode. Returns the races for both the specified states and each of the FIPS codes within each state.</p>\n<p>   Note: This option is recommended for receiving results aggregated to the county level in the New England states. For more information about FIPS codes, see <a href=\"https://www.census.gov/library/reference/code-lists/ansi/ansi-codes-for-states.html\">https://www.census.gov/library/reference/code-lists/ansi/ansi-codes-for-states.html</a>.</p>\n<p>district. Returns one of the following:</p>\n<p>For the presidential primaries, returns the races (including vote and delegate counts) for both the specified states and each of the delegate districts within each state.</p>\n<p>For the general election in a presidential year, returns presidential results and electoral counts by district (currently, only for Maine and Nebraska).</p>\n","type":"text/plain"},"key":"level","value":""},{"disabled":true,"description":{"content":"<p>Filters races based on the election result. Possible values are:</p>\n<ul>\n<li><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>X (returns only races where a winner has been declared)\n</code></pre></li>\n<li><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>R (returns only races which are advancing to a runoff)\n</code></pre></li>\n<li><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>U (returns only races where a winner has not yet been declared)\n</code></pre></li>\n<li><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>A (all races, this is the default)\n</code></pre></li>\n</ul>\n<p>(Multiple values are not allowed.</p>\n<p>The winner=X option is useful if you are requesting only the details of called races (where a winner has been declared) to update a feed or ticker.)</p>\n","type":"text/plain"},"key":"winner","value":""},{"disabled":true,"description":{"content":"<p>Indicates whether to return live, test or certified elections data. Possible values are l (live data; this is the default), t (test data) and c (certified results).</p>\n<p>This parameter cannot be used in conjunction with the test parameter.</p>\n<p>During testing, make sure to add the resultsType=t parameter to the request URL to receive test data, including candidates, races, RUs and votes. If neither resultsType=t nor test=true is specified during testing, only the race and candidate initialization data is returned (not including RUs or votes).</p>\n<p>On election day/LIVE (midnight), remove resultsType=t or test=true from your request URL to receive candidates, races, RUs and votes. Using resultsType=t or test=true on election day/post-election day returns the race and candidate initialization data only.</p>\n","type":"text/plain"},"key":"resultsType","value":""},{"disabled":true,"description":{"content":"<p>AP-assigned race ID. Since race IDs are guaranteed to be unique only within a state, you must use this parameter in conjunction with the statePostal parameter. Multiple values must be for the same state and must be separated by commas.</p>\n","type":"text/plain"},"key":"raceID","value":""},{"disabled":true,"description":{"content":"<p>The district or ballot initiative number. This parameter does not typically apply to statewide races; for example, Governor races.</p>\n","type":"text/plain"},"key":"seatNum","value":""},{"disabled":true,"description":{"content":"<p>The district or ballot initiative name. This parameter does not typically apply to statewide races; for example, Governor races.</p>\n","type":"text/plain"},"key":"seatName","value":""},{"disabled":true,"description":{"content":"<p>Filters races based on whether they are contested or not. Valid values are:</p>\n<p>false (returns only contested races)</p>\n<p>true (returns only uncontested races)</p>\n<p>all (returns both contested and uncontested races; this is the default)</p>\n<p>(All the uncontested races are called at the same time, at poll close. If a state has two time zones, the uncontested races are called after the second poll close.)</p>\n","type":"text/plain"},"key":"uncontested","value":""},{"disabled":true,"description":{"content":"<p>Party abbreviation. Multiple values must be separated by commas. For a list of possible values, see Party Value Examples. (This parameter is not applicable to general election races. It is applicable to closed primaries where there is more than one race for the same office; for example, Dem Governor race and GOP Governor race.)</p>\n","type":"text/plain"},"key":"party","value":""},{"disabled":true,"description":{"content":"<p>Filters races based on whether they are national or not. National races are President, U.S. Senate, U.S. House and Governor for primaries and the general election; and for the general election, ballot issues deemed by the AP to be of national interest. Valid values are:</p>\n<p>true (returns only national races)</p>\n<p>false (returns only state and local races)</p>\n<p>all (returns national, state and local races; this is the default)</p>\n","type":"text/plain"},"key":"national","value":"true"},{"disabled":true,"description":{"content":"<p>Returns full or brief candidate information. Valid values are:</p>\n<p>full (returns all available candidate information listed under 'Candidate').</p>\n<p>brief (returns only the candidate ID, vote/delegate/electoral counts and the winner indicator; this option is useful if you are maintaining a database of candidate information and are requesting vote/delegate/electoral count updates and race calls).</p>\n<p>   Note: If a candidate's reference information has been updated, and you are using the next request link to get updates, the response will include the candidate information update indicator (InfoUpdated=\"1\" in XML and \"infoUpdated\"=\"true\" in JSON). If you requested brief candidate information, the full candidate information will be returned for the updated candidate.</p>\n","type":"text/plain"},"key":"candidateInfo","value":""},{"disabled":true,"description":{"content":"<p>Indicates whether to return the A-report votes. Valid values are:</p>\n<p>true (includes the A-report vote count for each candidate, if available, in the \"AVotes\" attribute in XML or the \"avotes\" property in JSON).</p>\n<p>false (returns unmodified results; this is the default).</p>\n","type":"text/plain"},"key":"avotes","value":""},{"disabled":true,"description":{"content":"<p>Overrides results with zeros; omits the winner indicator. Valid values are:</p>\n<p>true (sets the vote, delegate, electoral and reporting precinct counts to zero; does not return the winner indicator)</p>\n<p>false (returns unmodified results; this is the default)</p>\n<p>   Notes: The setZeroCounts and omitResults parameters are mutually exclusive.</p>\n<p>You can use setZeroCounts=true to initialize your database before the start of the election.</p>\n","type":"text/plain"},"key":"setZeroCounts","value":""},{"disabled":true,"description":{"content":"<p>Returns only the reference information about the races and candidates without election results, such as vote/delegate/electoral counts, the winner indicator and reporting units.</p>\n<p>true (returns reference information without election results)</p>\n<p>false (returns unmodified results; this is the default)</p>\n<p>   Note: The omitResults and setZeroCounts parameters are mutually exclusive.</p>\n","type":"text/plain"},"key":"omitResults","value":""},{"description":{"content":"<p>The response format (xml or json). The format parameter value takes precedence over the Accept header value when both are specified. If no format is specified as the format parameter value or in the Accept header, XML is returned.</p>\n","type":"text/plain"},"key":"format","value":"json"}],"variable":[]}},"response":[],"_postman_id":"460ffe3c-3fa0-4a45-86d6-384fc24baf10"},{"name":"List Races","id":"c3fe0c29-b8f0-4c17-991c-ce99568d791b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/elections/2020-11-03?format=json","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","elections","2020-11-03"],"host":["api","ap","org"],"query":[{"key":"format","value":"json"}],"variable":[]}},"response":[],"_postman_id":"c3fe0c29-b8f0-4c17-991c-ce99568d791b"},{"name":"Election Report Data List","id":"654f8c78-3ebe-4779-9659-34bba916560e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/reports?format=json","description":"<p>Any report available in XML is also available in JSON, with the XML version of the report returned by default when you follow the direct link to the report from the report list. For brevity, report examples in the online documentation are provided in XML. JSON property names match the names of the XML elements.</p>\n<p>Topics</p>\n<p>National Presidential Delegate Reports</p>\n<p>Presidential Vote and Electoral Count Reports</p>\n<p>National Party Balance of Power/Trends Reports</p>\n<p>Estimated Expected Vote Percentage (EEVP) Report</p>\n<p>Election Calendar Report (Beta)</p>\n<p>Election Candidate Reports (Beta)</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","reports"],"host":["api","ap","org"],"query":[{"key":"format","value":"json"}],"variable":[]}},"response":[],"_postman_id":"654f8c78-3ebe-4779-9659-34bba916560e"},{"name":"Election Report","id":"65e69cd1-8e1f-45ac-a5df-a665d9ea4d18","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.ap.org/v2/reports/{{Report ID}}?format=json","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]},"isInherited":true,"source":{"_postman_id":"bd3b121c-361e-4953-bf84-288b04b0531d","id":"bd3b121c-361e-4953-bf84-288b04b0531d","name":"AP Elections","type":"collection"}},"urlObject":{"protocol":"https","path":["v2","reports","{{Report ID}}"],"host":["api","ap","org"],"query":[{"key":"format","value":"json"}],"variable":[]}},"response":[],"_postman_id":"65e69cd1-8e1f-45ac-a5df-a665d9ea4d18"}],"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"apikey"},{"key":"value","value":"{{AP National Key}}"}]}},"event":[{"listen":"prerequest","script":{"id":"80d3360f-56f4-4930-9e53-1ca91669f1ac","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"1e6440b1-28b0-4f66-b5a1-a3ca9764131f","type":"text/javascript","exec":[""]}}],"variable":[{"id":"5db2bb2b-ca7f-45bc-8e07-f73c12d05a31","key":"Date","value":"2020-11-03"},{"id":"3a5c4603-f867-4d27-b247-257c72c32af8","key":"AP API Key","value":"{{AP National Key}}"},{"id":"04d3b222-4481-45cc-ac3b-53b95116ae85","key":"version","value":"v2"}]}