RESTful API

These endpoints are created to help with cloud deployment and provide a way for another program or automated processes to interact with our service.

Health Check

Endpoint: GET /health

This endpoint is primarily created as a way to detect the health of the instances where the application is deployed to.

Expected response:

> GET /health
{
   "message": "API is available"
}

Search By ID

Endpoint: GET /<cityID>

The idea of this endpoint is to provide a more complete information about a city given its ID. For example:

> GET /lexical?cityName=Jakarta
{
   "alternate_names": [
      "Dzakarta",
      "ਜਕਾਰਤਾ",
      ...,
      "ジャカルタ",
      ...,
   ],
   "name": "Jakarta",
   "ascii_name": "Jakarta",
   "country_code": "ID",
   "longitude": 106.84513,
   "latitude": -6.21462,
   "id": 1642911,
   "population": 8540121
}