wahlrechtdeprecated

Scrapes wahlrecht.de for the latest public opinion polls on the german general election (Bundestagswahl).

Usage no npm install needed!

<script type="module">
  import wahlrecht from 'https://cdn.skypack.dev/wahlrecht';
</script>

README

wahlrecht

Scrapes wahlrecht.de for the latest public opinion polls on the german general election (Bundestagswahl).

npm version Build Status Greenkeeper badge dependency status license chat on gitter

Installation

npm install wahlrecht

Usage

The module provides seperate methods for each institute:

  • allensbach()
  • emnid()
  • forsa()
  • politbarometer() - Forschungsgruppe Wahlen
  • gms()
  • dimap() - Infratest Dimap
  • insa()

and a method that combines all polls:

  • all()

Each method returns a promise that resolves in an array of objects like this:

{
    date: '2017-01-27T00:00:00+01:00',
    results: {
        union: 0.36,
        spd: 0.24,
        'grüne': 0.08,
        fdp: 0.06,
        linke: 0.1,
        afd: 0.11,
        sonstige: 0.05
    },
    sampleSize: 1303,
    period: '24.01.–26.01.',
    institute: 'politbarometer'
}

Simple example:

const wahlrecht = require('wahlrecht')

wahlrecht.all().then(console.log)
wahlrecht.dimap().then(console.log)

See also

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.