CountryData

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

CountryData["tag", {property, ..., dates}]
gives time series for certain economic and other properties.

DetailsDetails

  • CountryData["tag"] gives the standardized name for the country or country-like entity specified by , or a list of standardized names if corresponds to a group of countries.
  • Possible tags for individual countries include English and local 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. , )
    "Oceans"oceans
  • CountryData["Properties"] gives a list of all properties available for countries.
  • 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. )
    "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 ,
    "Bonne"Bonne projection
    {"Bonne",1}Bonne projection with standard parallel
    {"CylindricalEqualArea",s}cylindrical equal-area projection with standard latitude
    {"CylindricalEquidistant",s}cylindrical equidistant projection with standard latitude
    "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 ,
    "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 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 through .
  • 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"Mathematica standard name for the units used
  • Use of CountryData may require internet connectivity.

ExamplesExamplesopen allclose all

Basic Examples (8)Basic Examples (8)

Find the population of France:

In[1]:=
Click for copyable input
Out[1]=

Find the members of the G8:

In[1]:=
Click for copyable input
Out[1]=

Find the GDPs of members of the G8:

In[1]:=
Click for copyable input
Out[1]=

Logarithmic rank plot of populations of all countries:

In[1]:=
Click for copyable input
Out[1]=

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

In[1]:=
Click for copyable input
Out[1]=

Find the GDP of France in 1970:

In[1]:=
Click for copyable input
Out[1]=

Plot the GDP of France from 1970 to 2005:

In[2]:=
Click for copyable input
Out[2]=

Basic iconic shape of France:

In[1]:=
Click for copyable input
Out[1]=

Generate a world map using a Mollweide projection:

In[1]:=
Click for copyable input
Out[1]=
New in 6
New to Mathematica? Find your learning path »
Have a question? Ask support »