CountryData

CountryData["tag",property]

gives the value of the specified property for the country, country-like entity, or group of countries specified by "tag".

CountryData["tag",{property,,dates}]

gives time series for certain economic and other properties.

Details

  • CountryData["tag"] gives the standardized Entity for the country or country-like entity specified by "tag", or a standardized EntityClass if "tag" corresponds to a group of countries.
  • Possible tags for individual countries include English and local names, Entity or EntityClass objects, canonical names, short names, two-letter internet codes, Olympic codes, ISO codes, etc.
  • Tags can also specify political or economic groups of countries, as well as continents and oceans.
  • CountryData[] or CountryData[All] gives the list of all ordinary countries and dependencies.
  • CountryData[patt] gives a list of all country names that match the string pattern patt.
  • With the following special tags CountryData["tag"] yields lists of tags:
  • "Countries"ordinary countries and dependencies
    "Continents"continents
    "Groups"groups of countries (e.g. "UN", "G7")
    "Oceans"oceans
  • CountryData["Properties"] gives a list of all properties available for countries.
  • The specified property can be an EntityProperty, EntityPropertyClass, property canonical name, or list of properties.
  • Properties that do not apply or are not known in a particular case are indicated by Missing[].
  • Numerical values that are known only to a certain precision are typically tagged with their precision, and given in arbitrary-precision form.
  • Basic properties for countries include:
  • "Area"land area in square kilometers
    "CapitalCity"capital city specification
    "Flag"a graphic of the flag for the country
    "GDP"estimated gross domestic product in US dollars
    "Name"English short country name
    "Population"estimated population
    "Shape"a graphic of the basic shape of the country
  • Country name and identifier properties include:
  • "AlternateNames"alternate names and tags for the country
    "CallingCode"international telephone prefix code
    "CountryCode"two-letter ISO code
    "FlagDescription"textual description of the flag for the country
    "Flag"a graphic of the flag for the country
    "FullName"formal full English country name
    "FullNativeName"full name in native language
    "InternetCode"two-letter internet top-level domain code
    "ISOName"full ISO country name
    "Name"standard English country name
    "NationalityName"name of the country nationality (e.g. "American")
    "NativeName"standard name in native language
    "Regions"administrative divisions of the country
    "RegionNames"English names for administrative divisions
    "UNCode"three-letter United Nations country code
    "UNNumber"United Nations country number
  • Cartographic display properties include:
  • "FullPolygon"polygon for all boundaries
    "Polygon"polygon for main boundaries
    "SchematicPolygon"polygon for schematic boundaries
    "Shape"a graphic of the basic shape of the country
    {"spec",proj}use the specified cartographic projection
  • Main boundaries exclude entities such as outlying islands and dependencies.
  • By default, coordinates are given as longitude-latitude pairs, corresponding to an equirectangular projection.
  • Available cartographic projections include:
  • "Albers"Albers equal-area conic projection
    {"Albers",ϕ1,ϕ2}Albers projection with standard parallels ϕ1, ϕ2
    "Bonne"Bonne projection
    {"Bonne",ϕ1}Bonne projection with standard parallel ϕ1
    {"CylindricalEqualArea",ϕs}cylindrical equal-area projection with standard latitude ϕs
    {"CylindricalEquidistant",ϕs}cylindrical equidistant projection with standard latitude ϕs
    "EckertIV"Eckert IV projection
    "EckertVI"Eckert VI projection
    "Equirectangular"explicit longitude, latitude
    "LambertAzimuthal"Lambert azimuthal equal-area projection
    "LambertConic"Lambert conformal conic projection
    {"LambertConic",ϕ1,ϕ2}Lambert conic projection with standard parallels ϕ1, ϕ2
    "LambertCylindrical"Lambert cylindrical equal-area projection
    "Mercator"Mercator cylindrical projection
    "MillerCylindrical"Miller cylindrical projection
    "Mollweide"homolographic Mollweide projection
    "Orthographic"orthographic projection
    "Polyconic"conic projection with two poles
    "Robinson"Robinson projection
    "Sinusoidal"equal-area pseudo-cylindrical projection
    "VanDerGrinten"Van der Grinten projection
    "WinkelTripel"Winkel Tripel projection
  • The centering of cartographic projections is specified as follows:
  • projuse {0,0} as the center
    {proj,Center}use the center of specified country as the center
    {proj,{lat,long}}use the specified latitude and longitude (in degrees)
  • Raw cartographic properties include:
  • "Coordinates"latitude, longitude lists for main boundaries
    "FullCoordinates"latitude, longitude lists for all boundaries
    "SchematicCoordinates"latitude, longitude lists for schematic boundaries
  • Geographical properties include:
  • "Area"total country area in square kilometers
    "BorderingCountries"countries bordering by land
    "BordersLengths"list of lengths of borders with other countries
    "BoundaryLength"total large-scale boundary length in kilometers
    "CenterCoordinates"latitude and longitude of geographical center
    "CenterLocationLink"URI for a map centered on the country
    "CoastlineLength"large-scale length of coastline in kilometers
    "Continent"primary continent (by area) in which the country lies
    "HighestElevation"highest elevation in meters
    "HighestPoint"name and elevation of highest point
    "LandArea"country land area in square kilometers
    "LargestCities"a list of largest cities
    "LowestElevation"lowest elevation in meters
    "LowestPoint"name and elevation of lowest point
    "MaritimeClaims"claim types and distances from land in nautical miles
    "TimeZones"current time zones relative to UTC
    "WaterArea"approximate enclosed water area in square kilometers
  • Properties related to natural resources and features include:
  • "ArableLandArea"arable land area in square kilometers
    "ArableLandFraction"fraction of land area that is arable
    "ClimateTypes"list of primary climate types
    "CropsLandArea"land area planted with crops in square kilometers
    "CropsLandFraction"fraction of land area permanently planted with crops
    "EnvironmentalIssues"list of primary environmental issues
    "IrrigatedLandArea"irrigated land area in square kilometers
    "IrrigatedLandFraction"fraction of land area that is irrigated
    "NaturalHazards"list of primary natural hazards
    "NaturalResources"list of primary natural resources
    "TerrainTypes"list of primary terrain types
  • Culture-related properties include:
  • "EthnicGroups"common ethnic groups
    "EthnicGroupsFractions"ethnic groups and fractions of population
    "FemaleLiteracyFraction"fraction of adult female population able to read and write
    "Languages"primary languages commonly spoken
    "LanguagesDialects"common detailed languages and dialects
    "LanguagesFractions"primary languages and fractions of population
    "LiteracyFraction"fraction of adult population able to read and write
    "MaleLiteracyFraction"fraction of adult male population able to read and write
    "Religions"religions commonly practiced
    "ReligionsFractions"religions and fractions of population
  • Demographic properties include:
  • "AdultPopulation"estimated population aged 15 to 64
    "AnnualBirths"estimated total number of births per year
    "AnnualDeaths"estimated total number of deaths per year
    "BirthRateFraction"average number of births per person per year
    "ChildPopulation"estimated population aged below 15
    "DeathRateFraction"average number of deaths per person per year
    "ElderlyPopulation"estimated population aged above 65
    "FemaleAdultPopulation"estimated female population aged 15 to 64
    "FemaleChildPopulation"estimated female population aged below 15
    "FemaleElderlyPopulation"estimated female population aged above 65
    "FemaleLifeExpectancy"female life expectancy in years
    "FemaleMedianAge"median age of female population in years
    "FemalePopulation"estimated female population
    "LifeExpectancy"average life expectancy in years
    "MaleAdultPopulation"estimated male population aged 15 to 64
    "MaleChildPopulation"estimated male population aged below 15
    "MaleElderlyPopulation"estimated male population aged above 65
    "MaleLifeExpectancy"male life expectancy in years
    "MaleMedianAge"median age of male population in years
    "MalePopulation"estimated male population
    "MedianAge"median age of population in years
    "MigrationRateFraction"average net migration per person per year
    "Population"estimated population
    "PopulationGrowth"annual fractional growth in estimated population
    "TotalFertilityRate"lifetime total average number of births per woman
  • Public health properties include:
  • "AnnualHIVAIDSDeaths"recent number of deaths per year from AIDS
    "FemaleInfantMortalityFraction"fraction of female births with infant mortality
    "HIVAIDSDeathRateFraction"average number of AIDS deaths per year
    "HIVAIDSFraction"fraction of population infected with HIV
    "HIVAIDSPopulation"total population infected with HIV
    "InfantMortalityFraction"fraction of births with infant mortality
    "InfectiousDiseases"list of major infectious diseases
    "MaleInfantMortalityFraction"fraction of male births with infant mortality
  • Military-related properties include:
  • "MilitaryAgeFemales"total number of females of military age
    "MilitaryAgeMales"total number of males of military age
    "MilitaryAgePopulation"total population of military age
    "MilitaryAgeRate"total population reaching military age each year
    "MilitaryExpenditureFraction"military expenditure as a fraction of GDP
    "MilitaryExpenditures"total military expenditures in US dollars
    "MilitaryFitFemales"total females considered fit for military service
    "MilitaryFitMales"total males considered fit for military service
    "MilitaryFitPopulation"total population considered fit for military service
  • Economic-related properties include:
  • "AgriculturalProducts"major agricultural products
    "GDP"GDP in US dollars at official exchange rate
    "GDPAtParity"GDP in US dollars at purchasing power parity
    "GDPPerCapita"GDP normalized by population
    "GDPRealGrowth"annual growth in real GDP
    "GiniIndex"Gini index of income inequality
    "GovernmentDebt"outstanding government debt in US dollars
    "GovernmentExpenditures"annual government expenditures in US dollars
    "GovernmentReceipts"annual government receipts in US dollars
    "GovernmentSurplus"annual government surplus in US dollars
    "IndustrialProductionGrowth"annual change in industrial output
    "InflationRate"annual fractional change in consumer prices
    "LaborForce"size of adult labor force, whether employed or not
    "MajorIndustries"list of major industries
    "NationalIncome"national income in US dollars at official exchange rate
    "PovertyFraction"fraction of population below official poverty line
    "PriceIndex"general price index relative to the current year
    "SectorLaborFractions"fractions of labor force in different sectors
    "UnemploymentFraction"fraction of labor force unemployed
  • Properties related to components of GDP include (by default all values are in US dollars):
  • "AgriculturalValueAdded"value added by agricultural activities
    "ConstructionValueAdded"value added by construction and real estate activities
    "ExpenditureFractions"fractions of components of expenditure
    "FixedInvestment"investment in fixed capital
    "GDPSectorFractions"major sector portions of production
    "GovernmentConsumption"annual government consumption
    "GrossInvestment"gross investment
    "HouseholdConsumption"annual household consumption
    "IndustrialValueAdded"value added by all industrial activities
    "InventoryChange"annual change in the value of inventories
    "ManufacturingValueAdded"value added by manufacturing industries
    "MiscellaneousValueAdded"value added by miscellaneous service and other activities
    "TotalConsumption"total consumption expenditure
    "TradeValueAdded"value added by wholesale and retail trade
    "TransportationValueAdded"value added by transportation and communications
  • Trade-related properties include:
  • "ExportCommodities"major commodities exported
    "ExportPartners"major countries exported to
    "ExportPartnersFractions"major export partners and fractions
    "ExportValue"total estimated value of annual exports in US dollars
    "ImportCommodities"major commodities imported
    "ImportPartners"major countries imported from
    "ImportPartnersFractions"major import partners and fractions
    "ImportValue"total estimated value of annual imports in US dollars
    "CurrentAccountBalance"current account trade balance in US dollars
    "ForeignExchangeReserves"government reserves of currency and gold in US dollars
    "ExternalDebt"total government foreign currency debt, in US dollars
    "EconomicAid"net inflow of economic aid, in US dollars
  • Properties whose values are given in terms of currency allow the following alternative forms:
  • {"prop","USDollars"}nominal value in US dollars (default)
    {"prop","Local"}nominal value in local currency
    {"prop","Adjusted"}adjusted to give a real value in current US dollars
    {"prop","LocalAdjusted"}adjusted to give a real value in current local currency
    {"prop",curr,y}value in year y currency
  • Currency-related properties include:
  • "CurrencyCode"standard currency code (e.g. "USD", "GBP")
    "CurrencyName"English currency name (e.g. "US dollars")
    "CurrencyShortName"short currency name (e.g. "Dollars", "Pesos")
    "CurrencyUnit"currency unit (e.g. "USDollars")
    "ExchangeRate"currency units per US dollar
  • Energy-related properties include:
  • "ElectricityConsumption"annual electricity consumption in kilowatt hours
    "ElectricityExports"annual electricity exports in kilowatt hours
    "ElectricityImports"annual electricity imports in kilowatt hours
    "ElectricityProduction"annual electricity output in kilowatt hours
    "NaturalGasConsumption"annual natural gas consumption in cubic meters
    "NaturalGasExports"annual natural gas exports in cubic meters
    "NaturalGasImports"annual natural gas imports in cubic meters
    "NaturalGasProduction"annual natural gas production in cubic meters
    "NaturalGasReserves"natural gas reserves in cubic meters
    "OilConsumption"oil consumption in barrels per day
    "OilExports"oil exports in barrels per day
    "OilImports"oil imports in barrels per day
    "OilProduction"oil production in barrels per day
    "OilReserves"estimated oil reserves in barrels
  • Electrical grid properties include:
  • "ElectricalGridFrequency"electrical grid frequency in hertz
    "ElectricalGridPlugImages"images of standard electrical plugs used
    "ElectricalGridPlugs"standard electrical plug types used
    "ElectricalGridSocketImages"images of standard electrical sockets used
    "ElectricalGridSockets"standard electrical socket types used
    "ElectricalGridVoltages"list of standard electrical grid voltages
  • Governmental-related properties include:
  • "CapitalCity"capital city specification
    "Dependencies"entities identifying themselves as dependencies
    "DependencyParent"country (if any) of which this is a dependency
    "FiscalYearDate"date of beginning of fiscal year
    "IndependenceYear"claimed year of independence
    "Regions"administrative divisions of the country
    "SuffrageType"voting eligibility
  • International relations properties include:
  • "EnvironmentalAgreements"environmental agreements in force for the country
    "InternationalOrganizations"organizations in which the country is a member
    "SignedEnvironmentalAgreements"agreements signed by the country, ratified or not
  • Communications-related properties include:
  • "PhoneLines"number of telephone land lines in use
    "CellularPhones"number of cellular phones in use
    "CallingCode"international telephone prefix code
    "RadioStations"total number of public radio stations
    "AMRadioStations"number of AM broadcast radio stations
    "FMRadioStations"number of FM broadcast radio stations
    "ShortWaveRadioStations"number of shortwave broadcast radio stations
    "TelevisionStations"number of broadcast television stations
    "InternetCode"two-letter internet top-level domain code
    "InternetHosts"estimated number of internet hosts
    "InternetUsers"estimated number of internet users
  • Transportation-related properties include:
  • "Airports"total number of airports
    "PavedAirports"total number of paved airports
    "UnpavedAirports"total number of unpaved airports
    "PavedAirportLengths"numbers of paved airports in length bins
    "UnpavedAirportLengths"numbers of unpaved airports in length bins
    "RoadLength"total length of all roads in kilometers
    "PavedRoadLength"total length of paved roads in kilometers
    "UnpavedRoadLength"total length of unpaved roads in kilometers
    "WaterwayLength"total length of navigable waterways in kilometers
    "MajorPorts"names of major ports
    "RailwayLength"total length of railways in kilometers
    "RailwayGaugeLengths"lengths of railways by gauge in kilometers
    "RailwayGaugeRules"rules for railways gauges in meters
    "MerchantShips"total merchant ships above 1000 gross tons
    "MerchantShipTypes"type and number of merchant ships above 1000 tons
    "MerchantShipsGross"total gross tonnage for merchant ships above 1000 tons
    "MerchantShipsDeadWeight"total dead weight for merchant ships above 1000 tons
    "ForeignRegisteredShips"merchant ships owned in country but registered elsewhere
    "ForeignOwnedShips"merchant ships registered in country but owned elsewhere
    "Pipelines"type and total kilometer length of pipelines
  • For properties available for multiple years, CountryData["tag",{property,y}] gives the value of the property for year y.
  • CountryData["tag",{property,All}] gives the dates and values for all available years.
  • CountryData["tag",{property,{y1,y2}}] gives the dates and values for years from y1 through y2.
  • CountryData["name","property","ann"] gives various annotations associated with a property. Typical annotations include:
  • "Date"date to which the data refers
    "Description"a textual description of the property
    "Note"special note about the property given
    "Units"units in which the value is given
    "UnitsName"English name for the units used
    "UnitsNotation"notation for the units used
    "UnitsStandardName"Wolfram Language standard name for the units used
  • Use of CountryData may require internet connectivity.

