Reserves and related items (BoP, current US$)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 910,853,540 +9.95% 35
Albania Albania 439,817,767 -61% 48
Argentina Argentina 5,173,245,170 -131% 14
Armenia Armenia 274,262,938 -156% 53
Antigua & Barbuda Antigua & Barbuda -1,016,450 -96.2% 74
Australia Australia 3,399,165,117 +166% 17
Austria Austria -353,919,082 -91.9% 91
Azerbaijan Azerbaijan -766,182,955 -132% 97
Belgium Belgium -2,741,065,104 +22.7% 104
Bangladesh Bangladesh -1,131,737,533 -77.2% 100
Bulgaria Bulgaria -959,765,903 -127% 99
Bahrain Bahrain -228,961,291 -177% 88
Bahamas Bahamas 242,142,468 -806% 57
Bosnia & Herzegovina Bosnia & Herzegovina 799,714,994 +430% 36
Belarus Belarus -77,239,661 -74.1% 81
Belize Belize 10,559,177 -208% 70
Brazil Brazil -26,421,602,620 -224% 110
Brunei Brunei -107,238,494 -84.8% 82
Bhutan Bhutan -28,884,507 -91.7% 77
Canada Canada 5,498,278,304 -28.3% 13
Switzerland Switzerland 26,145,736,959 -120% 3
Chile Chile -2,572,373,903 -138% 103
China China -60,497,384,785 -1,505% 111
Colombia Colombia 6,051,360,281 +255% 12
Cape Verde Cape Verde 34,950,093 +22% 66
Costa Rica Costa Rica -118,594,170 -103% 83
Cyprus Cyprus 73,960,732 -1,788% 64
Czechia Czechia 1,152,165,758 -26% 31
Germany Germany -1,554,128,087 -264% 101
Djibouti Djibouti -148,909,747 +83.4% 84
Dominica Dominica -24,990,206 +34.5% 76
Denmark Denmark 1,432,030,475 -73.2% 29
Dominican Republic Dominican Republic -1,775,154,731 -248% 102
Ecuador Ecuador 1,037,726,237 -125% 32
Spain Spain 1,452,034,781 -77.5% 28
Estonia Estonia -345,656,001 -225% 90
Finland Finland 686,132,527 +1,675% 40
France France 1,619,679,176 -107% 26
United Kingdom United Kingdom -3,851,737,409 -22.1% 107
Georgia Georgia -631,488,105 +7,070% 95
Gambia Gambia -228,774,147 +68% 87
Greece Greece -281,241,345 -150% 89
Grenada Grenada 23,179,230 -35.5% 68
Guatemala Guatemala 2,930,725,001 +224% 20
Hong Kong SAR China Hong Kong SAR China -11,456,188,755 +12.4% 109
Honduras Honduras 453,140,253 -146% 47
Croatia Croatia 252,546,717 -129% 56
Hungary Hungary 235,520,233 -91.7% 58
Indonesia Indonesia 7,189,541,702 +14.2% 10
India India 16,389,914,107 -57.1% 4
Iceland Iceland 721,990,598 -297% 39
Israel Israel 8,247,433,181 -3,465% 9
Italy Italy 2,263,773,698 -23.6% 23
Jamaica Jamaica 583,074,341 +75.4% 44
Japan Japan -66,514,447,489 -323% 112
Kazakhstan Kazakhstan -892,820,262 -84.9% 98
Cambodia Cambodia 432,745,083 +491% 49
St. Kitts & Nevis St. Kitts & Nevis 8,147,642 -201% 71
South Korea South Korea -3,072,700,000 +3.84% 106
Kuwait Kuwait -2,961,941,569 +583% 105
St. Lucia St. Lucia -17,374,757 -128% 75
Lesotho Lesotho 258,577,560 +1,449% 55
Lithuania Lithuania 1,535,811,420 +130% 27
Luxembourg Luxembourg -158,368,440 -346% 85
Latvia Latvia 35,108,777 -86.3% 65
Moldova Moldova -167,682,680 -127% 86
Maldives Maldives 83,565,512 -135% 62
Mexico Mexico 13,904,307,987 +84.5% 5
North Macedonia North Macedonia 272,771,970 -60.1% 54
Malta Malta 211,270,481 -1,271% 60
Montenegro Montenegro 304,091,340 -160% 52
Mozambique Mozambique 101,694,307 -84.9% 61
Malaysia Malaysia 3,846,081,179 -178% 16
Namibia Namibia 628,816,930 +167% 42
Nigeria Nigeria 8,335,870,672 -403% 8
Nicaragua Nicaragua 722,790,156 -28.7% 38
Netherlands Netherlands -765,050,070 -171% 96
Norway Norway -36,033,477 -101% 79
Nepal Nepal 4,756,984,153 +36.2% 15
New Zealand New Zealand 8,663,628,733 +658% 7
Pakistan Pakistan 2,470,076,338 -27.6% 22
Panama Panama 365,574,950 +57,853% 50
Peru Peru 7,079,785,972 -355% 11
Philippines Philippines 609,606,342 -83.4% 43
Poland Poland 29,227,368,046 +40.2% 2
Portugal Portugal 565,631,035 -206% 45
Paraguay Paraguay -487,362,664 -236% 92
Palestinian Territories Palestinian Territories 5,500,000 -98.7% 72
Qatar Qatar 3,007,984,168 -22.6% 19
Romania Romania 970,980,041 -93.2% 33
Saudi Arabia Saudi Arabia 925,513,340 -104% 34
Singapore Singapore 29,682,447,026 -51.4% 1
Solomon Islands Solomon Islands 16,212,502 -34.2% 69
El Salvador El Salvador 799,230,595 +72.1% 37
Suriname Suriname 214,860,726 +253% 59
Slovakia Slovakia 2,818,089,526 +327% 21
Slovenia Slovenia 357,993,999 -31,462% 51
Sweden Sweden 3,384,565,084 -159% 18
Thailand Thailand 12,413,243,984 +388% 6
Tajikistan Tajikistan 683,758,985 -8.9% 41
Timor-Leste Timor-Leste -43,817,838 -10.9% 80
Tonga Tonga 5,348,749 -75.8% 73
Trinidad & Tobago Trinidad & Tobago -620,533,634 +5.79% 94
Turkey Turkey 495,570,087 -124% 46
Ukraine Ukraine -30,743,140 -100% 78
Uruguay Uruguay 1,160,043,008 +36.6% 30
United States United States 2,110,690,362 +5,806% 25
Uzbekistan Uzbekistan -612,558,275 -77.2% 93
St. Vincent & Grenadines St. Vincent & Grenadines 33,417,867 -188% 67
Vietnam Vietnam -9,129,012,945 -262% 108
Samoa Samoa 75,018,846 -14.1% 63
South Africa South Africa 2,125,231,291 -1,094% 24

                    
# Install missing packages
import sys
import subprocess

