Transport services (% of service exports, BoP)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 22.5 -26.7% 37
Albania Albania 10.7 -1.41% 80
Argentina Argentina 12.8 +4.49% 68
Armenia Armenia 20.2 +27.8% 45
Antigua & Barbuda Antigua & Barbuda 3.81 -30.4% 101
Australia Australia 6.26 -1.01% 96
Austria Austria 23.1 -1.07% 36
Azerbaijan Azerbaijan 39 -15.6% 15
Belgium Belgium 21.4 -3.14% 40
Bangladesh Bangladesh 20.7 +70.9% 44
Bulgaria Bulgaria 15.9 -15.8% 57
Bahrain Bahrain 14.1 +18.4% 63
Bahamas Bahamas 1.39 -24.2% 109
Bosnia & Herzegovina Bosnia & Herzegovina 17.5 -4.12% 52
Belize Belize 4.51 +27.3% 100
Brazil Brazil 15.6 +4.55% 58
Brunei Brunei 53.8 -0.307% 4
Bhutan Bhutan 11 -25.2% 78
Canada Canada 10.4 -4.5% 83
Switzerland Switzerland 11.4 -6.72% 75
Chile Chile 33.2 -9.66% 19
China China 29.4 +10.9% 25
Colombia Colombia 16.4 -4.74% 53
Cape Verde Cape Verde 10.2 -14.1% 84
Costa Rica Costa Rica 3.07 -11.2% 104
Cyprus Cyprus 17.5 -7.69% 51
Czechia Czechia 21.6 -2.11% 39
Germany Germany 20.9 -1.2% 43
Djibouti Djibouti 60.5 +6.49% 2
Dominica Dominica 1.04 -4.17% 110
Denmark Denmark 52.3 -0.222% 5
Dominican Republic Dominican Republic 7.11 -3.56% 92
Ecuador Ecuador 39.1 -3.46% 14
Spain Spain 9.07 -17.2% 87
Estonia Estonia 20.9 -3.83% 42
Finland Finland 13 -5.91% 66
France France 16.4 -4.33% 54
United Kingdom United Kingdom 6.4 -2.34% 94
Georgia Georgia 22.2 +6.23% 38
Gambia Gambia 7.2 -53.7% 90
Greece Greece 41.1 -3.72% 13
Grenada Grenada 2.44 -6.22% 106
Guatemala Guatemala 14.5 +0.636% 61
Hong Kong SAR China Hong Kong SAR China 32.8 +6.67% 21
Honduras Honduras 5.02 +7.62% 98
Croatia Croatia 7.13 +2.26% 91
Hungary Hungary 24.8 -2.83% 33
Indonesia Indonesia 14.1 +9.85% 64
India India 8.9 +2.3% 88
Iceland Iceland 29.3 -2.07% 26
Israel Israel 9.89 +37.4% 85
Italy Italy 10.7 +6.38% 79
Jamaica Jamaica 5.45 -5.41% 97
Japan Japan 13.8 -4.84% 65
Kazakhstan Kazakhstan 47 -1.48% 10
Cambodia Cambodia 12.5 +11.8% 70
St. Kitts & Nevis St. Kitts & Nevis 3.54 +21.8% 102
South Korea South Korea 29.1 +6.44% 27
Kuwait Kuwait 15.4 +11.9% 59
St. Lucia St. Lucia 0.899 -6.49% 111
Lesotho Lesotho 2.61 -2.68% 105
Lithuania Lithuania 47.2 -0.444% 9
Luxembourg Luxembourg 11.9 -0.0722% 73
Latvia Latvia 32 +0.849% 23
Moldova Moldova 21 -5.34% 41
Maldives Maldives 3.34 -3.62% 103
Mexico Mexico 16.3 +7.96% 55
North Macedonia North Macedonia 19.7 -6.48% 48
Malta Malta 19.9 +2.97% 46
Montenegro Montenegro 25.1 -4.01% 32
Mozambique Mozambique 78.4 +1.98% 1
Malaysia Malaysia 14.5 -8.27% 62
Namibia Namibia 25.7 +17.7% 31
Nigeria Nigeria 48.1 +11.7% 8
Nicaragua Nicaragua 7.33 +35.5% 89
Netherlands Netherlands 15.1 -3.11% 60
Norway Norway 37.7 -4.7% 16
Nepal Nepal 16.2 -25.4% 56
New Zealand New Zealand 12.8 -10.1% 69
Pakistan Pakistan 10.5 -9.78% 81
Panama Panama 49.9 -4.99% 6
Peru Peru 28.5 -6.47% 28
Philippines Philippines 6.86 +8.27% 93
Poland Poland 27 -1.87% 30
Portugal Portugal 18.2 -5.83% 50
Paraguay Paraguay 19.9 -13.9% 47
Palestinian Territories Palestinian Territories 1.66 +33.5% 107
Qatar Qatar 59.6 +3.27% 3
Romania Romania 23.6 -5.53% 35
Russia Russia 33 -5.75% 20
Saudi Arabia Saudi Arabia 12.4 -7.09% 71
Singapore Singapore 32.7 +5.26% 22
Solomon Islands Solomon Islands 45.2 +5.73% 11
El Salvador El Salvador 11.2 -12.9% 77
Suriname Suriname 19 +11% 49
Slovakia Slovakia 30.8 +1.74% 24
Slovenia Slovenia 28.1 +1.2% 29
Sweden Sweden 12.3 +2.52% 72
Thailand Thailand 10.5 -1.84% 82
Tajikistan Tajikistan 48.2 +14.9% 7
Timor-Leste Timor-Leste 1.65 +0.176% 108
Tonga Tonga 12.9 -15.4% 67
Trinidad & Tobago Trinidad & Tobago 41.3 +10% 12
Turkey Turkey 34.6 -5.27% 17
Ukraine Ukraine 23.9 +4.57% 34
Uruguay Uruguay 11.3 +9.41% 76
United States United States 9.34 -1.96% 86
Uzbekistan Uzbekistan 33.3 -12.6% 18
St. Vincent & Grenadines St. Vincent & Grenadines 4.51 -11.9% 99
Samoa Samoa 6.3 -0.0833% 95
South Africa South Africa 11.9 +0.721% 74

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