UN Data
UN Data is a single search interface that reaches across the many statistical databases the United Nations system maintains, saving you from hopping between individual agency sites. From one place it queries 32 databases holding more than 60 million records that reach back to 1970. Behind that front door sit well-known collections: UN Comtrade international trade figures, energy production and consumption statistics, greenhouse gas inventories, national accounts, population and gender data, and the headline development indicators governments and researchers cite constantly.
You browse and filter in the browser, choosing a country, an indicator, and a year range, then export the result as CSV or XML. The data is country-year time series rather than prose, so a RAG pipeline needs a verbalising step: each row becomes a short factual sentence, for example "In 2015, country X produced Y tonnes of Z," which a retriever can then match against a natural-language question. Budget most of your effort for that conversion and for reconciling country names and codes across databases.
This is a solid choice whenever a system has to answer factual questions about global trade, energy, population, or development and needs a recognised international body behind the answer. It works well next to the World Bank's Open Data and Eurostat: UN Data is the broad, multi-agency net, the World Bank is cleaner and better documented for headline indicators, and Eurostat goes deeper on European detail.
The wrinkle is that each underlying database is run by a different UN organisation, so there is no single blanket licence. The overall stance is generally open, but commercial use is unclear and you are expected to attribute the specific source agency rather than the UN in general. Confirm the conditions on the exact database you draw from before you redistribute anything or build a paid product on top of it.
Related sources
Eurostat
The statistical office of the European Union, providing official statistics for Europe. Covers the economy, population, environment, agriculture, trade, and more across EU member states, with harmonised figures that let you compare countries on a like-for-like basis.
FRED (Federal Reserve Economic Data)
A large online database of macroeconomic and financial time series maintained by the Federal Reserve Bank of St. Louis, with around 845,000 series drawn from over 120 public and private sources. Free to access through a REST API returning JSON or XML.
IMF Data
A gateway to the IMF's global economic data, giving streamlined access to macroeconomic and financial statistics. Includes International Financial Statistics covering balance of payments, interest rates, national accounts, prices, production, trade, and population for more than 200 countries.
OECD Data
Reports, data, and publications on the economic, environmental, and social conditions in hundreds of countries. Includes International Development Statistics covering aid volume, origin, and types, plus the Creditor Reporting System with detailed information on individual aid activities.