POST as GET: Get current weather by city request model

POST /api/v1/current/weather/city

POST as GET: Get current weather by city name, state code and country code; State code and country code are optional

application/json

Body Required

  • id string

    Format should match the following pattern: ^\d+$.

  • name string

    Format should match the following pattern: ^[a-zA-Z]+$.

  • stateCode string

    Format should match the following pattern: ^[a-zA-Z]{2}$.

  • countryCode string

    Format should match the following pattern: ^[a-zA-Z]{2}$.

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 available for specified parameters

POST /api/v1/current/weather/city
curl \
 -X POST http://bytemetwice.ninja/api/v1/current/weather/city \
 -H "Content-Type: application/json" \
 -d '{"id":"string","name":"string","stateCode":"string","countryCode":"string"}'
Request example
{
  "id": "string",
  "name": "string",
  "stateCode": "string",
  "countryCode": "string"
}
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"
}