Insurance and financial services (% of service exports, BoP)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 0.0124 -108% 106
Albania Albania 0.444 -32.9% 94
Argentina Argentina 1.4 -1.05% 82
Armenia Armenia 9.91 +89.5% 19
Antigua & Barbuda Antigua & Barbuda 6.03 +3.79% 29
Australia Australia 4.67 -19.1% 39
Austria Austria 3.32 -8.93% 53
Azerbaijan Azerbaijan 1.97 +143% 70
Belgium Belgium 9.08 +5.14% 20
Bangladesh Bangladesh 3.1 -10.9% 56
Bulgaria Bulgaria 5.95 +13.1% 30
Bahrain Bahrain 31.3 -7.49% 2
Bosnia & Herzegovina Bosnia & Herzegovina 0.217 -9.99% 101
Belize Belize 1.66 +38.8% 77
Brazil Brazil 5.77 +18.3% 31
Brunei Brunei 0.233 +16% 99
Bhutan Bhutan 8.32 -31.9% 22
Canada Canada 10.1 +8.21% 18
Switzerland Switzerland 21.4 -4.77% 6
Chile Chile 6.07 -18.6% 28
China China 1.7 -27.4% 74
Colombia Colombia 1.3 +10.7% 84
Cape Verde Cape Verde 0.391 -10.4% 95
Costa Rica Costa Rica 1.08 -1.84% 86
Cyprus Cyprus 21 +3.91% 8
Czechia Czechia 3.11 +2.02% 55
Germany Germany 13.2 +4.5% 13
Dominica Dominica 4.13 -12.9% 44
Denmark Denmark 2.25 +25.7% 67
Dominican Republic Dominican Republic 2.91 +27.8% 59
Ecuador Ecuador 1.83 +5.64% 72
Spain Spain 4.74 +7.75% 37
Estonia Estonia 1.6 -14.9% 78
Finland Finland 1.49 -5.28% 80
France France 13.4 +12.9% 12
United Kingdom United Kingdom 25.7 +2.99% 5
Georgia Georgia 3.53 +8.02% 51
Gambia Gambia 0.0688 -7.98% 104
Greece Greece 3.65 +9.62% 49
Grenada Grenada 1.69 -0.327% 76
Guatemala Guatemala 4.68 +1.05% 38
Hong Kong SAR China Hong Kong SAR China 26.8 -1.75% 4
Honduras Honduras 0.729 +8.62% 91
Croatia Croatia 1.14 -1.86% 85
Hungary Hungary 2.42 +6.64% 63
Indonesia Indonesia 4.61 -29.4% 41
India India 3.12 -10.5% 54
Iceland Iceland 2.95 -8.99% 58
Israel Israel 0.0579 +8.23% 105
Italy Italy 8.15 +7.8% 23
Jamaica Jamaica 0.331 -7.37% 97
Japan Japan 7.04 -6.85% 26
Kazakhstan Kazakhstan 10.1 +0.677% 17
Cambodia Cambodia 0.308 -59.9% 98
St. Kitts & Nevis St. Kitts & Nevis 4.29 +16.6% 43
South Korea South Korea 4.65 -14.3% 40
Kuwait Kuwait 13 -11.9% 14
St. Lucia St. Lucia 0.47 -15.8% 93
Lesotho Lesotho 0.156 +12.1% 102
Lithuania Lithuania 7.73 +10.1% 25
Luxembourg Luxembourg 51.6 +2.46% 1
Latvia Latvia 2.39 -0.419% 65
Moldova Moldova 0.357 -20.5% 96
Mexico Mexico 10.2 +8.3% 16
North Macedonia North Macedonia 0.144 -29.5% 103
Malta Malta 4.87 +17.7% 36
Montenegro Montenegro 1.93 +17.5% 71
Mozambique Mozambique 1.47 -9% 81
Malaysia Malaysia 2.46 -6.07% 62
Namibia Namibia 3.93 -19% 47
Nigeria Nigeria 28.4 +13.1% 3
Nicaragua Nicaragua 0.847 +16.9% 90
Netherlands Netherlands 6.85 -2.31% 27
Norway Norway 7.88 -1.01% 24
Nepal Nepal 0.983 +19.8% 88
New Zealand New Zealand 0.219 -92.1% 100
Pakistan Pakistan 1.8 -31.2% 73
Panama Panama 10.5 -1.32% 15
Peru Peru 4.37 -6.18% 42
Philippines Philippines 1.08 +33.9% 87
Poland Poland 2.4 -0.608% 64
Portugal Portugal 1.69 +10.8% 75
Paraguay Paraguay 0.663 -5.21% 92
Qatar Qatar 5.63 -7.22% 34
Romania Romania 1.39 +9.83% 83
Russia Russia 4.05 +17.4% 46
Saudi Arabia Saudi Arabia 4.1 -2.53% 45
Singapore Singapore 15.9 +0.26% 10
Solomon Islands Solomon Islands 0.858 -4.91% 89
El Salvador El Salvador 2.29 -8.99% 66
Suriname Suriname 4.97 -1.74% 35
Slovakia Slovakia 3.32 +6.65% 52
Slovenia Slovenia 3.56 +4.93% 50
Sweden Sweden 5.71 -3.67% 33
Thailand Thailand 1.58 -23.1% 79
Tajikistan Tajikistan 21.2 +456% 7
Timor-Leste Timor-Leste 2.84 -38.6% 60
Trinidad & Tobago Trinidad & Tobago 14.6 +8.07% 11
Turkey Turkey 3.07 -2.96% 57
Ukraine Ukraine 2.06 +9.31% 69
Uruguay Uruguay 5.76 +3.69% 32
United States United States 19.7 +0.962% 9
Uzbekistan Uzbekistan 2.06 -22.8% 68
St. Vincent & Grenadines St. Vincent & Grenadines 2.67 -16.1% 61
Samoa Samoa 3.82 +21.4% 48
South Africa South Africa 8.87 -4.67% 21

                    
# 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 = 'BX.GSR.INSF.ZS'

# 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 <- 'BX.GSR.INSF.ZS'

# 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))