Travel services (% of service exports, BoP)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 13.5 +36.5% 84
Albania Albania 67.4 +6.08% 18
Argentina Argentina 29 -14.9% 56
Armenia Armenia 43 -18.8% 39
Antigua & Barbuda Antigua & Barbuda 84.5 +2.16% 7
Australia Australia 62.1 +3.25% 20
Austria Austria 27.9 +2.14% 60
Azerbaijan Azerbaijan 25.2 +6.18% 65
Belgium Belgium 5.92 +1.38% 108
Bangladesh Bangladesh 6.62 -6.91% 104
Bulgaria Bulgaria 26 +2.69% 63
Bahrain Bahrain 31.8 +6.6% 52
Bahamas Bahamas 93.9 +1.67% 3
Bosnia & Herzegovina Bosnia & Herzegovina 52.3 -0.376% 28
Belize Belize 70.2 +0.757% 16
Brazil Brazil 15.1 -0.526% 82
Brunei Brunei 31.1 +49% 55
Bhutan Bhutan 69.1 -1.6% 17
Canada Canada 31.4 +6.64% 54
Switzerland Switzerland 12.2 -1.45% 89
Chile Chile 27 +14.7% 61
China China 10.4 +35.9% 94
Colombia Colombia 48.3 +2.45% 35
Cape Verde Cape Verde 78 +3.17% 9
Costa Rica Costa Rica 33.8 +5.02% 50
Cyprus Cyprus 12.5 -1.89% 88
Czechia Czechia 21.5 +9.2% 68
Germany Germany 8.51 +1.69% 100
Djibouti Djibouti 4.42 +2.29% 109
Dominica Dominica 61.6 +1.41% 21
Denmark Denmark 8.27 -1.81% 101
Dominican Republic Dominican Republic 74.7 -1.65% 12
Ecuador Ecuador 47.2 -0.19% 37
Spain Spain 48.4 +3.51% 34
Estonia Estonia 12.1 +2.75% 90
Finland Finland 10.1 -8.47% 96
France France 19.3 +0.13% 75
United Kingdom United Kingdom 13 +3.9% 86
Georgia Georgia 57.5 -1.73% 25
Gambia Gambia 91.6 +9.85% 4
Greece Greece 42.1 -0.0716% 41
Grenada Grenada 85.2 +0.641% 5
Guatemala Guatemala 35.5 +10.9% 47
Hong Kong SAR China Hong Kong SAR China 20.8 -2.97% 71
Honduras Honduras 19.4 +11.3% 74
Croatia Croatia 66.1 +1.31% 19
Hungary Hungary 21.1 -0.685% 70
Indonesia Indonesia 42.8 +2.74% 40
India India 9.34 -2.05% 97
Iceland Iceland 47 +2.25% 38
Israel Israel 2.68 -58.1% 111
Italy Italy 37.9 -0.401% 46
Jamaica Jamaica 82.1 +0.276% 8
Japan Japan 24 +30.4% 66
Kazakhstan Kazakhstan 21.7 +2.84% 67
Cambodia Cambodia 73.4 -0.353% 14
St. Kitts & Nevis St. Kitts & Nevis 75.3 +17.6% 11
South Korea South Korea 12 -1.15% 91
Kuwait Kuwait 18.5 +20.3% 77
St. Lucia St. Lucia 94.7 +0.568% 2
Lesotho Lesotho 59.3 -6.39% 22
Lithuania Lithuania 7.92 -0.282% 102
Luxembourg Luxembourg 3.9 -2.73% 110
Latvia Latvia 16.1 +2.06% 81
Moldova Moldova 28.2 +4.2% 58
Maldives Maldives 95.1 +0.264% 1
Mexico Mexico 52.3 -4.35% 29
North Macedonia North Macedonia 19.7 -5.42% 72
Malta Malta 11.7 +21.4% 93
Montenegro Montenegro 54.6 -0.1% 27
Mozambique Mozambique 18.1 -7.92% 78
Malaysia Malaysia 39.3 +12.8% 45
Namibia Namibia 33.8 +4.4% 49
Nigeria Nigeria 6.58 -56.5% 105
Nicaragua Nicaragua 39.4 -17% 44
Netherlands Netherlands 7.24 +1.52% 103
Norway Norway 13.7 +8.63% 83
Nepal Nepal 41.4 -34.1% 42
New Zealand New Zealand 51.7 +7.21% 30
Pakistan Pakistan 9.29 -19.9% 98
Panama Panama 32.9 +6.44% 51
Peru Peru 51.4 +8.95% 31
Philippines Philippines 18.7 -0.996% 76
Poland Poland 12 -13% 92
Portugal Portugal 48.2 +0.683% 36
Paraguay Paraguay 28.5 +10.9% 57
Palestinian Territories Palestinian Territories 25.7 -42.9% 64
Qatar Qatar 27.9 -2.26% 59
Romania Romania 13.4 +7.11% 85
Russia Russia 18 +7.21% 79
Saudi Arabia Saudi Arabia 74.1 -0.112% 13
Singapore Singapore 6.03 +3.99% 107
Solomon Islands Solomon Islands 21.1 +7.75% 69
El Salvador El Salvador 57.9 +7.43% 24
Suriname Suriname 16.9 -0.0061% 80
Slovakia Slovakia 12.5 +4.63% 87
Slovenia Slovenia 26.6 -3.26% 62
Sweden Sweden 9.17 -1.33% 99
Thailand Thailand 59.2 +13.1% 23
Tajikistan Tajikistan 10.3 +26% 95
Timor-Leste Timor-Leste 77.5 +5.59% 10
Tonga Tonga 56.7 +7.1% 26
Trinidad & Tobago Trinidad & Tobago 34.7 -5.66% 48
Turkey Turkey 48.9 +4.03% 33
Ukraine Ukraine 6.08 +17.7% 106
Uruguay Uruguay 31.5 -3.64% 53
United States United States 19.4 +5.4% 73
Uzbekistan Uzbekistan 48.9 +22.7% 32
St. Vincent & Grenadines St. Vincent & Grenadines 84.8 +3.3% 6
Samoa Samoa 70.5 -2.83% 15
South Africa South Africa 40 +0.313% 43

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