# V-Dem Scraper \[$5/1K💰] | Democracy Indices | 1789-2025 Data (`ahmed_jasarevic/v-dem-democracy-indices`) Actor

Download V-Dem v16 democracy indices as country-year rows: electoral, liberal, participatory, deliberative and egalitarian scores for 202 countries from 1789 to 2025. Wide or long output, optional confidence bounds, CSV or Excel export.

- **URL**: https://apify.com/ahmed_jasarevic/v-dem-democracy-indices.md
- **Developed by:** [Ahmed Jasarevic](https://apify.com/ahmed_jasarevic) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.90 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## V-Dem Democracy Indices Scraper – Country-Year Democracy Data, 1789–2025

Extract **V-Dem v16** democracy indices for **202 countries from 1789 to 2025** as clean country-year rows: electoral democracy (`v2x_polyarchy`), liberal democracy (`v2x_libdem`), participatory, deliberative and egalitarian components — plus confidence bounds, standard deviations and any other V-Dem indicator. Filter by country and year, choose wide or long output, export JSON, CSV or Excel. **$5 per 1,000 rows, no API key, no registration on v-dem.net.**

### What Can You Do With V-Dem Data?

- **Democracy index time series** – build a 1789–2025 panel of `v2x_polyarchy` or `v2x_libdem` for every country in one run
- **Political science research datasets** – country-year panels with upper/lower confidence bounds for regression work
- **Regime classification and transitions** – pair `v2x_regime` with year and country to study democratic backsliding and autocratization
- **Governance and risk dashboards** – feed institutional-quality scores into country-risk models, ESG screens or newsroom charts
- **Cross-dataset joins** – merge on ISO3 (`country_text_id`) and `year` with World Bank, V-Dem components or your own panel
- **Teaching and replication** – pull the exact v16 numbers behind a published figure, with the dataset version recorded on every row

### How It Works

![How the V-Dem Democracy Indices Scraper works: from a country list to country-year democracy scores.](https://api.apify.com/v2/key-value-stores/oeuA0kLOyhbRM4fzt/records/how-it-works-v-dem-democracy-indices.webp)

The actor downloads the public V-Dem v16 CSV archive from v-dem.net over plain HTTPS — the 15.6 MB Core file by default, or the 25.6 MB Full + Others release. There is no form, no email gate and no API key: the archive URL is public, so a single streaming request is enough.

That CSV is parsed once, filtered by your country list, year range and variable selection, and reshaped into either wide rows (one per country-year) or long rows (one per country-year-variable). Each row keeps `vdem_version`, and a run summary plus variable metadata are written to the key-value store so you can see exactly which release and which columns produced the output.

### Extract V-Dem Democracy Indices Without The Web Download Form

The official route to V-Dem data is a manual download: open v-dem.net, pick a version, choose Core or Full + Others, accept the licence, download a ZIP and parse a wide CSV whose column names are indicator codes. That is fine once. It is painful when you need a reproducible pull, a scheduled refresh, or a subset for 30 countries.

This actor turns that workflow into an API call: `countries`, `variables`, `startYear`, `endYear`, `dataset`. The output is already filtered and reshaped, and every row states its `vdem_version`, so a dataset built in March and refreshed in September is auditable.

### Country-Year Democracy Panel Data For Research And Risk Models

Wide format is the default: one row per country-year with one column per requested variable — the shape regression packages, spreadsheet pivots and BI tools expect. Long format emits one row per country-year-variable with `variable`, `variable_label`, `value`, `codelow`, `codehigh` and `sd`, which is what you want for faceted charts, tidyverse-style analysis or a normalised database table.

Add `includeConfidenceBounds` to get the Bayesian `_codelow` / `_codehigh` pair for each selected variable, and `includeStandardDeviation` for `_sd`. Setting `includeAllVariables` exports every base indicator in the chosen release, which produces very wide rows on Core and is meant for research exports rather than dashboards.

### Historical Coverage Back To 1789

`startYear` defaults to 1789, the first year of V-Dem's historical series, and `endYear` defaults to 2025, the last year in v16. The `onlyContemporary` flag keeps only rows from the contemporary coding project (`project = 0`), which drops the historical country-history rows that predate contemporary coding — useful when you want a comparable modern panel rather than the deep historical series.

Countries can be given as names (`Sweden`, `United States`), as three-letter V-Dem codes (`SWE`, `USA`, `BRA`), or as historical names that appear in the archive (`Siam`, `Zaire`). Empty `countries` means every country.

### Input – Configure A V-Dem Extract

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `countries` | array | No | `[]` | Country names, ISO3/V-Dem codes or historical names. Empty = all countries |
| `variables` | array | No | five headline indices | Dropdown indices or any V-Dem variable tag; `headline` selects the five main indices |
| `includeAllVariables` | boolean | No | `false` | Export every base indicator in the release (very wide rows) |
| `startYear` | integer | No | `1789` | First year, inclusive |
| `endYear` | integer | No | `2025` | Last year, inclusive |
| `onlyContemporary` | boolean | No | `false` | Keep only contemporary-coding rows (`project = 0`) |
| `includeConfidenceBounds` | boolean | No | `false` | Adds `<variable>_codelow` and `<variable>_codehigh` |
| `includeStandardDeviation` | boolean | No | `false` | Adds `<variable>_sd` |
| `outputFormat` | string | No | `wide` | `wide` = one row per country-year, `long` = one row per country-year-variable |
| `dataset` | string | No | `core` | `core` (15.6 MB) or `full` (Full + Others, 25.6 MB) |
| `maxItems` | integer | No | `0` | Stop after N items; `0` = no limit. In long format each variable counts as one item |

### Output – V-Dem Dataset Fields

Wide format (default dataset view):

| Field | Type | Description |
|---|---|---|
| `country_name` | string | Country name as published in V-Dem |
| `country_text_id` | string | Three-letter V-Dem country code (ISO3-style), the join key |
| `country_id` | integer | Numeric V-Dem country identifier |
| `year` | integer | Observation year |
| `v2x_polyarchy` | number | Electoral democracy index (0–1) |
| `v2x_libdem` | number | Liberal democracy index (0–1) |
| `v2x_partipdem` | number | Participatory democracy index |
| `v2x_delibdem` | number | Deliberative democracy index |
| `v2x_egaldem` | number | Egalitarian democracy index |
| `histname` | string | Historical polity name for the row |
| `vdem_version` | string | Dataset release, e.g. `v16` |

Long format view (`dataset_schema.json` → `long`):

| Field | Type | Description |
|---|---|---|
| `country_name` | string | Country name |
| `country_text_id` | string | Three-letter country code |
| `year` | integer | Observation year |
| `variable` | string | V-Dem variable code |
| `variable_label` | string | Human-readable variable label |
| `value` | number | Point estimate |
| `codelow` | number | Lower confidence bound, when requested |
| `codehigh` | number | Upper confidence bound, when requested |
| `sd` | number | Posterior standard deviation, when requested |
| `vdem_version` | string | Dataset release |

The run also writes a **run summary** and **variable metadata** record to the key-value store, and exposes the dataset through the standard Apify API URL.

### Example Input – Five Countries, Headline Indices, 2000–2025

```json
{
  "countries": ["Sweden", "Brazil", "USA", "India", "Nigeria"],
  "variables": ["headline"],
  "startYear": 2000,
  "endYear": 2025,
  "outputFormat": "wide",
  "dataset": "core",
  "includeConfidenceBounds": true,
  "maxItems": 500
}
```

### Example Output – One Country-Year Row

```json
{
  "country_name": "Sweden",
  "country_text_id": "SWE",
  "country_id": 47,
  "year": 2025,
  "v2x_polyarchy": 0.889,
  "v2x_libdem": 0.853,
  "v2x_partipdem": 0.635,
  "v2x_delibdem": 0.817,
  "v2x_egaldem": 0.802,
  "v2x_polyarchy_codelow": 0.871,
  "v2x_polyarchy_codehigh": 0.904,
  "histname": "Sweden",
  "vdem_version": "v16"
}
```

### Export To JSON, CSV Or Excel And Schedule Yearly Refreshes

Every run writes to the default dataset, downloadable as JSON, CSV, Excel or XML from the run page, and readable through the Apify API or the `apify` JavaScript/Python clients. Rows stream in as the archive is parsed, so a full 202-country pull does not need a long timeout.

V-Dem ships one major release per year, so a **yearly scheduled run** (or a monthly run with `endYear` fixed) is enough to keep a panel current. Set `maxItems` to cap spend: at $0.005 per row, 10,000 country-years costs about $50. In long format remember that each variable counts as a separate item.

### Related Actors

- [World Happiness Report Scraper](https://apify.com/ahmed_jasarevic/world-happiness-report-scraper) – country-year happiness and governance scores that join to V-Dem on country and year
- [CSLB Scraper](https://apify.com/ahmed_jasarevic/cslb-scraper) – another public-record dataset with structured US state-level rows
- [Google Search Scraper](https://apify.com/apify/google-search-scraper) – find the papers, DOI references and country reports that cite a given V-Dem figure
- [Website Content Crawler](https://apify.com/apify/website-content-crawler) – pull V-Dem codebook pages and methodology PDFs into clean text for a research pipeline

### FAQ

#### Why use this actor instead of downloading V-Dem from v-dem.net?

Because the download is manual and the file is wide. v-dem.net gives you a ZIP with every country, every year and hundreds of columns; you still filter, reshape and version it yourself. This actor takes `countries`, `variables` and a year range, returns only those rows, reshapes to wide or long, stamps `vdem_version` on every row and can run on a schedule.

#### Is there a V-Dem API?

V-Dem does not publish a general REST API for the country-year dataset; access is through the website download and the documentation. This actor is the API-shaped alternative: an Apify run endpoint that accepts JSON input and returns a dataset.

#### What are alternatives to V-Dem for democracy data?

Freedom House's *Freedom in the World*, the Economist Intelligence Unit Democracy Index, Polity5 and the World Bank's Worldwide Governance Indicators all measure related concepts. V-Dem is the widest in time coverage (1789–2025) and publishes uncertainty estimates for every point score, which the others generally do not.

#### What is the difference between Core and Full + Others?

Core (15.6 MB) contains the democracy indices and their component indices. Full + Others (25.6 MB) adds all remaining V-Dem indicators plus the external indicators contributed by partner projects. For headline democracy scores, Core is enough.

#### How many rows will a run produce?

Wide format: one row per country-year. With `countries` empty and the default 1789–2025 range across roughly 202 countries, that is tens of thousands of rows — use `maxItems` or a year range to control it. Long format multiplies by the number of selected variables.

#### Do I need a proxy or an API key?

No. The archive is served over plain HTTPS from v-dem.net and needs no key. The actor runs on 256 MB without a browser and without a proxy.

#### Can I use the data commercially?

V-Dem v16 is published under CC BY-SA 4.0. Attribution is required, and derivative datasets must carry the same licence. Check the licence text on v-dem.net for your specific use; this README is not legal advice.

### SEO Keywords

v-dem dataset, v-dem scraper, v-dem api, democracy index data, democracy indices dataset, v-dem v16 download, country-year panel data, democracy scores by country, v2x_polyarchy data, electoral democracy index, liberal democracy index, regime type data, political science dataset, comparative politics data, governance indicators dataset, democratization research data, political data api, country year democracy data, v-dem csv, political risk data, autocratization data, v-dem alternative

### For AI Agents & LLM Apps

Returns country-year rows from the V-Dem v16 archive: identity fields (`country_name`, `country_text_id`, `country_id`, `year`, `histname`, `vdem_version`), the five headline democracy indices by default, plus optional `_codelow` / `_codehigh` / `_sd` columns.

Minimal working input:

```json
{ "countries": ["Sweden"], "startYear": 2020, "endYear": 2025 }
```

Variant — tidy long rows for charting or a normalised table:

```json
{ "countries": ["BRA", "IND"], "variables": ["v2x_polyarchy", "v2x_libdem"], "outputFormat": "long", "includeConfidenceBounds": true }
```

Output fields: `country_name, country_text_id, country_id, year, histname, vdem_version` plus one column per requested variable (wide), or `variable, variable_label, value, codelow, codehigh, sd` (long).

Behaviors an agent should know:

- `countries` empty means **all countries** — always pass it explicitly to avoid a very large run.
- `includeAllVariables: true` overrides `variables` and produces extremely wide rows; do not combine it with `maxItems` assumptions.
- `maxItems: 0` (default) means no limit; in `long` format each variable counts as one item, so a low cap truncates variables, not just years.
- `onlyContemporary: true` drops historical rows; leave it `false` for long time series.
- `dataset` selects the archive (`core` 15.6 MB, `full` 25.6 MB); `full` does not change the output columns unless `includeAllVariables` is set.

Billing: pay-per-event at **$0.005 per dataset row**, plus a small per-GB actor-start event. 1,000 rows ≈ $5.

### Legal & Compliance Disclaimer

This actor is an independent tool. It is not affiliated with, endorsed by, or sponsored by the V-Dem Institute, the University of Gothenburg, or the V-Dem project.

It accesses only the publicly downloadable V-Dem dataset archive — no login, no paywall bypass, no private endpoints. V-Dem data is published under **CC BY-SA 4.0**: attribution to the V-Dem Institute and the dataset version (DOI `10.23696/vdemds26` for v16) is required, and derivative datasets must be shared under the same licence. Users are responsible for complying with the V-Dem terms of use and with their own institutional and funder requirements. This section is a factual disclosure, not legal advice.

# Actor input Schema

## `countries` (type: `array`):

Country names or 3-letter V-Dem codes (for example Sweden, USA, BRA). Historical names such as Siam or Zaire are also accepted. Leave empty to include every country.

## `variables` (type: `array`):

Pick one or more indices from the dropdown, or type any V-Dem variable tag/codebook name. Use "headline" for the five main democracy indices.

## `includeAllVariables` (type: `boolean`):

Export every base indicator in the selected dataset. This produces very wide rows for the Core data and is mainly useful for research exports.

## `startYear` (type: `integer`):

First year to include (inclusive). V-Dem historical series begin in 1789.

## `endYear` (type: `integer`):

Last year to include (inclusive). The v16 release ends in 2025.

## `onlyContemporary` (type: `boolean`):

Keep only rows from V-Dem's contemporary coding project (project = 0). This drops historical country-history rows before contemporary coding begins.

## `includeConfidenceBounds` (type: `boolean`):

Add the Bayesian lower and upper confidence bounds for each selected variable as <variable>\_codelow and <variable>\_codehigh.

## `includeStandardDeviation` (type: `boolean`):

Add the posterior standard deviation for each selected variable as <variable>\_sd.

## `outputFormat` (type: `string`):

Wide keeps one row per country-year with one column per variable. Long emits one row per country-year-variable and is convenient for databases and charting.

## `dataset` (type: `string`):

Core contains the democracy indices and their components. Full + Others contains all V-Dem indicators plus the external indicators.

## `maxItems` (type: `integer`):

Stop after this many dataset items. Set to 0 for no limit. In long format each variable counts as one item.

## Actor input object example

```json
{
  "countries": [
    "Sweden",
    "United States",
    "Brazil"
  ],
  "variables": [
    "v2x_polyarchy",
    "v2x_libdem",
    "v2x_partipdem",
    "v2x_delibdem",
    "v2x_egaldem"
  ],
  "includeAllVariables": false,
  "startYear": 1789,
  "endYear": 2025,
  "onlyContemporary": false,
  "includeConfidenceBounds": false,
  "includeStandardDeviation": false,
  "outputFormat": "wide",
  "dataset": "core",
  "maxItems": 0
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `variables` (type: `string`):

No description

## `citation` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "countries": [
        "Sweden",
        "United States",
        "Brazil"
    ],
    "variables": [
        "v2x_polyarchy",
        "v2x_libdem",
        "v2x_partipdem",
        "v2x_delibdem",
        "v2x_egaldem"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ahmed_jasarevic/v-dem-democracy-indices").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "countries": [
        "Sweden",
        "United States",
        "Brazil",
    ],
    "variables": [
        "v2x_polyarchy",
        "v2x_libdem",
        "v2x_partipdem",
        "v2x_delibdem",
        "v2x_egaldem",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("ahmed_jasarevic/v-dem-democracy-indices").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "countries": [
    "Sweden",
    "United States",
    "Brazil"
  ],
  "variables": [
    "v2x_polyarchy",
    "v2x_libdem",
    "v2x_partipdem",
    "v2x_delibdem",
    "v2x_egaldem"
  ]
}' |
apify call ahmed_jasarevic/v-dem-democracy-indices --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ahmed_jasarevic/v-dem-democracy-indices"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Ak556WTy9LeCNyed3/builds/GR4Y8fNk7Kzp49eLQ/openapi.json
