ONPE Peru Elections Results Scraper
Pricing
from $7.50 / 1,000 results
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
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share

π³οΈ 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 analysts | Build national and regional vote share dashboards |
| ποΈ Researchers | Study turnout, blank vote rates, and null vote patterns |
| π° Journalists | Verify district-level outcomes for stories |
| π€ Data scientists | Train models on Peruvian electoral data |
| πΊοΈ GIS teams | Join with shapefiles for choropleth maps |
| π Students | Pull 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
| Field | Type | Required | Description |
|---|---|---|---|
level | enum | No | NACIONAL, DEPARTAMENTO, PROVINCIA, or DISTRITO. Default DEPARTAMENTO. |
round | enum | No | P (first round) or S (second round). Default P. |
maxItems | integer | No | Free 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
| Field | Type | Description |
|---|---|---|
πΊοΈ district | string | Department, province, or district name. |
π§ candidate | string | Candidate full name. |
ποΈ party | string | Political organization. |
π³οΈ votes | number | Votes obtained. |
π percentage | number | Percent of valid votes. |
β
valid_votes | number | Total valid votes in the geography. |
β¬ blank_votes | number | Blank votes total. |
π« null_votes | number | Null votes total. |
π scrapedAt | string | When this row was fetched. |
β error | string | Set 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
| Approach | Setup time | Clean rows | Numeric casting | Maintained |
|---|---|---|---|---|
| Manual download from ONPE site | 15 min per geography | β | β | manual |
| Browser screenshots | hours | β | β | manual |
| This Actor | 5 sec, no install | β | β | β |
π How to use
- Click Try for free.
- Pick
levelandround. - 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.
π Recommended Actors
| Actor | What it does |
|---|---|
| ParseForge Alpha Vantage Scraper | Public market data. |
| ParseForge OurAirports Scraper | Global airport database. |
| ParseForge collection | 900+ 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.