Imports of goods and services (% of GDP)

Source: worldbank.org, 01.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 24.4 -6.71% 111
Albania Albania 43 -1.98% 64
Argentina Argentina 12.8 -7.67% 134
Armenia Armenia 75.8 +25.8% 14
Australia Australia 22.6 +0.816% 117
Austria Austria 53.6 -6.52% 48
Azerbaijan Azerbaijan 36.8 +6.51% 81
Belgium Belgium 79.2 -6.54% 12
Benin Benin 21.8 -11.6% 119
Burkina Faso Burkina Faso 34.9 -2.83% 82
Bangladesh Bangladesh 16.3 -8.46% 132
Bulgaria Bulgaria 53.5 -7.44% 49
Bahamas Bahamas 41.5 +7.02% 68
Bosnia & Herzegovina Bosnia & Herzegovina 57.2 +2.64% 42
Belarus Belarus 66.9 +1.98% 28
Bermuda Bermuda 24.2 +3.63% 112
Brazil Brazil 17.5 +11.6% 128
Brunei Brunei 58.9 -2.05% 35
Botswana Botswana 40.9 +12% 69
Central African Republic Central African Republic 32.4 +11.5% 91
Canada Canada 32.7 -1.7% 90
Switzerland Switzerland 61.9 -0.0817% 32
Chile Chile 30.1 +0.745% 97
China China 17.2 +1.02% 130
Côte d’Ivoire Côte d’Ivoire 27.1 -2.46% 104
Cameroon Cameroon 21.1 +2.65% 121
Congo - Kinshasa Congo - Kinshasa 50.9 +9.22% 55
Congo - Brazzaville Congo - Brazzaville 40.4 +2.78% 71
Colombia Colombia 20.9 -7.27% 122
Comoros Comoros 34.5 -2.45% 83
Cape Verde Cape Verde 53.2 -5.37% 50
Costa Rica Costa Rica 32.8 -2.26% 89
Cyprus Cyprus 93.1 -3.12% 10
Czechia Czechia 62.7 -2.04% 31
Germany Germany 38.2 -2.92% 75
Djibouti Djibouti 148 +10.2% 3
Denmark Denmark 58.9 -1.49% 36
Dominican Republic Dominican Republic 29 +1.74% 100
Ecuador Ecuador 26.9 -5.3% 105
Egypt Egypt 23.2 +8.81% 115
Spain Spain 33 -3.28% 87
Estonia Estonia 75.7 -1.68% 15
Ethiopia Ethiopia 11.8 -16% 135
Finland Finland 40.9 -4.38% 70
France France 34 -6.34% 85
Micronesia (Federated States of) Micronesia (Federated States of) 69.1 -1.22% 22
Gabon Gabon 29.2 +8.86% 99
United Kingdom United Kingdom 31.8 -3.88% 92
Georgia Georgia 56 -3.31% 46
Ghana Ghana 34.1 +4.55% 84
Guinea Guinea 56.1 +8.43% 45
Gambia Gambia 37.2 +13.3% 80
Guinea-Bissau Guinea-Bissau 28.2 +0.925% 102
Equatorial Guinea Equatorial Guinea 25.4 +2.16% 109
Greece Greece 47.3 -2.29% 59
Guatemala Guatemala 31.5 -0.756% 93
Hong Kong SAR China Hong Kong SAR China 178 +0.836% 2
Honduras Honduras 57.6 -6.29% 40
Croatia Croatia 52.9 -3.38% 52
Haiti Haiti 18.8 -26.1% 126
Hungary Hungary 69.1 -9.38% 23
Indonesia Indonesia 20.4 +4.12% 124
India India 23.5 -0.217% 114
Ireland Ireland 105 +3.16% 7
Iran Iran 26.8 -4.14% 106
Iraq Iraq 37.2 +24.8% 79
Iceland Iceland 42.7 -1.28% 66
Israel Israel 26 -5.67% 107
Italy Italy 30.4 -5.18% 96
Jordan Jordan 57.1 +0.416% 43
Kenya Kenya 19.2 -6.12% 125
Cambodia Cambodia 72.1 +7.09% 19
Kiribati Kiribati 94.9 -6.68% 9
Libya Libya 59.1 -16.2% 34
Sri Lanka Sri Lanka 22.5 -1.47% 118
Lithuania Lithuania 68.9 -5.01% 24
Luxembourg Luxembourg 183 -2.12% 1
Latvia Latvia 67.2 -4.26% 27
Macao SAR China Macao SAR China 45.4 -10.4% 60
Morocco Morocco 52.5 +2.81% 53
Moldova Moldova 57.3 -2.77% 41
Madagascar Madagascar 31.3 -8.16% 94
Mexico Mexico 37.9 +0.859% 78
North Macedonia North Macedonia 75.8 -6.25% 13
Mali Mali 28.4 -13.4% 101
Malta Malta 106 -1.66% 6
Montenegro Montenegro 67.5 -1.52% 26
Mongolia Mongolia 69.8 +4.72% 21
Mozambique Mozambique 52.9 -12.3% 51
Mauritius Mauritius 57.8 +0.387% 39
Malaysia Malaysia 66 +3.98% 30
Namibia Namibia 68 +1.25% 25
Niger Niger 20.8 -8.58% 123
Nicaragua Nicaragua 58.1 -1.84% 38
Netherlands Netherlands 72 -6.89% 20
Norway Norway 33.7 +3.74% 86
Nepal Nepal 32.9 -4.79% 88
Nauru Nauru 119 +18.2% 5
Pakistan Pakistan 17.1 -5.77% 131
Peru Peru 22.9 -3.01% 116
Philippines Philippines 40.1 -1.65% 72
Poland Poland 48.3 -7.33% 58
Puerto Rico Puerto Rico 42.8 -10.9% 65
Portugal Portugal 44.7 -3.66% 61
Paraguay Paraguay 39.6 -1.76% 73
Palestinian Territories Palestinian Territories 60.3 -2.45% 33
Romania Romania 41.7 -5.1% 67
Russia Russia 17.6 -4.09% 127
Rwanda Rwanda 39.1 -1.93% 74
Saudi Arabia Saudi Arabia 25.6 +7.16% 108
Sudan Sudan 1.27 -7.12% 136
Senegal Senegal 43.1 -10.7% 63
Singapore Singapore 144 -0.372% 4
Sierra Leone Sierra Leone 43.5 +26.8% 62
El Salvador El Salvador 51.9 +3.14% 54
Somalia Somalia 74.3 +1.9% 17
Serbia Serbia 58.8 -1.09% 37
Slovakia Slovakia 85 -5.27% 11
Slovenia Slovenia 74.9 -2.47% 16
Sweden Sweden 50.2 -2.24% 56
Seychelles Seychelles 103 +5.94% 8
Chad Chad 17.2 +0.734% 129
Togo Togo 38.1 +1.52% 76
Thailand Thailand 66.7 +5.26% 29
Tunisia Tunisia 56.6 -4.54% 44
Turkey Turkey 27.8 -19.2% 103
Tanzania Tanzania 21.7 +3.17% 120
Uganda Uganda 24.6 +13% 110
Ukraine Ukraine 48.3 -1.76% 57
Uruguay Uruguay 23.7 -4.31% 113
United States United States 14 +0.744% 133
Uzbekistan Uzbekistan 38 -8.92% 77
Samoa Samoa 53.8 -13.1% 47
Kosovo Kosovo 72.3 +2.88% 18
South Africa South Africa 29.9 -7.93% 98
Zimbabwe Zimbabwe 30.6 +4.63% 95

