> For the complete documentation index, see [llms.txt](https://docs.everipedia.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.everipedia.org/past-oraqles-projects/2020-us-presidential-election/mainnet.md).

# 2020 US Presidential Election - EOS

Note that the EOS race calls contain more than just the presidential results. This smart contract contains presidential, house, senate, and governor race calls.

### Walkthrough

1. Fetching EOS Oracle data is a simple HTTP request. Use `fetch` or your favorite library to make the request

```
    // in JavaScript
    const allWinners = await fetch('https://eos.hyperion.eosrio.io/v2/history/get_actions?limit=1&account=associapress&filter=associapress%3Aelection&sort=desc')
        .then((res) => res.json())
        .then((res) => {
            return res?.actions?.[0]?.act?.data?.data;
        })
        .then((res) => JSON.parse(res));
```

2\. View the raw JSON response here to ensure you're accessing the data you're interested in:<br>

{% embed url="<https://eos.hyperion.eosrio.io/v2/history/get_actions?limit=1&account=associapress&filter=associapress%3Aelection&sort=desc>" %}

![JSON Response from EOS table](/files/-MLEg3kMYJ-P2HkvGfbz)

\
3\. Still having issues?‌

1. ​Ensure you're accessing the exact part of the JSON object you're interested in. If you want to use the `data` field as JSON, you **have to stringify it first** (the code example in #1 above already does this properly)
2. Tweet to [@dawsonbotsford](https://twitter.com/dawsonbotsford) and [@everipedia](https://twitter.com/Everipedia) any engineering questions (or send a DM on Twitter to [@dawsonbotsford](https://twitter.com/dawsonbotsford))


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.everipedia.org/past-oraqles-projects/2020-us-presidential-election/mainnet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
