Welcome to Address API

Some routines to guide through API usage.
Base URL of API:
https://address.comcom.ge/
*Here and after type_id is the following: 1=ქალაქი, 2=დაბა, 3=სოფელი
To get settlement by coordinates, you have to pass latitude and longitude with parameters
note: [lat] and [lon] are parameters in request, standing for latitude and longitude respectively:
https://address.comcom.ge/api/v1/settlements/find?lat=[lat]&lon=[lon]
        

Example:

https://address.comcom.ge/api/v1/settlements/find?lat=41.4444&lon=44.4545

Output:

{
    "id": 2726,
    "en": "Kveshi",
    "ge": "ქვეში",
    "type_id": 3,
    "population": 342,
    "community": null,
    "municipality": {
        "id": 43,
        "en": "Bolnisi Municipality",
        "ge": "ბოლნისის მუნიციპალიტეტი",
        "region": {
            "id": 12,
            "en": "Kvemo Kartli",
            "ge": "ქვემო ქართლი",
            "point": null,
            "geom": null
        },
        "point": null,
        "geom": null
    },
    "point": null,
    "geom": null
}
    

If the output is empty, there might be either 2 possibilities:

To get settlement by id
{id} parameter of the settlement
https://address.comcom.ge/api/v1/settlements/{id}
        

Example:

https://address.comcom.ge/api/v1/settlements/3000

Output:

{
  "id": 3000,
  "en": "Didi Mughanlo",
  "ge": "დიდი მუღანლო",
  "type_id": 3,
  "population": 1286,
  "community": null,
  "municipality": {
    "id": 46,
    "en": "Marneuli Municipality",
    "ge": "მარნეულის მუნიციპალიტეტი",
    "region": {
      "id": 12,
      "en": "Kvemo Kartli",
      "ge": "ქვემო ქართლი",
      "point": null,
      "geom": null
    },
    "point": null,
    "geom": null
  },
  "point": "POINT (44.96443959541993 41.39226276191895)",  // VALID AUTHORIZATION HEADER REQUIRED, otherwise null
  "geom": "MULTIPOLYGON (((44.97284384765377 41.420393855236306, 44.97290029886829....)))" // VALID AUTHORIZATION HEADER REQUIRED, otherwise null
}
    
To get municipality by coordinates, you have to pass latitude and longitude with parameters
note: [lat] and [lon] are parameters in request, standing for latitude and longitude respectively:
https://address.comcom.ge/api/v1/municipality/find?lat=[lat]&lon=[lon]
        

Example:

https://address.comcom.ge/api/v1/municipality/find?lat=42.14033&lon=41.82068

Output:

{
    "id": 6,
    "en": "Lanchkhuti Municipality",
    "ge": "ლანჩხუთის მუნიციპალიტეტი",
    "region": {
        "id": 11,
        "en": "Guria",
        "ge": "გურია",
        "point": null,
        "geom": null
    },
    "point": null,
    "geom": null
}
    
To get municipality by id, you have to pass id of it.
{id} parameter of the municipality
https://address.comcom.ge/api/v1/municipality/{id}
        

Example:

https://address.comcom.ge/api/v1/municipality/33

Output:

{
    "id": 33,
    "en": "Akhmeta Municipality",
    "ge": "ახმეტის მუნიციპალიტეტი",
    "region": {
        "id": 7,
        "en": "Kakheti",
        "ge": "კახეთი",
        "point": null,
        "geom": null
    },
    "point": null,
    "geom": null
}
    
*To get geometry of municipality you have to be authorized. Same is true for the regon endpoint.
To get ALL settlements use following request:
no parameters needed
https://address.comcom.ge/api/v1/settlements
        

The output will return JSON array of all settlements currently in Database:

[
  {
    "id": integer,
    "en": "string",
    "ge": "string",
    "community": "string",
    "municipalityId": integer,
    "point": null,
    "geom": null
  }
]
    
To get ALL municipalities use following request:
no parameters needed
https://address.comcom.ge/api/v1/municipality
        

The output will return JSON array of all municipalities currently in Database:

[
  {
    "id": integer,
    "en": "string",
    "ge": "string",
    "regionId": integer,
    "point": null,
    "geom": null
  }
]
    
To get ALL regions use following request:
no parameters needed
https://address.comcom.ge/api/v1/region
        

The output will return JSON array of all regions currently in Database:

[
  {
    "id": integer,
    "en": "string",
    "ge": "string",
    "point": null,
    "geom": null
  }
]
    
To get population of the settlement:
pass settlement id as {id}
https://address.comcom.ge/api/v1/settlements/population/{id}
        

Example:

https://address.comcom.ge/api/v1/settlements/population/1655

Output:

1432
    
To get population of the municipality:
pass municipality id as {id}
https://address.comcom.ge/api/v1/municipality/population/{id}
        

Example:

https://address.comcom.ge/api/v1/municipality/population/2

Output:

16629
    
To get population of the region:
pass region id as {id}
https://address.comcom.ge/api/v1/region/population/{id}
        

Example:

https://address.comcom.ge/api/v1/region/population/7

Output:

317344
    
Authorization:
to authorize, pass following JSON object in POST request body:

{
  "username": "your_username",
  "password": "your_password"
}
        
https://address.comcom.ge/api/auth/login
        

The response will be something like:

{
    "refreshToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNzQxODY3NTQzLCJleHAiOjE3NDI0NzIzNDN9.LGj9Fv2wVcCuFwMIlE6Kl2cm59IqK-xAS1IHoo-a5o0",
    "accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNzQxODY3NTQzLCJleHAiOjE3NDE4Njg0NDN9.41ZcbjD4Lpiq2voQpdHegz3IJesClVxxyQ1vFd_mwIE"
}
        

You have to use received "accessToken" in "Authorization" header requests to endpoints in order to obtain a valid geometry for "point" and "geom" fields.

Refresh Token:
to refresh token, pass received "refreshToken" in POST request as Authorization header:

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNzQxODY3ODk2LCJleHAiOjE3NDI0NzI2OTZ9.85Kb66tFVhadwOmyoVi_sWzBq9DiEArbNGn1_995Wnc
        
https://address.comcom.ge/api/auth/refresh
        

The response will be a new "accessToken" and "refreshToken":

{
    "refreshToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNzQxODY3NTQzLCJleHAiOjE3NDI0NzIzNDN9.LGj9Fv2wVcCuFwMIlE6Kl2cm59IqK-xAS1IHoo-a5o0",
    "accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNzQxODY3NTQzLCJleHAiOjE3NDE4Njg0NDN9.41ZcbjD4Lpiq2voQpdHegz3IJesClVxxyQ1vFd_mwIE"
}
        
Logout:
Optional: you can use following endpoint to log out - pass your "accessToken".

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNzQxODY3ODk2LCJleHAiOjE3NDI0NzI2OTZ9.85Kb66tFVhadwOmyoVi_sWzBq9DiEArbNGn1_995Wnc
        
https://address.comcom.ge/api/auth/logout