[go: nahoru, domu]

Skip to content

The 🇩🇿 API (Work in progress)

License

Notifications You must be signed in to change notification settings

saidziani/algeria-api

 
 

Repository files navigation

Algeria API

Known Vulnerabilities

A list of Algerian Wilayas, Dairas and Baladyahs.

Features

API Documentation

  • Get a list of all Wilayas GET https://localhost:3000/api/v1/wilaya

  • Get Wilaya's details: GET https://localhost:3000/api/v1/wilaya/matricule/:matricule, example:

    ~: curl -X GET -i http://localhost:3000/api/v1/wilaya/matricule/31
    
    # Response
    {
      "data": {
        "mattricule": 31,
        "name": "Oran",
        "name_ar": "وهران",
        "name_en": "Oran",
        "phoneCodes": [
          41
        ],
        "postalCodes": [
          31000,
          31001,
          ...
          31117,
          31118
        ],
        "dairats": [
          {
            "name": "AIN TURK",
            "name_ar": "AIN TURK",
            "name_en": "AIN TURK",
            "baladyiats": []
          },
          {
            "name": "ARZEW",
            "name_ar": "ARZEW",
            "name_en": "ARZEW",
            "baladyiats": []
          },
          ...
        ]
      }
    }
  • Get the adjacent (nearby wilayas)

    • Only wilaya codes /wilaya/adjacence/:matricule
    • Wilaya names /wilaya/adjacence/:matricule/names example response:
        {
        "data": {
          "names": [
            {
              "mattricule": 46,
              "name": "Ain Temouchent",
              "name_ar": "عين تموشنت",
              "name_en": "Ain Temouchent"
            },
            {
              "mattricule": 22,
              "name": "Sidi Bel Abbes",
              "name_ar": "سيدي بلعباس",
              "name_en": "Sidi Bel Abbes"
            },
            {
              "mattricule": 29,
              "name": "Mascara",
              "name_ar": "معسكر",
              "name_en": "Mascara"
            },
            {
              "mattricule": 27,
              "name": "Mostaganem",
              "name_ar": "مستغانم",
              "name_en": "Mostaganem"
            }
          ],
          "mattricules": [
            46,
            22,
            29,
            27
          ]
        }
      }
    • Short format (only wilaya names in a language and their codes)

        {
          "data": {
            "names": [
              "عين تموشنت",
              "سيدي بلعباس",
              "معسكر",
              "مستغانم"
            ],
            "mattricules": [
              46,
              22,
              29,
              27
            ]
          }
        }
  • Get postal codes by Wilaya

  • Get wilaya by postal codes

  • Get Wilaya by phone code

TODOs & Future Improvements/Features

  • Add Tamazight Translation
  • Use a DB instead of the JSON file
  • Build a dashboard to manage/correct data
  • Match each postal code withe its provinces
  • Add long/latt cordinates
  • Add XML File
  • sqlite ?

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with us before making a change. And also, please make sure to read our guidelines for contributing

Improving the API (new features, bug fixes...)

📝 🐳 🌐 🏗️ 🐛 ⚡ 👷 ✨

If you want to work on the API server, just pull this repository then run npm install

To run the development server

npm run server:dev
# or
yarn server:dev

To run in Docker

npm run docker:prod
# Or
yarn docker:prod

Improving the Wilayas List (translations, corrections...)

📝 🌐 🏗️ 🐛 ⚡ 👷 ✨

The wilaya models are auto-generated by crawling and by using the fine work of mohsenuss91/AlgerianAdministrativeDivision. If you want to contribute more by adding, correcting or improving the results... Please create an issue so we can discuss it, and then you just need to update the results on results/WilayaList.json

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

About

The 🇩🇿 API (Work in progress)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%