Xamu Countries

Public REST API with countries data, based on @dr5hn countries database .

Use the nuxt module for faster responses.

Currently we are hosted on render free tier, which spins downs with inactivity, delaying some responses up to 50 secs.

Get started

Endpoints

Countries

Type<Country[]>

Get all countries . To get translations use the "lang" query.

Supported translations are: kr, pt, nl, hr, fa, de, es, fr, ja, it, cn, tr.

Country

Type<Country>

Get a especific country .

The match could be made using the country iso2 code or any of the supported snake case name translations.

Include the states using the "states" query.

Use the "cities" query to include the cities of each state as well, requires the "states" query.

State

Type<State>

Get especific state . Include the cities using the "cities" query.

The match could be made using the state iso2 code or the snake case name.

Use the "country" query to include the country as well.

City

Type<City>

Get especific city .

The match could be made using the city snake case name.

Use the "state" query to include the state as well.

Use the "country" query to include the country as well.

Types

interface City {

name: string;

state?: State; # With "state" querie

country?: Country; # With "country" querie

}

interface State {

name: string;

code: string;

latitude: string;

longitude: string;

cities?: City []; # With "cities" querie

country?: Country; # With "country" querie

}

interface Country {

name: string;

code: string;

indicative: string;

currency: string;

emoji: string;

latitude: string;

longitude: string;

states?: State []; # With "states" querie

}

About the project

Source: @xamu-co/countries-api . Built with Xamu UI . Powered by Nuxt3 .

This is an open source project, built and mantain by @vis97c . Feel free to use it on your projects or suggest improvements.