Travel services (% of commercial service exports)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 13.8 +39% 83
Albania Albania 67.8 +6.03% 19
Argentina Argentina 29.4 -14.7% 57
Armenia Armenia 43.2 -18.8% 40
Antigua & Barbuda Antigua & Barbuda 84.7 +2.15% 9
Australia Australia 62.6 +3.19% 22
Austria Austria 28.2 +2.11% 60
Azerbaijan Azerbaijan 25.3 +6.17% 65
Belgium Belgium 6.03 +1.74% 109
Bangladesh Bangladesh 8.72 -13.5% 100
Bulgaria Bulgaria 26.1 +2.54% 64
Bahrain Bahrain 31.8 +6.6% 53
Bahamas Bahamas 94.8 +1.54% 3
Bosnia & Herzegovina Bosnia & Herzegovina 52.4 -0.351% 30
Belize Belize 73.3 -1.23% 16
Brazil Brazil 15.4 -0.979% 82
Brunei Brunei 32.6 +47.6% 52
Bhutan Bhutan 77.5 +8.1% 12
Canada Canada 31.6 +6.47% 55
Switzerland Switzerland 12.4 -1.55% 89
Chile Chile 28 +14.2% 61
China China 10.4 +35.8% 96
Colombia Colombia 48.9 +2.31% 35
Cape Verde Cape Verde 80.3 +2.81% 11
Costa Rica Costa Rica 33.9 +5.01% 50
Cyprus Cyprus 12.6 -1.99% 88
Czechia Czechia 21.5 +9.2% 69
Germany Germany 8.62 +1.68% 101
Djibouti Djibouti 6.16 +0.489% 107
Dominica Dominica 65.8 +6.54% 21
Denmark Denmark 8.31 -1.84% 102
Dominican Republic Dominican Republic 76.4 -1.88% 14
Ecuador Ecuador 48.7 -0.265% 36
Spain Spain 48.4 +3.51% 37
Estonia Estonia 12.1 +2.87% 90
Finland Finland 10.1 -8.5% 97
France France 19.4 +0.0587% 75
United Kingdom United Kingdom 13.1 +4.07% 86
Georgia Georgia 58.3 -1.67% 26
Gambia Gambia 91.6 +9.85% 5
Greece Greece 42.2 -0.0731% 43
Grenada Grenada 85.3 +0.637% 7
Guatemala Guatemala 36.2 +10.9% 47
Hong Kong SAR China Hong Kong SAR China 20.8 -3.06% 71
Honduras Honduras 19.8 +11.3% 73
Croatia Croatia 66.1 +1.31% 20
Hungary Hungary 21.2 -0.724% 70
Indonesia Indonesia 43.1 +2.39% 41
India India 9.36 -2.07% 98
Iceland Iceland 47.1 +2.27% 39
Israel Israel 2.68 -58.1% 111
Italy Italy 38.1 -0.448% 46
Jamaica Jamaica 82.6 +0.278% 10
Japan Japan 24.3 +30.1% 66
Kazakhstan Kazakhstan 22.3 +2.76% 68
Cambodia Cambodia 75.7 +0.72% 15
St. Kitts & Nevis St. Kitts & Nevis 86.3 +0.121% 6
South Korea South Korea 12.1 -1.56% 91
Kuwait Kuwait 19.4 +19.9% 76
St. Lucia St. Lucia 94.9 +0.55% 2
Lesotho Lesotho 68.1 -4.89% 18
Lithuania Lithuania 7.94 -0.319% 103
Luxembourg Luxembourg 3.92 -2.75% 110
Latvia Latvia 16.1 +2.04% 81
Moldova Moldova 28.9 +4.25% 58
Maldives Maldives 95.4 +0.247% 1
Mexico Mexico 52.4 -4.39% 29
North Macedonia North Macedonia 19.8 -5.44% 74
Malta Malta 11.7 +21.4% 93
Montenegro Montenegro 54.6 -0.0952% 27
Mozambique Mozambique 18.1 -7.92% 79
Malaysia Malaysia 39.4 +12.8% 45
Namibia Namibia 34.8 +3.47% 49
Nigeria Nigeria 7.39 -56.4% 104
Nicaragua Nicaragua 42.9 -15.8% 42
Netherlands Netherlands 7.28 +1.6% 105
Norway Norway 13.8 +8.62% 84
Nepal Nepal 50.2 -31.2% 32
New Zealand New Zealand 52.3 +7.15% 31
Pakistan Pakistan 10.7 -22% 94
Panama Panama 33.1 +6.58% 51
Peru Peru 52.8 +8.4% 28
Philippines Philippines 18.7 -0.994% 77
Poland Poland 12.1 -13% 92
Portugal Portugal 48.3 +0.699% 38
Paraguay Paraguay 30.9 +10.3% 56
Palestinian Territories Palestinian Territories 27.8 -41.5% 62
Qatar Qatar 28.4 -2.76% 59
Romania Romania 13.4 +7.15% 85
Russia Russia 18.4 +7.6% 78
Saudi Arabia Saudi Arabia 77.4 -0.338% 13
Singapore Singapore 6.03 +3.99% 108
Solomon Islands Solomon Islands 22.8 +8% 67
El Salvador El Salvador 59.5 +6.75% 24
Suriname Suriname 17.6 +1.06% 80
Slovakia Slovakia 12.6 +4.86% 87
Slovenia Slovenia 26.7 -3.22% 63
Sweden Sweden 9.27 -1.03% 99
Thailand Thailand 59.8 +13.1% 23
Tajikistan Tajikistan 10.5 +25.3% 95
Timor-Leste Timor-Leste 91.8 +2.03% 4
Tonga Tonga 58.6 +7.32% 25
Trinidad & Tobago Trinidad & Tobago 35.2 -5.67% 48
Turkey Turkey 49 +3.77% 34
Ukraine Ukraine 6.32 +17.6% 106
Uruguay Uruguay 31.8 -3.65% 54
United States United States 20 +4.95% 72
Uzbekistan Uzbekistan 49.1 +22.7% 33
St. Vincent & Grenadines St. Vincent & Grenadines 85.1 +3.24% 8
Samoa Samoa 70.5 -2.83% 17
South Africa South Africa 40.4 -0.468% 44

                    
# 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 = 'TX.VAL.TRVL.ZS.WT'

# 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 <- 'TX.VAL.TRVL.ZS.WT'

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