Examples

open allclose all

Basic Examples  (8)

Find the population of France:

Find the members of the G7:

Find the GDPs of members of the G7:

Logarithmic rank plot of populations of all countries:

A log-log scatter plot of GDP against population for all countries, with tooltips for country name:

Find the GDP of France in 1970:

Plot the GDP of France from 1970 to 2005:

Basic iconic shape of France:

Generate a world map using a Mollweide projection:

Scope  (48)

Countries, Groups, and Names  (14)

Find the list of all ordinary countries and dependencies:

Find all countries and dependencies whose names begin with U:

Find the countries in South America:

Find all supported country groups:

Find members of the East African Community:

Find the number of members in the United Nations:

Use the abbreviation UN:

Find countries that are in the United Nations but not the Universal Postal Union:

Find the populations of all countries in the G7:

Find the total population:

The English name for the United States:

The full English name:

Alternate names:

The name for Germany in German:

Codes for Germany:

Find the standard name of a country from a tag:

Alternate names that follow standard Wolfram Language conventions can also be used:

Show small flags for all countries in South America:

International organizations of which Bermuda is a member:

Maps & Images  (10)

The basic shape of Australia:

Generate a polygon boundary for Australia:

The "schematic boundary" is lower resolution:

Combine the polygons for all countries in South America:

