• Stars
    star
    2,210
  • Rank 20,098 (Top 0.5 %)
  • Language
    Java
  • License
    Mozilla Public Li...
  • Created over 10 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Get information about countries via a RESTful API

REST Countries

Get information about countries via a RESTful API https://restcountries.eu

Build Status

Donate!

The restcountries project has been acquired by apilayer, one of the leading providers of API microservices. We will keep supporting restcountries and providing it as a free solution for developers. We will finance this project fully and have turned off the donations feature.

Users

RESTCountries has over 1200 users, including:

TTÜ

Spotify International Pricing Index

Gorillaz

Wanderlust

Xero

FxPro

SKROSS

onefinestay

Much Better Adventures

Stay up-to-date

Follow RESTCountries on Twitter

Or subscribe to the mailing list

API Endpoints

Below are described the REST endpoints available that you can use to search for countries

All

https://restcountries.eu/rest/v2/all

Name

Search by country name. It can be the native name or partial name

https://restcountries.eu/rest/v2/name/{name}
https://restcountries.eu/rest/v2/name/eesti
https://restcountries.eu/rest/v2/name/united

Full Name

Search by country full name

https://restcountries.eu/rest/v2/name/{name}?fullText=true
https://restcountries.eu/rest/v2/name/aruba?fullText=true

Code

Search by ISO 3166-1 2-letter or 3-letter country code

https://restcountries.eu/rest/v2/alpha/{code}
https://restcountries.eu/rest/v2/alpha/co
https://restcountries.eu/rest/v2/alpha/col

List of codes

Search by list of ISO 3166-1 2-letter or 3-letter country codes

https://restcountries.eu/rest/v2/alpha?codes={code};{code};{code}
https://restcountries.eu/rest/v2/alpha?codes=col;no;ee

Currency

Search by ISO 4217 currency code

https://restcountries.eu/rest/v2/currency/{currency}
https://restcountries.eu/rest/v2/currency/cop

Language

Search by ISO 639-1 language code

https://restcountries.eu/rest/v2/lang/{et}
https://restcountries.eu/rest/v2/lang/es

Capital city

Search by capital city

https://restcountries.eu/rest/v2/capital/{capital}
https://restcountries.eu/rest/v2/capital/tallinn

Calling code

Search by calling code

https://restcountries.eu/rest/v2/callingcode/{callingcode}
https://restcountries.eu/rest/v2/callingcode/372

Region

Search by region: Africa, Americas, Asia, Europe, Oceania

https://restcountries.eu/rest/v2/region/{region}
https://restcountries.eu/rest/v2/region/europe

Regional Bloc

Search by regional bloc:

  • EU (European Union)
  • EFTA (European Free Trade Association)
  • CARICOM (Caribbean Community)
  • PA (Pacific Alliance)
  • AU (African Union)
  • USAN (Union of South American Nations)
  • EEU (Eurasian Economic Union)
  • AL (Arab League)
  • ASEAN (Association of Southeast Asian Nations)
  • CAIS (Central American Integration System)
  • CEFTA (Central European Free Trade Agreement)
  • NAFTA (North American Free Trade Agreement)
  • SAARC (South Asian Association for Regional Cooperation)
https://restcountries.eu/rest/v2/regionalbloc/{regionalbloc}
https://restcountries.eu/rest/v2/regionalbloc/eu

Response Example

