Travel services (% of service imports, BoP)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 17.9 +13.7% 67
Albania Albania 76.4 +5.16% 1
Argentina Argentina 34.5 +6.49% 17
Armenia Armenia 44.4 -8.79% 7
Antigua & Barbuda Antigua & Barbuda 16.2 +3.33% 73
Australia Australia 42 +0.725% 9
Austria Austria 19.3 +6.83% 60
Azerbaijan Azerbaijan 15.7 +17.7% 79
Belgium Belgium 16.6 +14.6% 72
Bangladesh Bangladesh 14.4 -5.49% 82
Bulgaria Bulgaria 24.7 +9.47% 40
Bahrain Bahrain 10.7 +13.3% 94
Bahamas Bahamas 11 +12.7% 93
Bosnia & Herzegovina Bosnia & Herzegovina 36.7 +9.28% 13
Belize Belize 23 -0.283% 48
Brazil Brazil 19.1 -5.7% 62
Brunei Brunei 31.7 +27.1% 24
Bhutan Bhutan 45.5 -10.6% 6
Canada Canada 27.1 +5.39% 33
Switzerland Switzerland 11.3 -3.32% 91
Chile Chile 15.8 +7.4% 78
China China 40.9 +13% 11
Colombia Colombia 31.7 +8.85% 23
Cape Verde Cape Verde 27.9 +7.28% 31
Costa Rica Costa Rica 26.1 -1.02% 37
Cyprus Cyprus 9.06 -1.79% 99
Czechia Czechia 23.2 +10.5% 47
Germany Germany 21.8 -1.61% 54
Djibouti Djibouti 2.9 -4.48% 110
Dominica Dominica 17.2 +20.5% 71
Denmark Denmark 9.42 -0.0968% 98
Dominican Republic Dominican Republic 18 -17.2% 65
Ecuador Ecuador 24.2 +8.51% 41
Spain Spain 29.2 -1.6% 28
Estonia Estonia 14.4 +5.68% 81
Finland Finland 13.2 +4.04% 86
France France 17.7 +4.47% 70
United Kingdom United Kingdom 29.7 +7.77% 27
Georgia Georgia 12.7 -8.69% 89
Gambia Gambia 7.01 +39.8% 104
Greece Greece 9.72 +8.74% 97
Grenada Grenada 6.83 +10.8% 105
Guatemala Guatemala 24 +8.7% 42
Hong Kong SAR China Hong Kong SAR China 32 +11.3% 21
Honduras Honduras 15.9 +2.26% 76
Croatia Croatia 31 +12.9% 25
Hungary Hungary 14.4 +4.3% 83
Indonesia Indonesia 23.4 +2.72% 45
India India 17.8 -4.84% 68
Iceland Iceland 35 +0.0528% 14
Israel Israel 19 -8.63% 63
Italy Italy 22 -2.18% 52
Jamaica Jamaica 8.67 -1.14% 101
Japan Japan 5.8 +6.77% 106
Kazakhstan Kazakhstan 30.1 +8.81% 26
Cambodia Cambodia 26.2 -6.14% 36
St. Kitts & Nevis St. Kitts & Nevis 18.3 +35.5% 64
South Korea South Korea 18 -0.871% 66
Kuwait Kuwait 44.2 -6.08% 8
St. Lucia St. Lucia 13 +12.1% 87
Lesotho Lesotho 73.9 +0.505% 2
Lithuania Lithuania 13.3 +7.02% 85
Luxembourg Luxembourg 4.01 +0.293% 109
Latvia Latvia 24 +9.19% 43
Moldova Moldova 33.1 -2.19% 20
Maldives Maldives 27 +8.55% 34
Mexico Mexico 15.9 +30.2% 75
North Macedonia North Macedonia 20.6 +1.37% 57
Malta Malta 4.16 +8.83% 108
Montenegro Montenegro 7.81 +19.2% 102
Mozambique Mozambique 7.37 -21.4% 103
Malaysia Malaysia 22.8 +6.57% 50
Namibia Namibia 4.64 +29.9% 107
Nigeria Nigeria 25.3 +7.78% 38
Nicaragua Nicaragua 15.9 +12.2% 77
Netherlands Netherlands 10.5 +7.23% 95
Norway Norway 28.4 -0.966% 30
Nepal Nepal 67.5 +1.8% 3
New Zealand New Zealand 23 +4.82% 49
Pakistan Pakistan 21.5 -5.16% 55
Panama Panama 22.3 +7.16% 51
Peru Peru 23.3 -2.52% 46
Philippines Philippines 34.1 +54.4% 19
Poland Poland 15.6 -0.376% 80
Portugal Portugal 26.3 -0.017% 35
Paraguay Paraguay 24.7 -28.5% 39
Palestinian Territories Palestinian Territories 20.5 -41.1% 58
Qatar Qatar 38.2 -0.892% 12
Romania Romania 34.3 +4.42% 18
Russia Russia 47.7 +5.12% 5
Saudi Arabia Saudi Arabia 27.2 +12.6% 32
Singapore Singapore 8.91 +12.3% 100
Solomon Islands Solomon Islands 16.1 -13% 74
El Salvador El Salvador 35 +17.2% 15
Suriname Suriname 11.7 -17.5% 90
Slovakia Slovakia 19.9 +5.59% 59
Slovenia Slovenia 29.2 -0.455% 29
Sweden Sweden 11.2 -6.76% 92
Thailand Thailand 21.3 +14.7% 56
Tajikistan Tajikistan 1.94 -21.2% 111
Timor-Leste Timor-Leste 31.9 -3.06% 22
Tonga Tonga 34.8 +16.5% 16
Trinidad & Tobago Trinidad & Tobago 19.3 -4.4% 61
Turkey Turkey 13.8 -13.8% 84
Ukraine Ukraine 62.4 -8.08% 4
Uruguay Uruguay 23.5 -10.8% 44
United States United States 21.9 +3.2% 53
Uzbekistan Uzbekistan 41.7 +11.6% 10
St. Vincent & Grenadines St. Vincent & Grenadines 17.7 +4.13% 69
Samoa Samoa 10.3 +25.8% 96
South Africa South Africa 12.9 -1.63% 88

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