Show countries in South America colored by their arable land fractions:

By default, country shapes are generated separately for each country:

Use a fixed Mercator projection:

Use a Mollweide projection instead:

The Mollweide projection, with the central longitude as the projection center:

In the default projection for polygons, the coordinates are literal longitude, latitude values:

Show all countries in schematic form:

Use a Lambert azimuthal projection:

Use a Robinson projection, with the longitude of 90° west as the projection center:

Use the Lambert azimuthal projection, centered at New York City:

World maps using the Bonne projection, with two different standard parallels:

Geography, etc.  (11)

Find the area of the US in square kilometers:

Find the list of countries that border Germany:

Lengths of borders in kilometers:

Find the standard time zones for Russia:

Find a link to web satellite image of the country:

Lowest and highest points in the US:

Show only the highest elevation, in meters:

Find countries with antimony as a natural resource:

Find a list of natural hazard types for Peru:

Find the regions (provinces) of Canada:

Give their traditional English names:

Find the largest cities in Fiji:

Culture & Demography  (4)

Primary languages used in Spain:

Approximate fractions:

Life expectancy and median age for the US:

Components of population estimates for the US:

Economics & Trade  (5)

Export partners for South Africa:

Major industries in South Africa:

Export commodities:

GDP in nominal US dollars:

