Coder Social home page Coder Social logo

lahrim / pays-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 36 KB

API vous permet de récupérer une liste des pays, avec diverses informations pour chaque pays.

Home Page: https://iso.lahrim.fr

JavaScript 96.57% HTML 2.47% CSS 0.96%
alpha2 alpha3 api countries countries-api countries-json country domaine express expressjs

pays-api's Introduction

API gratuit de liste des pays

API gratuite vous permet de récupérer une liste des pays, avec diverses informations pour chaque pays.

Démo

https://iso.lahrim.fr

Developpement local

Changer .env.exemple en .env et ajouter les informations de la base de données, puis dans le terminal à la racine du projet :

yarn install

Une fois l'installation fini :

yarn start

Si vous êtes bien connecté à la base de donnée, dans le terminal il doit afficher :

=> Bien joué mon pote („• ᴗ •„)

Url

Routes

Seul le https est pris en charge pour vos demandes.

Get /countries
Get /aleatoire
Get /alpha2/FR
Get /alpha3/FRA
Get /alpha3/France
Get /tld/.fr
Get /lang/iso/fr
Get /lang/direction/LTR
Get /phone/indicatif/33
Get /phone/length/9
Get /monetary/iso/EUR
Get /fr/countries/France
Get /fr/region/Europe
Get /fr/subregion/Europe de l'Ouest
Get /fr/lang/français
Get /en/countries/France
Get /en/region/Europe
Get /en/subregion/Western Europe
Get /en/lang/french

Exemples

Récupérez la liste des pays :

fetch("https://iso.lahrim.fr/countries")
  .then(response => response.json())
  .then(json => console.log(json))

Récupérez le pays par rapport à sont code alpha2 (deux caractères) :

fetch("https://iso.lahrim.fr/alpha2/FR")
  .then(response => response.json())
  .then(json => console.log(json))

Réponse attendu

"resultat": true,
"total": 1,
"data": [
  {
    "id": 75,
    "flag": "🇫🇷",
    "alpha2": "FR",
    "alpha3": "FRA",
    "tld": ".fr",
    "name": "France",
    "name_fr": "France",
    "name_en": "France",
    "region_fr": "Europe",
    "region_en": "Europe",
    "sub_region_fr": "Europe de l'Ouest",
    "sub_region_en": "Western Europe",
    "lang": "Français",
    "lang_fr": "Français",
    "lang_en": "French",
    "lang_iso": "fr",
    "lang_local": "fr_FR",
    "lang_direction": "LTR",
    "indicatif": "33",
    "phone_length": 9,
    "monetary": "Euro",
    "iso_4217": "EUR",
    "symbol": ""
  }
]

pays-api's People

Contributors

lahrim avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.