https://restcountries.eu/rest/v2/alpha/col
[[{
	"name": "Colombia",
	"topLevelDomain": [".co"],
	"alpha2Code": "CO",
	"alpha3Code": "COL",
	"callingCodes": ["57"],
	"capital": "Bogotá",
	"altSpellings": ["CO", "Republic of Colombia", "República de Colombia"],
	"region": "Americas",
	"subregion": "South America",
	"population": 48759958,
	"latlng": [4.0, -72.0],
	"demonym": "Colombian",
	"area": 1141748.0,
	"gini": 55.9,
	"timezones": ["UTC-05:00"],
	"borders": ["BRA", "ECU", "PAN", "PER", "VEN"],
	"nativeName": "Colombia",
	"numericCode": "170",
	"currencies": [{
		"code": "COP",
		"name": "Colombian peso",
		"symbol": "$"
	}],
	"languages": [{
		"iso639_1": "es",
		"iso639_2": "spa",
		"name": "Spanish",
		"nativeName": "Español"
	}],
	"translations": {
		"de": "Kolumbien",
		"es": "Colombia",
		"fr": "Colombie",
		"ja": "コロンビア",
		"it": "Colombia",
		"br": "Colômbia",
		"pt": "Colômbia"
	},
	"flag": "https://restcountries.eu/data/col.svg",
	"regionalBlocs": [{
		"acronym": "PA",
		"name": "Pacific Alliance",
		"otherAcronyms": [],
		"otherNames": ["Alianza del Pacífico"]
	}, {
		"acronym": "USAN",
		"name": "Union of South American Nations",
		"otherAcronyms": ["UNASUR", "UNASUL", "UZAN"],
		"otherNames": ["Unión de Naciones Suramericanas", "União de Nações Sul-Americanas", "Unie van Zuid-Amerikaanse Naties", "South American Union"]
	}]
}]

Filter Response

You can filter the output of your request to include only the specified fields.

https://restcountries.eu/rest/v2/{service}?fields={field};{field};{field}
https://restcountries.eu/rest/v2/all?fields=name;capital;currencies

Sources

Similar projects

License

Mozilla Public License MPL 2.0

More Repositories

1

freegeoip

IP geolocation web server
Go
711
star
2

html2pdf.it

Webservice for generating pdfs from html
JavaScript
547
star
3

geolocationapi

IP Geolocation API is a free service for locating your visitors in real-time with detailed country information.
HTML
503
star
4

ratesapi

Forex conversion exchange rates api for free
Python
181
star
5

goiban-service

Implements a basic REST Web-service for validating IBAN account numbers in GO.
Go
130
star
6

numverify-API

Free global phone number validation & lookup JSON API
108
star
7

currencylayer-API

Reliable, accurate, real-time exchange rates for 168 world currencies, delivered in portable JSON format, compatible with any application. Full interactive documentation, code, integration guides and more available at https://currencylayer.com - Sign up for the Free Plan now!
104
star
8

emailpie

Crazy simple API for checking the validity of an email address.
90
star
9

aviationstack

Free, Real-Time Flight Tracker & Status REST API
71
star
10

mailboxlayer-API

mailboxlayer API - free, lightweight JSON API for Email Address Validation & Verification
62
star
11

marketstack

Free Real-Time, Intraday & Historical Stock Market Data API
58
star
12

numvalidate

Phone number validation REST API
JavaScript
57
star
13

weatherstack

Real-Time, Historical World Weather Data & Forecast API
56
star
14

euvatrates.com

Super simple (static) web service to grab VAT rates for all EU Member States, in preparation of the new 2015 VAT regulation.
HTML
53
star
15

locate.now

A simple API for IP address & geolocation lookup.
HTML
46
star
16

ipapi

Real-time Geolocation & Reverse IP Lookup JSON API
44
star
17

positionstack

Free, Real-Time Geocoding & Maps API
31
star
18

screenshotlayer-API

Screenshotlayer is a lighweight REST API built to deliver high quality PNG, JPEG & GIF website screenshots at unparalleled speeds and through a simple interface.
26
star
19

scrapestack

Real-Time Proxy & Web Scraping API
21
star
20

goiban

goiban implements functions for validating international bank account numbers using GO.
Go
20
star
21

vatlayer-API

vatlayer API - free, simple JSON API for VAT Number Validation & EU VAT Rates
20
star
22

mediastack

Free Live News JSON REST API for Global News & Blog Articles
20
star
23

userstack

Leading User-Agent Lookup & Device, Browser and OS Detection API
17
star
24

pdflayer-API

This repository is currently under construction
15
star
25

ip2countrify

A Node.js wrapper for IP2Country JSON API https://ip2country.info
JavaScript
15
star
26

euvat

euvat.ga api site
PHP
14
star
27

serpstack

Real-Time & Accurate Google Search API for Developers
12
star
28

coinlayer-API

12
star
29

languagelayer-API

Free Language Detection API for 173 Languages
12
star
30

openiban.js

openiban.com javascript client for node and the browser
JavaScript
11
star
31

ip2country.info

Source Code from ip2country.info Website and API.
CSS
10
star
32

geoip-tools

Web server that retrieves geolocation information from any IPv4, IPv6 or hostname.
JavaScript
8
star
33

goiban-data-loader

Data importer for openiban.com.
Go
8
star
34

ip2country-bot

🤖 Messenger Bot for IP 2 Country API
JavaScript
7
star
35

streetlayer-api-repo

Free, Real-Time Address Verification & Autocomplete JSON API
5
star
36

language-detection

NodeJS Library for the languagelayer API Service
JavaScript
4
star
37

screenshot-capture

screenshot-capture
JavaScript
3
star
38

giflayer-API

The first and only Video to GIF REST API for Developers
2
star
39

phone-number-validation

Global Phone Number Validation & Lookup JSON API. Real-time REST API supporting 232 countries
JavaScript
2
star
40

email-address-validation

Email Validation & Verification JSON API for Developers. Simple REST API measuring email deliverability & quality
JavaScript
2
star
41

currency-conversion

currency-conversion
JavaScript
1
star
42

servant-currency-code-array

Every ISO 4217 currency code in a javascript array. Used in Servant Content Archetype Validations.
1
star