def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Required packages
for package in ['wbdata', 'country_converter']:
try:
__import__(package)
except ImportError:
install(package)

# Import libraries
import wbdata
import country_converter as coco
from datetime import datetime

# Define World Bank indicator code
dataset_code = 'BN.RES.INCL.CD'

# Download data from World Bank API
data = wbdata.get_dataframe({dataset_code: 'value'},
date=(datetime(1960, 1, 1), datetime.today()),
parse_dates=True,
keep_levels=True).reset_index()

# Extract year
data['year'] = data['date'].dt.year

# Convert country names to ISO codes using country_converter
cc = coco.CountryConverter()
data['iso2c'] = cc.convert(names=data['country'], to='ISO2', not_found=None)
data['iso3c'] = cc.convert(names=data['country'], to='ISO3', not_found=None)

# Filter out rows where ISO codes could not be matched — likely not real countries
data = data[data['iso2c'].notna() & data['iso3c'].notna()]

# Sort for calculation
data = data.sort_values(['iso3c', 'year'])

# Calculate YoY absolute and percent change
data['value_change'] = data.groupby('iso3c')['value'].diff()
data['value_change_percent'] = data.groupby('iso3c')['value'].pct_change() * 100

# Calculate ranks (higher GDP per capita = better rank)
data['rank'] = data.groupby('year')['value'].rank(ascending=False, method='dense')

