Skip to content

About

Weekly-updated visa requirements dataset by passport (JSON and CSV), parsed from Wikipedia with a Python pipeline. Normalized statuses, safety checks, CC BY-SA 4.0 data.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Visa Requirements Dataset

CI Update Data

A machine-readable dataset of global visa requirements, automatically generated from Wikipedia's "Visa requirements for X citizens" articles.

⚠️ Disclaimer

Visa data is community-sourced from Wikipedia and may be incomplete, outdated or wrong. Always verify entry requirements with the official embassy or government source of the destination before travelling.

Consuming the Data

The dataset is published via GitHub Pages and updated weekly:

Main Endpoints

  • Index: https://riedel-david.github.io/Visa-requirements/index.json

    • Lists all available passports with metadata
    • Compare source_revision to detect data changes (it moves only when the visa data changes, not on every Wikipedia edit)
  • Per-passport files: https://riedel-david.github.io/Visa-requirements/passports/<ISO2>.json

    • e.g., passports/DE.json for German passport holders
    • Contains all visa requirements for that passport
  • All data: https://riedel-david.github.io/Visa-requirements/all.json

    • Single file with all passports (larger download)
    • Minified format
  • Status: https://riedel-david.github.io/Visa-requirements/status.json

    • last_checked_at, last_run_status, passports_stale; tells you whether the data is fresh

Pinning a Specific Version

Data snapshots are tagged as data-YYYY-MM-DD. You can access a specific version via:

https://raw.githubusercontent.com/Riedel-David/Visa-requirements/data-2026-10-30/data/passports/DE.json

all.json is not committed (it is large and changes every run). It is generated on each run and published on GitHub Pages and as an asset of each GitHub Release, so for a pinned version download it from the release of that tag.

See DATA_FORMAT.md for detailed schema documentation.

Data Format

Each passport file contains:

{
  "schema_version": "1.1.0",
  "passport": "DE",
  "source_title": "Visa requirements for German citizens",
  "source_url": "https://en.wikipedia.org/wiki/...",
  "source_revision": "1379323599",
  "source_timestamp": "2026-10-09T12:34:56Z",
  "generated_at": "2026-10-30T06:00:00Z",
  "license": "CC BY-SA 4.0",
  "attribution": "Derived from Wikipedia... (see LICENSE-DATA.md)",
  "records": [...]
}

Record Structure

Each record represents the visa requirement for one destination. area: null means the whole country; records with an area are sub-national.

{
  "passport": "DE",
  "destination": "JP",
  "destination_name": "Japan",
  "area": null,
  "status": "visa_free",
  "alternative_statuses": [],
  "allowed_stay_days": 90,
  "allowed_stay_raw": "90 days",
  "notes": "Additional details...",
  "is_territory_or_restricted": false,
  "source_url": "https://en.wikipedia.org/wiki/...",
  "source_revision": "1379323599"
}

CSV Exports

Three CSV files are generated into data/ at the end of every run. They are not committed to git: download them from the GitHub Release (or GitHub Pages, next to all.json):

File Layout
passport-index-tidy-iso2.csv Passport,Destination,Requirement, one row per passport and destination, ISO-2 codes
passport-index-tidy-iso3.csv same, ISO-3 codes
passport-index-matrix-iso2.csv first column Passport, one column per destination, cell = requirement
  • Only the whole-country record (area is null) is used. Requirement is our status value as is: visa_free, visa_on_arrival, eta, evisa, visa_required, permit_required, admission_refused, special, travel_ban. No stay days, no notes.
  • Missing passport/destination pairs have no row in the tidy files and an empty cell in the matrix.
  • Rows and columns are sorted by ISO-2 code, so identical input gives byte-identical files.
  • ISO-3 codes come from the static table src/visa_pipeline/iso3.json. Codes without an ISO-3 (the X-codes) are kept as is, except Kosovo: XK becomes XKX (user-assigned). XN, XS, XA, XO, XT and XW stay two-letter in the ISO-3 file.

Status Mapping

The pipeline normalizes Wikipedia's visa status descriptions into these categories:

Status Meaning
visa_free No visa required, including freedom of movement
visa_on_arrival Visa issued at the port of entry
eta Electronic Travel Authorization required
evisa Electronic visa (eVisa) required
visa_required Traditional visa required (must apply in advance)
permit_required Special permit required (e.g., for restricted areas)
admission_refused Entry not permitted
special Unmapped or special case (see notes field)
travel_ban The traveller's own government forbids travel (allowed_stay_days is null)

Combined Statuses

When Wikipedia lists multiple options (e.g., "eVisa / Visa on arrival"):

  • status contains the least restrictive option
  • alternative_statuses lists the other options in order
  • Exception: a travel_ban part always wins; the destination's own status goes to alternative_statuses

Overrides and X-Codes

Destination Aliases

The pipeline uses src/visa_pipeline/overrides/destinations.json to:

  • Map destination names to ISO 3166-1 alpha-2 codes
  • Handle territories and disputed regions
  • Assign user-defined X-codes for non-ISO destinations:
    • XK - Kosovo
    • XN - Northern Cyprus
    • XS - Somaliland
    • XA - Abkhazia
    • XO - South Ossetia
    • XT - Transnistria
    • XW - Sahrawi Arab Democratic Republic (Western Sahara itself is EH)

