Get current weather by city

GET /api/v1/current/weather/city

Get current weather by city ID or city name; State code and country code are optional

Query parameters

  • id string

    ID of the City; Required Field

  • name string

    Name of City; Required Field

  • stateCode string

    State Code; Optional Field

  • countryCode string

    Country Code; Optional Field

Responses

  • 400

    Bad Request, Please verify the request parameters and try again

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • currentWeather object
      Hide currentWeather attributes Show currentWeather attributes object
      • coord object
        Hide coord attributes Show coord attributes object
        • lon number(double)
        • lat number(double)
      • weather array[object]
        Hide weather attributes Show weather attributes object
        • id integer(int32)
        • main string
        • description string
        • icon string
      • base string
      • main object
        Hide main attributes Show main attributes object
        • temp number(double)
        • feels_like number(double)
        • temp_min number(double)
        • temp_max number(double)
        • pressure integer(int32)
        • humidity integer(int32)
        • sea_level integer(int32)
        • grnd_level integer(int32)
      • visibility integer(int32)
      • wind object
        Hide wind attributes Show wind attributes object
        • speed number(double)
        • deg integer(int32)
        • gust number(double)
      • rain object
        Hide rain attribute Show rain attribute object
        • 1h number(double)
      • clouds object
        Hide clouds attribute Show clouds attribute object
        • all integer(int32)
      • dt integer(int64)
      • sys object
        Hide sys attributes Show sys attributes object
        • type integer(int32)
        • id integer(int32)
        • country string
        • sunrise integer(int32)
        • sunset integer(int32)
      • timezone integer(int64)
      • id integer(int64)
      • name string
      • cod integer(int32)
    • message string
  • 404

    Weather information not found for specified parameters

GET /api/v1/current/weather/city
curl \
 -X GET http://bytemetwice.ninja/api/v1/current/weather/city
Response examples (200)
{
  "currentWeather": {
    "coord": {
      "lon": 42.0,
      "lat": 42.0
    },
    "weather": [
      {
        "id": 42,
        "main": "string",
        "description": "string",
        "icon": "string"
      }
    ],
    "base": "string",
    "main": {
      "temp": 42.0,
      "feels_like": 42.0,
      "temp_min": 42.0,
      "temp_max": 42.0,
      "pressure": 42,
      "humidity": 42,
      "sea_level": 42,
      "grnd_level": 42
    },
    "visibility": 42,
    "wind": {
      "speed": 42.0,
      "deg": 42,
      "gust": 42.0
    },
    "rain": {
      "1h": 42.0
    },
    "clouds": {
      "all": 42
    },
    "dt": 42,
    "sys": {
      "type": 42,
      "id": 42,
      "country": "string",
      "sunrise": 42,
      "sunset": 42
    },
    "timezone": 42,
    "id": 42,
    "name": "string",
    "cod": 42
  },
  "message": "string"
}