Frequently Asked Questions (FAQ)
February 12, 2026 · View on GitHub
← Back to README | Examples | Test Protocol | Changelog
This FAQ is compiled from GitHub Issues and common user questions.
Table of Contents
- Installation & Setup
- Data Download Issues
- Country & Region Selection
- Indicator Selection
- Data Formats & Options
- Metadata & Updates
- Error Messages
Installation & Setup
Q: What is the minimum Stata version required?
wbopendata requires Stata 12 or later.
Q: How do I install wbopendata?
From SSC (Recommended):
ssc install wbopendata, replace
From GitHub (Development Version):
net install wbopendata, from("https://raw.githubusercontent.com/jpazvd/wbopendata/main/src/") replace
Q: I get "_countrymetadata command is unrecognized" error
This usually means you have an incomplete installation. Reinstall with:
ssc install wbopendata, replace all
Make sure all auxiliary files are installed. See Issue #4.
Data Download Issues
Q: I get "Failed to access data" or connection errors
Possible causes:
- Network issues: Check your internet connection
- Firewall/Proxy: Some institutional networks block API access
- World Bank API downtime: Check World Bank API status
Solutions:
* Try with a simple indicator first
wbopendata, indicator(SP.POP.TOTL) clear
* If behind proxy, configure Stata's proxy settings
set httpproxy on
set httpproxyhost "your.proxy.host"
set httpproxyport 8080
See Issue #37.
Q: How do I specify a particular version of the WDI dataset?
The World Bank API does not support version-specific queries. The API always returns the latest available data. For reproducibility:
- Document the download date in your code
- Save a local copy of the downloaded data
- Use the World Bank Databank for archived versions
See Issue #49.
Country & Region Selection
Q: How do I download data for specific countries only?
Use 3-letter ISO country codes separated by semicolons:
* Single country
wbopendata, indicator(NY.GDP.MKTP.CD) country(USA) clear
* Multiple countries
wbopendata, indicator(NY.GDP.MKTP.CD) country(USA;BRA;CHN;IND) clear
Q: How do I filter out aggregates and get only individual countries?
After download, filter using the region variable:
wbopendata, indicator(SP.POP.TOTL) clear long
* Keep only individual countries (exclude aggregates)
drop if region == ""
* OR
keep if regionname != "Aggregates"
See Issue #54.
Q: AFE (Africa Eastern) and AFW (Africa Western) are not marked as aggregates
This is a known issue with World Bank's regional classification. These are regional aggregates but may be classified differently. Use caution when filtering.
See Issue #47.
Indicator Selection
Q: How do I find indicator codes?
Option 1: Browse the help files
help wbopendata_sourceid
help wbopendata_topicid
Option 2: Use the World Bank website Visit data.worldbank.org/indicator and look for the indicator code in the URL.
Option 3: Download by topic first
* Download all Education indicators (topic 4)
wbopendata, topics(4) clear
Q: How do I download multiple indicators?
Separate indicator codes with semicolons (no spaces):
wbopendata, indicator(NY.GDP.MKTP.CD;SP.POP.TOTL;SE.PRM.ENRR) clear long
Data Formats & Options
Q: What's the difference between wide and long format?
Wide format (default): Each year is a separate variable (yr1990, yr1991, ...)
wbopendata, indicator(SP.POP.TOTL) clear
Long format: Year is a single variable with one row per country-year
wbopendata, indicator(SP.POP.TOTL) clear long
Q: How do I get only the latest available value?
Use the latest option:
wbopendata, indicator(SP.POP.TOTL) clear long latest
Q: How do I specify a year range?
Use the year() option:
* Years 2000-2020
wbopendata, indicator(SP.POP.TOTL) year(2000:2020) clear long
Metadata & Updates
Q: How do I update the indicator list?
* Check for updates
wbopendata, update check
* Download new indicator metadata
wbopendata, update all
Q: I get "varlist not allowed" when running update
Make sure you have a clean Stata session:
clear all
wbopendata, update check
See Issue #46 - fixed in v17.1.
Q: How do I suppress the metadata display?
Use the nometadata option:
wbopendata, indicator(SP.POP.TOTL) clear nometadata
Error Messages
Q: "Error when displaying metadata that contain a url link"
This was a parsing error with URLs in metadata. Fixed in v17.1.
See Issue #45.
Q: "Option -latest- breaks when indicator names are too long"
Fixed in v17.1. Update to the latest version:
ssc install wbopendata, replace
See Issue #33.
Q: match() option doesn't work as documented
The match() option cannot be combined with indicator download options. Use it separately:
* WRONG: This won't work
wbopendata, indicator(SP.POP.TOTL) match(countrycode) clear
* CORRECT: Use match separately on existing data
use mydata, clear
wbopendata, match(countrycode) full
See Issue #51 - fixed in v17.1.
Still Have Questions?
- Search existing issues: GitHub Issues
- Open a new issue: New Issue
- Check the help file:
help wbopendata
Last updated: February 2026 (v18.0.0)