See the overrides file for the complete list of X-codes.

Passport Mapping

src/visa_pipeline/overrides/passports.json maps Wikipedia article titles to passport ISO codes.

Safety Mechanisms

The pipeline includes safety checks to prevent publishing bad data:

  • Status change threshold: Max 15 status changes per passport
  • Record drop threshold: Max 10% drop in record count
  • Cooling-off: A page whose latest Wikipedia revision is under 24 hours old is deferred: the old data stays and the page is picked up on a later run once the revision has aged (reverts of vandalism are usually quick). Deferred passports are listed in summary.json under deferred; pages never parsed before are not deferred, and --force does not bypass this
  • Repeated blocks: A passport that is blocked by the thresholds and has been stale (any reason) for 3+ runs in a row makes the run exit non-zero. This shows up as a failed workflow run (notification), not as an issue
  • Zero-row detection: A passport that parses to zero rows when it had data before counts as a failure (the run exits non-zero)

When a threshold is exceeded:

  • The old data is kept (not overwritten)
  • A GitHub issue is opened automatically
  • The workflow still processes the other passports (a zero-row failure also turns the run red)

Override with CLI flags:

.venv/bin/python -m visa_pipeline run --force  # Reparse everything and bypass the thresholds (zero rows still fail)
.venv/bin/python -m visa_pipeline run --max-status-changes 20 --max-record-drop-pct 15

How It Works

  1. Discovery: Finds "Visa requirements for X citizens" articles from Wikipedia's category system
  2. Revision check: Compares article revisions against stored state to skip unchanged pages
  3. Parsing: Extracts visa requirements from wikitext tables using mwparserfromhell
  4. Status mapping: Normalizes visa status text to the enum (unmapped statuses → special + report)
  5. Validation: Checks data quality with JSON Schema and safety thresholds
  6. Publishing: Generates the published files in data/ (per-passport JSON, index.json, status.json; all.json and the CSV exports are generated there too but not committed) and the run artifacts in out/ (report.md, summary.json, changelog)

The pipeline:

  • Uses only the Wikipedia MediaWiki API (no scraping)
  • Follows API politeness guidelines (User-Agent, serial requests, maxlag, Retry-After)
  • Resolves transcluded notes by fetching Template:Transcluded sections for the visa articles
  • Handles complex table structures (colspan/rowspan, data-sort-value attributes)

Running Locally

Setup

python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"

Run the Pipeline

# Process all passports
.venv/bin/python -m visa_pipeline run --data data --state state --out out

# Process specific passports only
.venv/bin/python -m visa_pipeline run --only DE,US,FR

# Force update (ignore revision checks)
.venv/bin/python -m visa_pipeline run --force

# Re-run page discovery / change the minimum seconds between API requests
.venv/bin/python -m visa_pipeline run --refresh-pages
.venv/bin/python -m visa_pipeline run --min-interval 2.0

Run Tests

.venv/bin/pytest -q

Lint

.venv/bin/python -m pyflakes src tests

Automated Updates

The dataset is updated automatically via GitHub Actions:

  • Schedule: Every Monday at 04:17 UTC
  • Manual trigger: Via workflow_dispatch (supports --force and --only options)
  • On data changes: Data and state are committed to main with a data-YYYY-MM-DD tag and a release
  • Only status.json moved: If just data/status.json / state/stale.json changed (last_checked_at changes every run), a "Refresh status.json (no data changes)" commit goes to main, with no tag or release. A full run therefore commits every week; only --only runs can end with no commit
  • Releases: Each data update also publishes a GitHub Release for the tag, with the changelog as release notes and all.json plus the CSV files attached
  • On issues: An issue is opened/updated only when passports are blocked by the safety thresholds or fail to parse in that run (the repeated-blocks exit code alone opens no issue) (unmapped statuses appear in the run report, not as issues)
  • Deployment: Published to GitHub Pages automatically

Why Commit Data to Main?

Unlike some datasets that store only the generation pipeline, this repo commits the data to main because:

  • Versioned history: Git tracks exactly when and how visa rules changed
  • Diffable: Changes are visible in commit diffs
  • Pinnable: Consumers can pin to specific data tags
  • Reliable: The committed data is the source of truth (no risk of ephemeral artifact loss)

License and Attribution

Code License

The source code (pipeline, scripts, tests) is licensed under the MIT License.

Data License

The visa data in data/ is derived from Wikipedia and licensed under CC BY-SA 4.0.

See LICENSE-DATA.md for full attribution requirements.

Summary for app developers:

  • Credit "Wikipedia contributors"
  • Link to the source article (provided in each passport file)
  • Link to CC BY-SA 4.0 license
  • State that the data was transformed/normalized
  • Display attribution and disclaimer in your app

Contributing

See CONTRIBUTING.md for guidelines.

Important: Data corrections should be made on Wikipedia first, as this repository mirrors Wikipedia content. Only report parsing bugs or systematic issues here.

Status

The pipeline runs weekly via GitHub Actions and updates the data automatically. This is a hobby project: there are no guarantees about maintenance or response times.

Related Resources

About

Weekly-updated visa requirements dataset by passport (JSON and CSV), parsed from Wikipedia with a Python pipeline. Normalized statuses, safety checks, CC BY-SA 4.0 data.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages