FHMZ API

February 7/2020

FHMZ API project

Main purpose of this project is to make modular API that can be used on any platform.

  • Type of the API: REST API

API structure:

API returns nested JSON

API endpoints:

GET

  • /city?="cityname"/
  • /log?=42.9234&lat?=23.234/

response:

{
   status: 200,
   idx: "..."
   data: {
      aqi: 70,
      time: {
         s: "2020-02-11 12:00:00"
      },
      city: {
         name: "Zenica",
         url: "https://source",
         geo: [
            "42.1231",
            "12.123123"
         ]
      },
      iaqi: {
         pm25: "...",
         pm10: "...",
         so2: "...",
         co: "...",
         o3:"...",
         no2: "..."
         ....

      }
   }
   api_creator:"@nedimf(https://github.com/nedimf")
}

GET search

  • /search&query?="...."

Return type nested array of all cities that query can find

  • /search?=idx

Return type nested array of all cities that query can find by idx

response:

{
    "status": 200,
    "data": [
        {
            "uid": 11293,
            "aqi": "159",
            "time": {
                "tz": "+05:30",
                "stime": "2020-02-08 00:00:00",
                "vtime": 1581100200
            },
            "station": {
                "name": "bangalore; Silk Board, Bengaluru, India",
                "geo": [
                    12.917348,
                    77.622813
                ],
                "url": "india/bengaluru/silk-board",
                "country": "IN"
            },
            "iaqi":{
            "so2":"..."
            ...
        }
      },
        {
            "uid": 11270,
            "aqi": "155",
            "time": {
                "tz": "+05:30",
                "stime": "2020-02-08 00:00:00",
                "vtime": 1581100200
            },
            "station": {
                "name": "bangalore; Hombegowda Nagar, Bengaluru, India",
                "geo": [
                    12.938539,
                    77.5901
                ],
                "url": "india/bengaluru/hombegowda-nagar",
                "country": "IN"
            },
            "iaqi":{
            "so2":"..."
            ...
        }
        },
        {
            "uid": 11276,
            "aqi": "154",
            "time": {
                "tz": "+05:30",
                "stime": "2020-02-07 22:00:00",
                "vtime": 1581093000
            },
            "station": {
                "name": "bangalore; Jayanagar 5th Block, Bengaluru, India",
                "geo": [
                    12.920984,
                    77.584908
                ],
                "url": "india/bengaluru/jayanagar-5th-block",
                "country": "IN"
            },
            "iaqi":{
            "so2":"..."
            ...
        }
        },
        {
            "uid": 3758,
            "aqi": "153",
            "time": {
                "tz": "+05:30",
                "stime": "2020-02-08 00:00:00",
                "vtime": 1581100200
            },
            "station": {
                "name": "Peenya, Bangalore, India",
                "geo": [
                    13.0339,
                    77.51321111
                ],
                "url": "india/bangalore/peenya",
                "country": "IN"
            }
        },
        {
            "uid": 11428,
            "aqi": "152",
            "time": {
                "tz": "+05:30",
                "stime": "2020-02-08 00:00:00",
                "vtime": 1581100200
            },
            "station": {
                "name": "bangalore; Hebbal, Bengaluru, India",
                "geo": [
                    13.029152,
                    77.585901
                ],
                "url": "india/bengaluru/hebbal",
                "country": "IN"
            },
            "iaqi":{
            "so2":"..."
            ...
        }
        },
        {
            "uid": 11312,
            "aqi": "151",
            "time": {
                "tz": "+05:30",
                "stime": "2020-02-08 00:00:00",
                "vtime": 1581100200
            },
            "station": {
                "name": "bangalore; Bapuji Nagar, Bengaluru, India",
                "geo": [
                    12.951913,
                    77.539784
                ],
                "url": "india/bengaluru/bapuji-nagar",
                "country": "IN"
            }
        },
        {
            "uid": 8686,
            "aqi": "142",
            "time": {
                "tz": "+05:30",
                "stime": "2020-02-07 23:00:00",
                "vtime": 1581096600
            },
            "station": {
                "name": "City Railway Station, Bangalore, India",
                "geo": [
                    12.9773472,
                    77.570697222222
                ],
                "url": "india/bangalore/city-railway-station",
                "country": "IN"
            },
            "iaqi":{
            "so2":"..."
            ...
        }
        },
        {
            "uid": 8687,
            "aqi": "77",
            "time": {
                "tz": "+05:30",
                "stime": "2020-02-08 00:00:00",
                "vtime": 1581100200
            },
            "station": {
                "name": "SaneguravaHalli, Bangalore, India",
                "geo": [
                    12.9916694,
                    77.545830555556
                ],
                "url": "india/bangalore/saneguravahalli",
                "country": "IN"
            },
            "iaqi":{
            "so2":"..."
            ...
        }
        }
    ]
   api_creator:"@nedimf(https:github.com/nedimf")
}