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

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 7.35 +1.13% 52
Albania Albania 3.54 -16.5% 88
Argentina Argentina 3.61 -1.79% 85
Armenia Armenia 9.19 +9.56% 38
Antigua & Barbuda Antigua & Barbuda 10.6 -0.887% 28
Australia Australia 2.64 +1.18% 98
Austria Austria 3.91 -3% 81
Azerbaijan Azerbaijan 3.07 -2.14% 93
Belgium Belgium 8.34 +0.609% 46
Bangladesh Bangladesh 7.5 -7.74% 49
Bulgaria Bulgaria 8.45 +9.2% 45
Bahrain Bahrain 35 -1.22% 2
Bahamas Bahamas 11.3 -8.15% 23
Bosnia & Herzegovina Bosnia & Herzegovina 7.02 +10.9% 55
Belize Belize 12.1 +20.7% 19
Brazil Brazil 4.58 +4.87% 73
Brunei Brunei 2.63 -22% 99
Bhutan Bhutan 11 +41.4% 26
Canada Canada 8.84 +2.37% 42
Switzerland Switzerland 3.43 -4.48% 90
Chile Chile 11.2 -8.16% 24
China China 2.95 -20.2% 94
Colombia Colombia 10.4 +1.41% 29
Cape Verde Cape Verde 3.9 +19.6% 82
Costa Rica Costa Rica 11.1 -6.8% 25
Cyprus Cyprus 19.8 +2.91% 4
Czechia Czechia 6.77 -6.65% 57
Germany Germany 7.49 -0.859% 50
Djibouti Djibouti 2.56 -24% 101
Dominica Dominica 16.6 -2.86% 10
Denmark Denmark 1.66 -11.3% 109
Dominican Republic Dominican Republic 11.8 -8.44% 22
Ecuador Ecuador 12.9 +11.3% 18
Spain Spain 4.56 -6.87% 74
Estonia Estonia 2.52 +2.68% 102
Finland Finland 4.5 +20.4% 76
France France 9.79 +9.19% 35
United Kingdom United Kingdom 9.9 +0.0786% 33
Georgia Georgia 7.39 +8.26% 51
Gambia Gambia 19.8 +9.2% 3
Greece Greece 8.81 -4.83% 43
Grenada Grenada 8.85 -5.87% 41
Guatemala Guatemala 10.7 -8.75% 27
Hong Kong SAR China Hong Kong SAR China 11.9 -4.44% 21
Honduras Honduras 6.83 +10.9% 56
Croatia Croatia 5.27 +36.6% 70
Hungary Hungary 4.15 -9.42% 79
Indonesia Indonesia 10.2 +0.272% 32
India India 3.8 -7.45% 83
Iceland Iceland 5.29 +5.27% 69
Israel Israel 1.61 +20.4% 110
Italy Italy 9.53 -0.112% 37
Jamaica Jamaica 6.17 +19.4% 61
Japan Japan 13.3 +10.2% 17
Kazakhstan Kazakhstan 5.6 +12.1% 67
Cambodia Cambodia 9.05 +11.9% 40
St. Kitts & Nevis St. Kitts & Nevis 17.5 +26% 6
South Korea South Korea 3.56 -11.5% 87
Kuwait Kuwait 9.89 -2.56% 34
St. Lucia St. Lucia 7.87 -2.25% 48
Lesotho Lesotho 2.56 +0.0196% 100
Lithuania Lithuania 4.23 -0.344% 78
Luxembourg Luxembourg 44.7 +2.52% 1
Latvia Latvia 2.27 -31.3% 105
Moldova Moldova 2.47 -2.77% 104
Maldives Maldives 7.26 +27.1% 53
Mexico Mexico 17.3 +5.07% 7
North Macedonia North Macedonia 1.25 -17.2% 111
Malta Malta 2.49 -11.9% 103
Montenegro Montenegro 1.78 +49.2% 106
Mozambique Mozambique 6.56 -16.1% 59
Malaysia Malaysia 5.88 -4.17% 65
Namibia Namibia 1.77 +5.14% 107
Nigeria Nigeria 8.28 +39.6% 47
Nicaragua Nicaragua 15.9 -0.11% 12
Netherlands Netherlands 5.96 -0.303% 64
Norway Norway 3.94 -1.2% 80
Nepal Nepal 4.45 +1.18% 77
New Zealand New Zealand 13.7 +7.96% 16
Pakistan Pakistan 9.17 +0.479% 39
Panama Panama 19 +9.72% 5
Peru Peru 10.3 +1.6% 31
Philippines Philippines 12 -0.399% 20
Poland Poland 5.25 -0.144% 71
Portugal Portugal 5.46 -5.69% 68
Paraguay Paraguay 6.34 -12.9% 60
Palestinian Territories Palestinian Territories 5.09 +33.2% 72
Qatar Qatar 3.48 +17.3% 89
Romania Romania 3.38 -7.51% 91
Russia Russia 1.74 +4.43% 108
Saudi Arabia Saudi Arabia 5.81 -9% 66
Singapore Singapore 7.21 +5.62% 54
Solomon Islands Solomon Islands 3.7 -20.4% 84
El Salvador El Salvador 16.4 +2.74% 11
Suriname Suriname 8.68 +33.9% 44
Slovakia Slovakia 4.53 +3.18% 75
Slovenia Slovenia 3.58 +8.04% 86
Sweden Sweden 2.7 -3.37% 96
Thailand Thailand 6.76 -7.9% 58
Tajikistan Tajikistan 13.7 +80.3% 15
Timor-Leste Timor-Leste 9.57 +23.7% 36
Tonga Tonga 2.69 +21.9% 97
Trinidad & Tobago Trinidad & Tobago 16.6 +0.669% 9
Turkey Turkey 10.3 +17.3% 30
Ukraine Ukraine 2.85 +9.96% 95
Uruguay Uruguay 6.02 +4.16% 62
United States United States 16.7 -1.93% 8
Uzbekistan Uzbekistan 3.32 -22% 92
St. Vincent & Grenadines St. Vincent & Grenadines 13.8 +3.74% 14
Samoa Samoa 14 +55.3% 13
South Africa South Africa 6 +38.2% 63

                    
# 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 = 'BM.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 <- 'BM.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))