Adjusted GDP in 1970 US dollars:

GDP in local currency:

Oil exports in barrels per day:

Oil reserves:

Estimated number of years of oil remaining at current production rates:

Time Series  (4)

US population estimate for 1990:

Population of the US from 1990 to 1995:

Time series for the GDP of Germany:

GDP time series in current US dollars for each year:

GDP time series in 1970 US dollars:

Generalizations & Extensions  (3)

CountryData includes applicable data on oceans:

Find the list of oceans:

CountryData includes applicable data on the world as a whole:

For groups, CountryData gives lists of values:

Applications  (10)

Plot population against area for all countries, with a tooltip for the country name:

Find the 20 largest countries ranked by area:

Make a table of data for the top 5 countries:

Literacy rate in Africa:

Find the number of years that estimated oil reserves will last at current production rates:

Find the result for OPEC as a group:

Find the Antarctic nations:

Highlight the Antarctic nations:

Show the adjacency graph for countries in South America:

Find a traveling-salesman tour of the centers of the countries in Europe:

Find countries recorded as having Hindu populations:

Show the numbers of current countries that became independent by year:

Sort current countries by their claimed independence years, showing the oldest 20:

Plot countries color coded by the length of their claimed independence:

Properties & Relations  (3)

Generate a world map with tooltips for the name of each country:

FinancialData gives the current exchange rate:

CountryData gives the most recent historical yearly exchange rate:

Show yearly time series:

CityData gives cities listed in order of decreasing population:

CountryData gives the largest cities in a country:

Possible Issues  (12)

Dependency and Names-Related Issues  (3)

Dependencies are normally treated as separate entities by CountryData:

Taiwan is a separate entity for CountryData, and is not aggregated into China:

Gaza Strip and West Bank are currently included as separate entities:

Maps-Related Issues  (6)

Only the main boundaries of a country are included in the "Polygon" property:

The full boundaries for the United Kingdom include Pitcairn Island in the South Pacific:

The main polygon for the US does not include Alaska or Hawaii:

The full polygon includes Alaska, as well as islands in the Pacific and Indian Oceans:

The schematic polygon is typically sufficient for basic pictures:

The iconic shape of each country is by default given in its own coordinate system:

If an explicit common coordinate system is specified, the shapes will fit together:

The "Polygon" property always gives polygons in a consistent coordinate system:

The "shape" of a country by default uses its own coordinate system, not longitude, latitude:

The equirectangular projection gives longitude, latitude coordinates:

Coordinates are latitude, longitude:

Reverse the coordinates for each point:

The iconic shapes of countries are not to scale, but are larger for larger countries:

Content-Related Issues  (3)

Some properties do not apply to particular entities:

Russia has continent Asia because most of its area is in Asia:

Data is available only for time periods when countries existed as separate entities:

Neat Examples  (5)

Show the disembodied shapes of countries in South America:

Find the numbers of international organizations of which countries are members:

Show the top 15 "organizations" countries:

Show the rank plot, including tooltips:

Show a log rank plot of areas of islands in the geographical database for Norway:

Generate the same plot for Canada:

Find the numbers of countries that have particular colors in their flags:

Plot the countries of the world according to the shapes of their electrical outlets:

Wolfram Research (2007), CountryData, Wolfram Language function, https://reference.wolfram.com/language/ref/CountryData.html (updated 2014).

Text

Wolfram Research (2007), CountryData, Wolfram Language function, https://reference.wolfram.com/language/ref/CountryData.html (updated 2014).

CMS

Wolfram Language. 2007. "CountryData." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/CountryData.html.

APA

Wolfram Language. (2007). CountryData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CountryData.html

BibTeX

@misc{reference.wolfram_2023_countrydata, author="Wolfram Research", title="{CountryData}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/CountryData.html}", note=[Accessed: 18-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_countrydata, organization={Wolfram Research}, title={CountryData}, year={2014}, url={https://reference.wolfram.com/language/ref/CountryData.html}, note=[Accessed: 18-March-2024 ]}