ONPE Peru Elections Results Scraper avatar

ONPE Peru Elections Results Scraper

Pricing

from $7.50 / 1,000 results

Go to Apify Store
ONPE Peru Elections Results Scraper

ONPE Peru Elections Results Scraper

Pull official ONPE results from the 2021 Peruvian general election by district, province, department, or national level. Returns candidate, party, votes, percentage, valid_votes, blank_votes, and null_votes. Great for political analysis and academic research on Peru.

Pricing

from $7.50 / 1,000 results

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

ParseForge Banner

πŸ—³οΈ ONPE Peru Elections Results Scraper

πŸš€ Export ONPE Peru 2021 general election results in seconds. District-level vote counts, candidate breakdowns, valid, blank, and null tallies.

πŸ•’ Last updated: 2026-05-29 Β· πŸ“Š 10 fields per record Β· National, Departmental, Provincial, District levels Β· First and second round

The ONPE Peru Elections Results Scraper turns the official resultados.eleccionesgenerales2021.pe JSON reports into a clean, structured dataset. It hits the public ONPE Proceso Electoral endpoints and flattens each candidate's tally into one row per district and party.

Coverage spans every Peruvian department, province, and district reported by ONPE, both presidential rounds, and every registered political organization that appeared on the ballot.

🎯 Target AudienceπŸ’‘ Primary Use Cases
πŸ“Š Political analystsBuild national and regional vote share dashboards
πŸ›οΈ ResearchersStudy turnout, blank vote rates, and null vote patterns
πŸ“° JournalistsVerify district-level outcomes for stories
πŸ€– Data scientistsTrain models on Peruvian electoral data
πŸ—ΊοΈ GIS teamsJoin with shapefiles for choropleth maps
πŸŽ“ StudentsPull primary source data for coursework

πŸ“‹ What the ONPE Peru Elections Scraper does

  • Calls ONPE's public Reportes JSON endpoints for the selected geographic level and round.
  • Flattens each department, province, or district into rows per candidate and party.
  • Surfaces valid, blank, and null vote totals alongside each tally.
  • Casts vote counts and percentages to numbers for clean BI ingestion.
  • Pushes a clean diagnostic record if ONPE returns no results for the requested combo.

πŸ’‘ Why it matters: ONPE's public viewer is a single-page app that hides the underlying JSON behind XHR calls. This actor exposes the raw numbers directly so analysts and journalists can stop scraping screenshots.

🎬 Full Demo

🚧 Coming soon.

βš™οΈ Input

FieldTypeRequiredDescription
levelenumNoNACIONAL, DEPARTAMENTO, PROVINCIA, or DISTRITO. Default DEPARTAMENTO.
roundenumNoP (first round) or S (second round). Default P.
maxItemsintegerNoFree users 10, paid up to 1,000,000.

Example 1 - Department results, first round:

{ "level": "DEPARTAMENTO", "round": "P", "maxItems": 100 }

Example 2 - District-level second round:

{ "level": "DISTRITO", "round": "S", "maxItems": 500 }

⚠️ Good to Know: ONPE publishes the 2021 general election results as the definitive archived dataset. Numbers reflect the final ONPE tally and do not change between runs.

πŸ“Š Output

FieldTypeDescription
πŸ—ΊοΈ districtstringDepartment, province, or district name.
πŸ§‘ candidatestringCandidate full name.
πŸ›οΈ partystringPolitical organization.
πŸ—³οΈ votesnumberVotes obtained.
πŸ“Š percentagenumberPercent of valid votes.
βœ… valid_votesnumberTotal valid votes in the geography.
⬜ blank_votesnumberBlank votes total.
🚫 null_votesnumberNull votes total.
πŸ•’ scrapedAtstringWhen this row was fetched.
❌ errorstringSet if the upstream response was an error.

Sample record:

{
"district": "LIMA",
"candidate": "PEDRO CASTILLO TERRONES",
"party": "PERU LIBRE",
"votes": 1234567,
"percentage": 18.92,
"valid_votes": 6512334,
"blank_votes": 102345,
"null_votes": 87654,
"scrapedAt": "2026-05-29T13:00:00.000Z",
"error": null
}

✨ Why choose this Actor

| πŸ†“ | Works with no API key and no login. | | 🧹 | Flattens ONPE's nested JSON into one row per candidate. | | πŸ”’ | Vote counts and percentages cast to real numbers. | | 🌎 | Covers national, departmental, provincial, and district levels. | | πŸ’Ύ | Push to dataset and export CSV, Excel, JSON, or XML. |

πŸ“ˆ How it compares to alternatives

ApproachSetup timeClean rowsNumeric castingMaintained
Manual download from ONPE site15 min per geography❌❌manual
Browser screenshotshours❌❌manual
This Actor5 sec, no installβœ…βœ…βœ…

πŸš€ How to use

  1. Click Try for free.
  2. Pick level and round.
  3. Click Start. Your dataset is ready within seconds.

πŸ’Ό Business use cases

πŸ“Š Electoral analysis. Build regional vote share dashboards for clients or editorial teams.

πŸ›οΈ Civic research. Quantify blank and null vote rates across departments and provinces.

πŸ“° Newsroom verification. Reporters can cross-check district outcomes in seconds.

πŸ€– Predictive modeling. Use 2021 results as training data for future Peruvian electoral forecasting.

πŸ”Œ Automating ONPE Peru Elections Scraper

  • Make / Zapier: trigger this actor and push results to Airtable or Google Sheets.
  • Cron schedule: native Apify scheduler for periodic refreshes.
  • Webhooks: POST to your endpoint the moment a run finishes.
  • Pipe to BigQuery / Snowflake / Postgres: native Apify integrations.

🌟 Beyond business use cases

πŸŽ“ Education. Teach political science classes with real primary source data.

πŸ§ͺ Personal research. Map your home district's results for fun or curiosity.

🀝 Civic non-profits. Build voter education materials from authoritative numbers.

🧰 Tinkering. Prototype a choropleth visualization using a real-world dataset.

πŸ€– Ask an AI assistant about this scraper

Paste this README into ChatGPT, Claude, or any AI assistant and ask it to map your workflow to the actor's inputs. The schema and field list above contain everything an LLM needs.

❓ Frequently Asked Questions

❓ Do I need an API key? No, ONPE's reports are public.

❓ Which election is covered? The 2021 Peruvian general election, both presidential rounds.

❓ Can I get district-level data? Yes, set level to DISTRITO.

❓ Are vote counts cast to numbers? Yes.

❓ Does the data change? No, ONPE has published final tallies for 2021.

❓ Can I schedule runs? Yes via the Apify scheduler.

❓ Is this scraping or API? Public JSON endpoints from the ONPE viewer.

❓ What format can I download? CSV, Excel, JSON, JSONL, XML, RSS, or HTML.

❓ What if ONPE returns nothing? A single diagnostic record with the error field populated is pushed.

❓ Will the schema change? Stable.

πŸ”Œ Integrate with any app

Apify ships native integrations with Make, Zapier, Slack, Discord, Google Drive, Google Sheets, Gmail, Airbyte, Keboola, Telegram, GitHub, and any REST API or webhook. Trigger runs from a calendar event, a form submission, a cron job, or pipe results straight into BigQuery, Snowflake, or Postgres.

ActorWhat it does
ParseForge Alpha Vantage ScraperPublic market data.
ParseForge OurAirports ScraperGlobal airport database.
ParseForge collection900+ production scrapers.

πŸ’‘ Pro Tip: browse the complete ParseForge collection for 900+ production-grade scrapers across business intelligence, real estate, e-commerce, sports, finance, and public records.


Disclaimer: This actor scrapes only publicly available data. ParseForge is not affiliated with, endorsed by, or sponsored by any of the third-party services referenced. Users are responsible for complying with the target site's terms of service and applicable law. Create a free account w/ $5 credit.