Discover/restcountries.com API
live

restcountries.com APIrestcountries.com

Look up countries by name and get capital, population, region, currencies, and languages. Single endpoint, fuzzy matching, returns structured JSON.

Endpoint health
verified 2h ago
get_country
1/1 passing latest checkself-healing
Endpoints
1
Updated
3h ago
Try it
Country name or partial name to search for (e.g. 'Canada', 'stan', 'United').
api.parse.bot/scraper/a5b531c0-d31c-4811-9193-08343f10dff8/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Use it in your codegrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/a5b531c0-d31c-4811-9193-08343f10dff8/get_country?name=Canada' \
  -H 'X-API-Key: $PARSE_API_KEY'
Or use the typed Python SDKfully typed · autocompletes

Typed Python client. Install the CLI, sign in, then pull this API’s generated client:

pip install parse-sdk
parse login
parse add --marketplace restcountries-com-api

parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.


"""Walkthrough: REST Countries SDK — look up countries by name."""
from parse_apis.REST_Countries_API import RestCountries, NotFoundError

client = RestCountries()

# Search for countries matching a name
for country in client.countries.search(name="Canada", limit=5):
    print(country.name, country.region, country.population)
    for currency in country.currencies:
        print(f"  Currency: {currency.name} ({currency.code}, {currency.symbol})")
    for lang in country.languages:
        print(f"  Language: {lang.name} ({lang.native_name})")

# Drill into the first result for a specific search
result = client.countries.search(name="France", limit=1).first()
if result:
    print(result.name, result.official_name, result.capital)

# Handle not-found errors gracefully
try:
    found = client.countries.search(name="Atlantis", limit=1).first()
    if found:
        print(found.name, found.population)
    else:
        print("No country matched")
except NotFoundError as exc:
    print(f"Not found: {exc}")

print("exercised: countries.search / currency fields / language fields / error handling")
All endpoints · 1 totalmissing one? ·

Search for countries by name using fuzzy matching against the REST Countries database. Returns matching countries with their capital city, population, geographic region, currencies, and languages. The search matches common names, official names, and country codes. Uses the publicly available demo key which returns sample data (Canada) for all queries; a paid API key enables full search functionality.

Input
ParamTypeDescription
namerequiredstringCountry name or partial name to search for (e.g. 'Canada', 'stan', 'United').
Response
{
  "type": "object",
  "fields": {
    "total": "integer count of matched countries",
    "countries": "array of country objects with name, official_name, capital, population, region, subregion, currencies, and languages"
  },
  "sample": {
    "data": {
      "total": 1,
      "countries": [
        {
          "name": "Canada",
          "region": "Americas",
          "capital": [
            "Ottawa"
          ],
          "languages": [
            {
              "name": "English",
              "native_name": "English"
            },
            {
              "name": "French",
              "native_name": "français"
            }
          ],
          "subregion": "North America",
          "currencies": [
            {
              "code": "CAD",
              "name": "Canadian dollar",
              "symbol": "$"
            }
          ],
          "population": 41575585,
          "official_name": "Canada"
        }
      ]
    },
    "status": "success"
  }
}

About the restcountries.com API

The REST Countries API exposes one endpoint — get_country — that searches the REST Countries database by name and returns up to 8 structured fields per match, including capital city, population, region, subregion, currencies, and languages. Fuzzy matching means partial inputs like 'stan' or 'United' return all relevant countries in a single response, making it straightforward to power dropdowns, validation logic, or geography lookups.

What the API Returns

The get_country endpoint accepts a single required name parameter — a full or partial country name — and returns a total count alongside a countries array. Each object in the array includes name (common name), official_name, capital, population, region, subregion, currencies, and languages. All of these fields are present on every matched result, so you do not need to guard against missing keys depending on query type.

Search Behavior

The name input is matched against common names, official names, and country codes in the underlying REST Countries database. A query like 'stan' will surface Afghanistan, Kazakhstan, Pakistan, and other matches simultaneously. Queries against partial strings such as 'United' return United States, United Kingdom, United Arab Emirates, and any other entries that match — the total field tells you exactly how many were found without needing to count the array manually.

Currencies and Languages

