Transport services (% of service imports, BoP)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 36.2 +11.5% 27
Albania Albania 10.3 -15.6% 110
Argentina Argentina 20.9 -12.9% 76
Armenia Armenia 32.3 +2.43% 37
Antigua & Barbuda Antigua & Barbuda 21.5 -5.2% 71
Australia Australia 16.8 -5% 99
Austria Austria 24.3 -3.36% 61
Azerbaijan Azerbaijan 18.4 -8.9% 88
Belgium Belgium 18.9 -2.59% 85
Bangladesh Bangladesh 61.7 +0.957% 5
Bulgaria Bulgaria 28.8 -2.03% 45
Bahrain Bahrain 33.4 -1.15% 35
Bahamas Bahamas 21.7 -7.27% 69
Bosnia & Herzegovina Bosnia & Herzegovina 33.6 -7.82% 34
Belize Belize 35.9 +0.24% 28
Brazil Brazil 21.9 +0.115% 68
Brunei Brunei 17 -4.32% 94
Bhutan Bhutan 20.9 -19.6% 75
Canada Canada 17.2 +1.67% 93
Switzerland Switzerland 15.9 +3.87% 102
Chile Chile 35.2 +0.963% 30
China China 27.5 -7.61% 47
Colombia Colombia 24.9 +1.24% 60
Cape Verde Cape Verde 27.1 -10.4% 48
Costa Rica Costa Rica 23.3 -2.13% 63
Cyprus Cyprus 17 -6.62% 95
Czechia Czechia 22 -6.76% 67
Germany Germany 20 -2.69% 79
Djibouti Djibouti 87.4 +0.416% 1
Dominica Dominica 23 -9.51% 64
Denmark Denmark 40.6 -1.29% 20
Dominican Republic Dominican Republic 44.5 -4.46% 16
Ecuador Ecuador 34.9 +2.42% 31
Spain Spain 12.7 +9.89% 107
Estonia Estonia 26.4 -1.99% 53
Finland Finland 16.5 -3.8% 101
France France 18 -3.39% 91
United Kingdom United Kingdom 9.06 -15.7% 111
Georgia Georgia 59.5 -3.58% 6
Gambia Gambia 66.7 -9.96% 3
Greece Greece 63 -3.73% 4
Grenada Grenada 21.5 -3.69% 70
Guatemala Guatemala 45.4 +2.67% 14
Hong Kong SAR China Hong Kong SAR China 22.9 +0.926% 65
Honduras Honduras 53.9 -2.68% 8
Croatia Croatia 14.5 +0.306% 105
Hungary Hungary 26.9 -3.18% 49
Indonesia Indonesia 24.9 -1.89% 59
India India 17.5 +5.93% 92
Iceland Iceland 18.1 -3.1% 90
Israel Israel 16.7 -9.92% 100
Italy Italy 21.1 +4.16% 73
Jamaica Jamaica 46.2 -1.33% 11
Japan Japan 14.7 -1.64% 103
Kazakhstan Kazakhstan 25.5 -9.22% 58
Cambodia Cambodia 49 +2.91% 10
St. Kitts & Nevis St. Kitts & Nevis 28.9 +29.6% 44
South Korea South Korea 22.2 -0.859% 66
Kuwait Kuwait 20 +9.82% 78
St. Lucia St. Lucia 26.6 +2.78% 51
Lesotho Lesotho 12.3 +1.47% 109
Lithuania Lithuania 46.1 +0.386% 12
Luxembourg Luxembourg 16.8 -1.4% 97
Latvia Latvia 24.1 -4.64% 62
Moldova Moldova 38.9 +1.19% 22
Maldives Maldives 26.4 -10.7% 55
Mexico Mexico 34.8 -8.22% 32
North Macedonia North Macedonia 26.4 +8.22% 54
Malta Malta 18.5 +2.5% 87
Montenegro Montenegro 52.4 -9.55% 9
Mozambique Mozambique 36.8 -12.9% 26
Malaysia Malaysia 25.6 -1.93% 56
Namibia Namibia 13.3 +1.9% 106
Nigeria Nigeria 35.6 -11.4% 29
Nicaragua Nicaragua 56.7 +0.634% 7
Netherlands Netherlands 19.2 -3.52% 84
Norway Norway 19.4 +0.593% 83
Nepal Nepal 19.5 -31.3% 82
New Zealand New Zealand 19.7 -12.1% 81
Pakistan Pakistan 41.8 -6.12% 19
Panama Panama 44.6 -6.57% 15
Peru Peru 32.6 +3.19% 36
Philippines Philippines 19.9 -19.5% 80
Poland Poland 21 +0.429% 74
Portugal Portugal 21.2 -9.07% 72
Paraguay Paraguay 45.4 +19.9% 13
Palestinian Territories Palestinian Territories 37.1 +19.2% 25
Qatar Qatar 32.2 +4.05% 38
Romania Romania 16.8 +2.05% 98
Russia Russia 18.3 -8.22% 89
Saudi Arabia Saudi Arabia 27.7 +2.96% 46
Singapore Singapore 34.5 +1.17% 33
Solomon Islands Solomon Islands 29 -3.54% 43
El Salvador El Salvador 31 -11.7% 40
Suriname Suriname 16.9 -10.1% 96
Slovakia Slovakia 30.2 -2.59% 41
Slovenia Slovenia 20 +4.81% 77
Sweden Sweden 12.5 -0.634% 108
Thailand Thailand 31.2 -5.9% 39
Tajikistan Tajikistan 69.5 -5.88% 2
Timor-Leste Timor-Leste 25.5 +22.5% 57
Tonga Tonga 29.5 -10.1% 42
Trinidad & Tobago Trinidad & Tobago 26.6 +7.8% 52
Turkey Turkey 39 +3.96% 21
Ukraine Ukraine 14.7 +26.4% 104
Uruguay Uruguay 26.7 +10.2% 50
United States United States 18.9 -0.932% 86
Uzbekistan Uzbekistan 44.2 -12.5% 17
St. Vincent & Grenadines St. Vincent & Grenadines 42.2 +2.21% 18
Samoa Samoa 37.2 -10.5% 24
South Africa South Africa 37.5 -6.94% 23

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