538-polls
v0.1.0
Published
Fetch polling data from 538
Downloads
10
Readme
538-polls
This is a small esm library to get polling data from 538. Currently it copies the api structure and only changes types for convenience (e.g. parsing dates from date strings)
Usage
import { fetchPolls } from "538-polls"
let polls = await fetchPolls("senate", 2022, "nevada")
let avg = await fetchPollingAverage("senate", 2022, "nevada")
Poll Types:
| type | cycle | entity | | --------------------------------------------------------------- | ----- | ------------------------ | | approvalfavorability | ❌ | institutionperson | | generic-ballot | ✔ | ❌(always dem vs rep) | | governorhousesenate | ✔ | state | | governor-recall | ❌ | state | | president-generalpresident-primary-dpresident-primary-r | ✔ | state"national" |