The currencies and languages fields are returned as structured objects rather than flat strings, so your code can iterate over multiple values per country. A country like Switzerland, for example, carries entries for multiple official languages. This makes the endpoint useful for locale detection, form validation, or display layers that need to present currency symbols or language names alongside country selections.

Reliability & maintenanceVerified

The restcountries.com API is a managed, monitored endpoint for restcountries.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when restcountries.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official restcountries.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
2h ago
Latest check
1/1 endpoint passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Populate a country selector dropdown with official names, capitals, and regions pulled from get_country.
  • Validate user-entered country names by fuzzy-matching against the REST Countries database and returning the canonical official_name.
  • Display a travel destination card showing capital city, population, and subregion for any searched country.
  • Build a currency lookup tool that resolves a country name to its associated currencies object.
  • Implement locale detection by mapping a country name to its languages field for language preference logic.
  • Filter countries by partial string (e.g., 'island') to generate regional geography quizzes using name and region fields.
  • Cross-reference population and region data for basic demographic summaries in data visualization dashboards.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000250 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does REST Countries have an official developer API?+
Yes. REST Countries publishes a free public API at https://restcountries.com. This Parse API wraps that data in a consistent interface with structured JSON responses.
What does the `get_country` endpoint return when a partial name like 'stan' is used?+
It returns all countries whose common name, official name, or country code contains the substring. The total field reflects the exact count of matches, and each entry in the countries array includes all eight fields: name, official_name, capital, population, region, subregion, currencies, and languages.
Can I filter results by region or retrieve all countries in a continent?+
Not currently. The single get_country endpoint filters only by name string. The region and subregion fields are returned in each result, so you can filter client-side after fetching. You can fork this API on Parse and revise it to add a region-based endpoint if server-side geographic filtering is needed.
Does the API return geographic coordinates, flag images, or ISO codes?+
Not currently. The response covers name, official_name, capital, population, region, subregion, currencies, and languages. Coordinates, flag URLs, and ISO alpha codes are not included in the current response shape. You can fork this API on Parse and revise it to surface those additional fields from the REST Countries source.
How fresh is the country data?+
The data reflects the REST Countries database, which is a community-maintained open-source dataset. Sovereign status, capital changes, and currency updates depend on when that upstream dataset is refreshed. For rapidly changing political situations, treat the data as a general reference rather than a real-time authoritative source.
Page content last updated . Spec covers 1 endpoint from restcountries.com.
Related APIs in Maps GeoSee all →
portofrotterdam.com API
Track live vessel movements and monitor port performance metrics including container throughput and anchorage statistics for the Port of Rotterdam. Access nautical notices and search detailed port information to stay updated on shipping operations and port conditions.
geonames.org API
Search for places worldwide and get their exact coordinates, timezone information, and elevation data, or reverse lookup locations by coordinates to discover nearby areas. Access postal codes, country details, and geographic names across the globe to build location-aware applications and services.
expatistan.com API
Compare cost of living across cities and countries worldwide, view rankings, and analyze expense data to make informed decisions about relocating or understanding living costs globally. Search for specific cities and access the latest pricing information on housing, food, transportation, and other essential expenses.
yandex.ru API
Search for businesses on Yandex Maps and instantly access their names, addresses, phone numbers, websites, social media links, hours of operation, and categories. Get detailed company information to find local services, verify business details, or build comprehensive business directories.
bart.gov API
Track live BART train departures and arrival estimates across all Bay Area stations in real-time. Find your nearest station and see exactly when the next train is arriving on every platform.
spotangels.com API
Find real-time parking availability, pricing, and deals across supported cities by searching locations or addresses, with options to filter by parking type (hourly, monthly, free, or garages). Get detailed information about specific parking spots including rates and locations to make informed parking decisions on the go.
sentinel-hub.com API
Access satellite imagery from around the world and retrieve spectral band data, timestamps, and geographic coverage information to analyze Earth observation data. Process and generate statistics from satellite images for your specific areas of interest using powerful image processing tools.
plugshare.com API
Search for EV charging stations worldwide by location and radius. Retrieve real-time availability, connector types, user reviews, and amenity details for any station. Filter by residential or commercial property type to find chargers at apartment complexes, parking facilities, and more.