# Calculate rank change from previous year
data['rank_change'] = data.groupby('iso3c')['rank'].diff()

# Select desired columns
final_df = data[['country', 'iso2c', 'iso3c', 'year', 'value',
'value_change', 'value_change_percent', 'rank', 'rank_change']].copy()

# Optional: Add labels as metadata (could be useful for export or UI)
column_labels = {
'country': 'Country name',
'iso2c': 'ISO 2-letter country code',
'iso3c': 'ISO 3-letter country code',
'year': 'Year',
'value': 'GDP per capita (current US$)',
'value_change': 'Year-over-Year change in value',
'value_change_percent': 'Year-over-Year percent change in value',
'rank': 'Country rank by GDP per capita (higher = richer)',
'rank_change': 'Change in rank from previous year'
}

# Display first few rows
print(final_df.head(10))

# Optional: Save to CSV
#final_df.to_csv("gdp_per_capita_cleaned.csv", index=False)
                    
                
                    
# Check and install required packages
required_packages <- c("WDI", "countrycode", "dplyr")

for (pkg in required_packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

# Load the necessary libraries
library(WDI)
library(dplyr)
library(countrycode)

# Define the dataset code (World Bank indicator code)
dataset_code <- 'BN.RES.INCL.CD'

# Download data using WDI package
dat <- WDI(indicator = dataset_code)

# Filter only countries using 'is_country' from countrycode
# This uses iso2c to identify whether the entry is a recognized country
dat <- dat %>%
  filter(countrycode(iso2c, origin = 'iso2c', destination = 'country.name', warn = FALSE) %in%
           countrycode::codelist$country.name.en)

# Ensure dataset is ordered by country and year
dat <- dat %>%
  arrange(iso3c, year)

# Rename the dataset_code column to "value" for easier manipulation
dat <- dat %>%
  rename(value = !!dataset_code)

# Calculate year-over-year (YoY) change and percentage change
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(
    value_change = value - lag(value),                              # Absolute change from previous year
    value_change_percent = 100 * (value - lag(value)) / lag(value) # Percent change from previous year
  ) %>%
  ungroup()

# Calculate rank by year (higher value => higher rank)
dat <- dat %>%
  group_by(year) %>%
  mutate(rank = dense_rank(desc(value))) %>% # Rank countries by descending value
  ungroup()

# Calculate rank change (positive = moved up, negative = moved down)
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(rank_change = rank - lag(rank)) %>% # Change in rank compared to previous year
  ungroup()

# Select and reorder final columns
final_data <- dat %>%
  select(
    country,
    iso2c,
    iso3c,
    year,
    value,
    value_change,
    value_change_percent,
    rank,
    rank_change
  )

# Add labels (variable descriptions)
attr(final_data$country, "label") <- "Country name"
attr(final_data$iso2c, "label") <- "ISO 2-letter country code"
attr(final_data$iso3c, "label") <- "ISO 3-letter country code"
attr(final_data$year, "label") <- "Year"
attr(final_data$value, "label") <- "GDP per capita (current US$)"
attr(final_data$value_change, "label") <- "Year-over-Year change in value"
attr(final_data$value_change_percent, "label") <- "Year-over-Year percent change in value"
attr(final_data$rank, "label") <- "Country rank by GDP per capita (higher = richer)"
attr(final_data$rank_change, "label") <- "Change in rank from previous year"

# Print the first few rows of the final dataset
print(head(final_data, 10))