Municipality API

Tunisian Municipality API

Access comprehensive Tunisian municipality data with powerful filtering options. Built for developers, by developers.

Base URL

GEThttps://tn-municipality-api.vercel.app/api/municipalities

Free and open source. No API key required.

GET/api/municipalities?postalCode=2058
200
[
  {
    "Name": "ARIANA",
    "NameAr": "أريانة",
    "Value": "ARIANA",
    "Delegations": [
      {
        "Name": "ARIANA VILLE (Residence Kortoba)",
        "NameAr": "أريانة المدينة (إقامة قرطبة)",
        "Value": "ARIANA VILLE",
        "PostalCode": "2058",
        "Latitude": 36.866011,
        "Longitude": 10.193923
      },

How the data is structured

Three levels, from the governorate down to the locality, each with Arabic and English names.

Governorates
24
Delegations
261
Localities
4,788
Postal codes
958
GET/api/municipalities?name=ariana
ARIANAأريانة
  • ARIANA VILLEأريانة المدينة
    • Residence Kortobaإقامة قرطبة
      2058
    • Cite El Intissar 1حي الإنتصار 1
      2091
    • 33 more localities

  • SIDI THABETسيدي ثابت
  • 5 more delegations

API Playground

Test the API with real data.

Request URL

https://tn-municipality-api.vercel.app/api/municipalities?sort=name
API Response

Send a request to see the JSON response here.

Use it with your AI assistant

Copy a prompt that already explains the endpoints, parameters and response shape, then paste it into ChatGPT, Claude, Cursor or Copilot.

What are you building?

API Documentation

Endpoints

GET/api/municipalities
List and search municipalities
GET/api/municipalities/near
Find municipalities near a point

Base URLhttps://tn-municipality-api.vercel.app

Query parameters

Use these parameters to filter the municipality data. All parameters are optional and can be combined.

  • searchstring

    Searches governorates first, then delegations when nothing matches. Accepts English or Arabic names.

    /api/municipalities?search=ariana
  • namestring

    Filter by governorate name (e.g., Ariana, Tunis, Sfax)

    /api/municipalities?name=ariana
  • delegationstring

    Filter by delegation name within a governorate

    /api/municipalities?delegation=ville
  • postalCodestring

    Filter by exact postal code (4 digits)

    /api/municipalities?postalCode=2058
  • sortname | nameAr

    Sort governorates by name or nameAr

    /api/municipalities?sort=nameAr
  • orderasc | desc

    Sort direction, asc (default) or desc. Use together with sort.

    /api/municipalities?sort=name&order=desc
  • lat, lng, radiusnumber

    Get municipalities near a specific location within a radius (in km)

    /api/municipalities/near?lat=36.8065&lng=10.1815&radius=5

Examples

curl "https://tn-municipality-api.vercel.app/api/municipalities?name=ariana"

Example response

200 application/json
[
  {
    "Name": "ARIANA",
    "NameAr": "أريانة",
    "Value": "ARIANA",
    "Delegations": [
      {
        "Name": "ARIANA VILLE (Residence Kortoba)",
        "NameAr": "أريانة المدينة (إقامة قرطبة)",
        "Value": "ARIANA VILLE",
        "PostalCode": "2058",
        "Latitude": 36.866011,
        "Longitude": 10.193923
      }
    ]
  }
]