The indicator 'Imports of goods and services (% of GDP)' measures the proportion of a nation's gross domestic product accounted for by imports. It provides insights into a country's economic structure, consumption patterns, and reliance on external markets for goods and services. By evaluating the ratio of imports to GDP, analysts can gauge the extent to which a country integrates itself into global trade. In 2023, this indicator has a median value of 43.88%, reflecting varying levels of import dependency across different countries and regions.

The significance of this metric lies in its capacity to inform policymakers and economists about a nation's economic health. A high percentage of imports relative to GDP indicates a robust consumer base demanding foreign products, suggesting potential reliance on global supply chains. Conversely, a low figure could imply self-sufficiency or a lack of competitiveness in the international arena. For instance, the countries with the highest import-to-GDP ratios include Luxembourg at 181.69%, Hong Kong SAR China at 176.04%, Djibouti at 173.6%, Singapore at 136.94%, and Malta at 104.69%. These figures point to a strong integration into global trade networks, where these nations depend on imported goods and services to satisfy domestic consumption and investments.

On the other side of the spectrum, nations such as Sudan, Turkmenistan, and the United States have notably lower import ratios, with the U.S. sitting at 13.89% and a bottom tier average around 1.37% to 12.47%. These lower figures may suggest a more insulated economy, with domestic production meeting the demands of the local market, but they may also reflect barriers to international trade or underdeveloped sectors within those economies.

The relationship between imports of goods and services and other economic indicators is intricate. For instance, a nation's export performance can significantly influence its import levels. A country with a strong export sector can balance high imports by generating substantial foreign exchange and economic growth. Likewise, a country’s exchange rate plays a critical role; a stronger currency can make imports cheaper, potentially increasing their share of GDP. Additionally, economic policies, tariff structures, trade agreements, and global market conditions also impact this indicator.

Several factors come into play when analyzing imports as a percentage of GDP. Economic openness, consumer demand, industrial capability, and infrastructure all shape a country’s import profile. Countries highly reliant on imports for essential goods may face vulnerabilities, particularly concerning geopolitical risks or global market fluctuations. The global economic climate, the availability of local alternatives, and changes in consumer preferences also influence how much a country may import compared to its GDP.

Strategically, governments might pursue policies to enhance export competitiveness while also maintaining healthy import ratios to ensure diverse consumer options. Strategies to bolster domestic production capacity could mitigate over-reliance on imports. Initiatives such as investing in local industries, creating trade partnerships, or employing tariffs can help achieve a balanced economic framework where imports serve the economy without jeopardizing it. However, in pursuing such strategies, countries must consider their unique economic landscapes and the potential trade-offs that come with restricting imports.

While the imports of goods and services indicator is instrumental in understanding economic health, it is not without its flaws. A high import ratio could be misleading; it doesn’t always correlate with economic weakness and can sometimes indicate an economy that is thriving and dynamically engaged in global trade. Furthermore, the context surrounding extreme values must be considered; for example, territories with extremely high import ratios, such as Luxembourg, may have unique economic structures that do not necessarily apply to larger nations. Therefore, while this metric is essential for analysis, it should always be interpreted within a broader economic context.

Globally, data from past decades showcases a notable upward trajectory in imports’ percentage of GDP from about 13.01% in 1970 to values peaking in the mid-30s over the 2000s. The world saw fluctuations influenced by various financial crises, technological advancements in logistics, and shifts in consumer behavior. The latest figures, showing a decrease to around 28.49% in 2023, suggest a global reevaluation and readjustment of trade dynamics, possibly reflecting a transition to more localized supply chains post-pandemic or changing consumer priorities. Over the decades, fluctuations between highs and lows of import ratios highlight the sensitive balance countries must maintain between nurturing domestic industries while adequately engaging with the global marketplace.

                    
# 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 = 'NE.IMP.GNFS.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 <- 'NE.IMP.GNFS.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))