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.
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.
Types
interface City {
}
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.