The Retrieve Country Data API provides reliable, up-to-date, and structured information on different countries around the world. With this API, users can access a comprehensive set of indicators covering multiple areas, making it an essential resource for users who need to integrate statistical information into their projects or applications.
The available data includes economic aspects such as gross domestic product (GDP), economic growth, exports, and imports, as well as unemployment and employment rates broken down by sector (agriculture, industry, and services). This information provides insight into a country's economic performance and allows for the analysis of trends over time.
In the social and demographic sphere, the API offers data on total population, population growth, population density, urbanization, life expectancy by gender, infant mortality rates, fertility, migration, and refugees. It also includes education indicators such as enrollment rates in primary, secondary, and higher education, broken down by gender, which provides insight into human development and equal opportunities in each country.
The API also incorporates key environmental statistics, including total land area, forested area, CO₂ emissions, and endangered species, which are relevant factors for assessing sustainability and environmental impact.
Provides quick access to reliable statistics on the economy, population, education, environment, and society of any country.
Country Information - Endpoint Features
| Object | Description |
|---|---|
name |
[Required] Enter a country name or country code |
[{"gdp": 20580223.0, "sex_ratio": 97.9, "surface_area": 9833517.0, "life_expectancy_male": 76.3, "unemployment": 3.9, "imports": 2567490.0, "homicide_rate": 5.0, "currency": {"code": "USD", "name": "Us Dollar"}, "iso2": "US", "employment_services": 79.0, "employment_industry": 19.7, "urban_population_growth": 0.9, "secondary_school_enrollment_female": 98.7, "employment_agriculture": 1.3, "capital": "Washington, D.C.", "co2_emissions": 4761.3, "forested_area": 33.9, "tourists": 79746.0, "exports": 1644280.0, "life_expectancy_female": 81.3, "post_secondary_enrollment_female": 102.0, "post_secondary_enrollment_male": 75.0, "primary_school_enrollment_female": 101.4, "infant_mortality": 5.8, "gdp_growth": 2.9, "threatened_species": 1655.0, "population": 331003.0, "urban_population": 82.5, "secondary_school_enrollment_male": 99.2, "name": "United States", "pop_growth": 0.6, "region": "Northern America", "pop_density": 36.2, "internet_users": 87.3, "gdp_per_capita": 62917.9, "fertility": 1.8, "refugees": 1043.2, "primary_school_enrollment_male": 102.2, "telephone_country_codes": ["1"]}]
curl --location --request GET 'https://zylalabs.com/api/9943/retrieve+country+data+api/18759/country+information?name=united states' --header 'Authorization: Bearer YOUR_API_KEY'
Returns a complete list of cities by country code, including name, coordinates, state, and associated code.
Cities by Country - Endpoint Features
| Object | Description |
|---|---|
countrycode |
[Required] Enter a country code |
{"Example Response":"No response example available for now."}
curl --location --request GET 'https://zylalabs.com/api/9943/retrieve+country+data+api/18763/cities+by+country?countrycode=fr' --header 'Authorization: Bearer YOUR_API_KEY'
Returns a complete list of cities by country code, including the name, coordinates, state, and associated code.
States by country code - Endpoint Features
| Object | Description |
|---|---|
countrycode |
[Required] Enter a country code |
[{"name":"Alabama","isoCode":"AL","countryCode":"US","latitude":"32.31823140","longitude":"-86.90229800"},{"name":"Alaska","isoCode":"AK","countryCode":"US","latitude":"64.20084130","longitude":"-149.49367330"},{"name":"American Samoa","isoCode":"AS","countryCode":"US","latitude":"-14.27097200","longitude":"-170.13221700"},{"name":"Arizona","isoCode":"AZ","countryCode":"US","latitude":"34.04892810","longitude":"-111.09373110"},{"name":"Arkansas","isoCode":"AR","countryCode":"US","latitude":"35.20105000","longitude":"-91.83183340"},{"name":"Baker Island","isoCode":"UM-81","countryCode":"US","latitude":"0.19362660","longitude":"-176.47690800"},{"name":"California","isoCode":"CA","countryCode":"US","latitude":"36.77826100","longitude":"-119.41793240"},{"name":"Colorado","isoCode":"CO","countryCode":"US","latitude":"39.55005070","longitude":"-105.78206740"},{"name":"Connecticut","isoCode":"CT","countryCode":"US","latitude":"41.60322070","longitude":"-73.08774900"},{"name":"Delaware","isoCode":"DE","countryCode":"US","latitude":"38.91083250","longitude":"-75.52766990"},{"name":"District of Columbia","isoCode":"DC","countryCode":"US","latitude":"38.90719230","longitude":"-77.03687070"},{"name":"Florida","isoCode":"FL","countryCode":"US","latitude":"27.66482740","longitude":"-81.51575350"},{"name":"Georgia","isoCode":"GA","countryCode":"US","latitude":"32.16562210","longitude":"-82.90007510"},{"name":"Guam","isoCode":"GU","countryCode":"US","latitude":"13.44430400","longitude":"144.79373100"},{"name":"Hawaii","isoCode":"HI","countryCode":"US","latitude":"19.89676620","longitude":"-155.58278180"},{"name":"Howland Island","isoCode":"UM-84","countryCode":"US","latitude":"0.81132190","longitude":"-176.61827360"},{"name":"Idaho","isoCode":"ID","countryCode":"US","latitude":"44.06820190","longitude":"-114.74204080"},{"name":"Illinois","isoCode":"IL","countryCode":"US","latitude":"40.63312490","longitude":"-89.39852830"},{"name":"Indiana","isoCode":"IN","countryCode":"US","latitude":"40.26719410","longitude":"-86.13490190"},{"name":"Iowa","isoCode":"IA","countryCode":"US","latitude":"41.87800250","longitude":"-93.09770200"},{"name":"Jarvis Island","isoCode":"UM-86","countryCode":"US","latitude":"-0.37435030","longitude":"-159.99672060"},{"name":"Johnston Atoll","isoCode":"UM-67","countryCode":"US","latitude":"16.72950350","longitude":"-169.53364770"},{"name":"Kansas","isoCode":"KS","countryCode":"US","latitude":"39.01190200","longitude":"-98.48424650"},{"name":"Kentucky","isoCode":"KY","countryCode":"US","latitude":"37.83933320","longitude":"-84.27001790"},{"name":"Kingman Reef","isoCode":"UM-89","countryCode":"US","latitude":"6.38333300","longitude":"-162.41666700"},{"name":"Louisiana","isoCode":"LA","countryCode":"US","latitude":"30.98429770","longitude":"-91.96233270"},{"name":"Maine","isoCode":"ME","countryCode":"US","latitude":"45.25378300","longitude":"-69.44546890"},{"name":"Maryland","isoCode":"MD","countryCode":"US","latitude":"39.04575490","longitude":"-76.64127120"},{"name":"Massachusetts","isoCode":"MA","countryCode":"US","latitude":"42.40721070","longitude":"-71.38243740"},{"name":"Michigan","isoCode":"MI","countryCode":"US","latitude":"44.31484430","longitude":"-85.60236430"},{"name":"Midway Atoll","isoCode":"UM-71","countryCode":"US","latitude":"28.20721680","longitude":"-177.37349260"},{"name":"Minnesota","isoCode":"MN","countryCode":"US","latitude":"46.72955300","longitude":"-94.68589980"},{"name":"Mississippi","isoCode":"MS","countryCode":"US","latitude":"32.35466790","longitude":"-89.39852830"},{"name":"Missouri","isoCode":"MO","countryCode":"US","latitude":"37.96425290","longitude":"-91.83183340"},{"name":"Montana","isoCode":"MT","countryCode":"US","latitude":"46.87968220","longitude":"-110.36256580"},{"name":"Navassa Island","isoCode":"UM-76","countryCode":"US","latitude":"18.41006890","longitude":"-75.01146120"},{"name":"Nebraska","isoCode":"NE","countryCode":"US","latitude":"41.49253740","longitude":"-99.90181310"},{"name":"Nevada","isoCode":"NV","countryCode":"US","latitude":"38.80260970","longitude":"-116.41938900"},{"name":"New Hampshire","isoCode":"NH","countryCode":"US","latitude":"43.19385160","longitude":"-71.57239530"},{"name":"New Jersey","isoCode":"NJ","countryCode":"US","latitude":"40.05832380","longitude":"-74.40566120"},{"name":"New Mexico","isoCode":"NM","countryCode":"US","latitude":"34.51994020","longitude":"-105.87009010"},{"name":"New York","isoCode":"NY","countryCode":"US","latitude":"40.71277530","longitude":"-74.00597280"},{"name":"North Carolina","isoCode":"NC","countryCode":"US","latitude":"35.75957310","longitude":"-79.01929970"},{"name":"North Dakota","isoCode":"ND","countryCode":"US","latitude":"47.55149260","longitude":"-101.00201190"},{"name":"Northern Mariana Islands","isoCode":"MP","countryCode":"US","latitude":"15.09790000","longitude":"145.67390000"},{"name":"Ohio","isoCode":"OH","countryCode":"US","latitude":"40.41728710","longitude":"-82.90712300"},{"name":"Oklahoma","isoCode":"OK","countryCode":"US","latitude":"35.46756020","longitude":"-97.51642760"},{"name":"Oregon","isoCode":"OR","countryCode":"US","latitude":"43.80413340","longitude":"-120.55420120"},{"name":"Palmyra Atoll","isoCode":"UM-95","countryCode":"US","latitude":"5.88850260","longitude":"-162.07866560"},{"name":"Pennsylvania","isoCode":"PA","countryCode":"US","latitude":"41.20332160","longitude":"-77.19452470"},{"name":"Puerto Rico","isoCode":"PR","countryCode":"US","latitude":"18.22083300","longitude":"-66.59014900"},{"name":"Rhode Island","isoCode":"RI","countryCode":"US","latitude":"41.58009450","longitude":"-71.47742910"},{"name":"South Carolina","isoCode":"SC","countryCode":"US","latitude":"33.83608100","longitude":"-81.16372450"},{"name":"South Dakota","isoCode":"SD","countryCode":"US","latitude":"43.96951480","longitude":"-99.90181310"},{"name":"Tennessee","isoCode":"TN","countryCode":"US","latitude":"35.51749130","longitude":"-86.58044730"},{"name":"Texas","isoCode":"TX","countryCode":"US","latitude":"31.96859880","longitude":"-99.90181310"},{"name":"United States Minor Outlying Islands","isoCode":"UM","countryCode":"US","latitude":"19.28231920","longitude":"166.64704700"},{"name":"United States Virgin Islands","isoCode":"VI","countryCode":"US","latitude":"18.33576500","longitude":"-64.89633500"},{"name":"Utah","isoCode":"UT","countryCode":"US","latitude":"39.32098010","longitude":"-111.09373110"},{"name":"Vermont","isoCode":"VT","countryCode":"US","latitude":"44.55880280","longitude":"-72.57784150"},{"name":"Virginia","isoCode":"VA","countryCode":"US","latitude":"37.43157340","longitude":"-78.65689420"},{"name":"Wake Island","isoCode":"UM-79","countryCode":"US","latitude":"19.27961900","longitude":"166.64993480"},{"name":"Washington","isoCode":"WA","countryCode":"US","latitude":"47.75107410","longitude":"-120.74013850"},{"name":"West Virginia","isoCode":"WV","countryCode":"US","latitude":"38.59762620","longitude":"-80.45490260"},{"name":"Wisconsin","isoCode":"WI","countryCode":"US","latitude":"43.78443970","longitude":"-88.78786780"},{"name":"Wyoming","isoCode":"WY","countryCode":"US","latitude":"43.07596780","longitude":"-107.29028390"}]
curl --location --request GET 'https://zylalabs.com/api/9943/retrieve+country+data+api/18765/states+by+country+code?countrycode=us' --header 'Authorization: Bearer YOUR_API_KEY'
| Header | Description |
|---|---|
Authorization
|
[Required] Should be Bearer access_key. See "Your API Access Key" above when you are subscribed. |
No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.
The "GET Country Information" endpoint returns economic, social, demographic, and environmental statistics for a specified country. The "GET Cities by Country" endpoint provides a list of cities within a country, including their names and coordinates. The "GET States by Country Code" endpoint returns a list of states or regions within a specified country, along with relevant details.
For "GET Country Information," key fields include GDP, population, life expectancy, and CO₂ emissions. The "GET Cities by Country" endpoint typically includes city name, coordinates, and state. The "GET States by Country Code" response includes state names, coordinates, and associated codes.
The response data is structured in JSON format, with each endpoint returning an array of objects. For example, "GET Country Information" returns a single object with various fields, while "GET Cities by Country" returns an array of city objects, each containing specific attributes like name and coordinates.
The "GET Country Information" endpoint accepts parameters such as country code or name to specify which country's data to retrieve. The "GET Cities by Country" and "GET States by Country Code" endpoints require a country code to return relevant city or state data.
The "GET Country Information" endpoint provides economic indicators, demographic data, education statistics, and environmental metrics. The "GET Cities by Country" endpoint lists cities, while the "GET States by Country Code" endpoint provides details about states or regions within a specified country.
Typical use cases include economic analysis, demographic studies, urban planning, and educational assessments. Developers may use the data to create applications that visualize trends, compare countries, or inform policy decisions based on statistical insights.
Data accuracy is maintained through regular updates from reputable sources, including government databases and international organizations. Quality checks are implemented to ensure consistency and reliability across the dataset.
Users can analyze the returned data to identify trends, make comparisons, or generate reports. For instance, economic indicators can be used to assess a country's growth, while demographic data can inform social programs or educational initiatives.
To obtain your API key, you first need to sign in to your account and subscribe to the API you want to use. Once subscribed, go to your Profile, open the Subscription section, and select the specific API. Your API key will be available there and can be used to authenticate your requests.
You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.
If you don’t cancel before the 7th day, your free trial will end automatically and your subscription will switch to a paid plan under the same plan you originally subscribed to, meaning you will be charged and gain access to the API calls included in that plan.
The free trial ends when you reach 50 API requests or after 7 days, whichever comes first.
No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.
Yes, we offer a 7-day free trial that allows you to make up to 50 API calls at no cost, so you can test our APIs without any commitment.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund
Service Level:
100%
Response Time:
597ms
Service Level:
100%
Response Time:
600ms
Service Level:
100%
Response Time:
373ms
Service Level:
100%
Response Time:
583ms
Service Level:
100%
Response Time:
245ms
Service Level:
100%
Response Time:
709ms
Service Level:
100%
Response Time:
1,025ms
Service Level:
100%
Response Time:
459ms
Service Level:
100%
Response Time:
3,420ms
Service Level:
100%
Response Time:
448ms
Service Level:
100%
Response Time:
532ms
Service Level:
100%
Response Time:
378ms
Service Level:
100%
Response Time:
1,900ms
Service Level:
100%
Response Time:
2,212ms
Service Level:
100%
Response Time:
2,010ms
Service Level:
100%
Response Time:
1,347ms
Service Level:
100%
Response Time:
1,185ms
Service Level:
100%
Response Time:
13,346ms
Service Level:
100%
Response Time:
53ms
Service Level:
100%
Response Time:
151ms