Skip to content

iamstevedavis/iot-pi-weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather

Introduction

This is a simple app that gets weather information from a third party. I wrote this to run on my pi.

Setup

  1. Run 'npm install'

API

Server Specific CRUD

GET /weather/v1/status // Get the current status of the weather app.

Response

  • Returns 200.
{}

Weather CRUD

GET /weather/v1/forecast // Get the forecast for a city based on that cities id.

Request

locationId - The city id.

Example

/weather/v1/forecast?locationId=123456

Response

{
"city": {
  "cityId": 5913695,
  "cityName": "Cambridge",
  "cityCountryCode": "CA"
},
"weatherData": [
  {
    "time": "2015-12-29 00:00:00",
    "temp": -5.28,
    "tempHigh": -3.44,
    "tempLow": -5.28,
    "humidity": 78,
    "description": "overcast clouds",
    "weatherIcon": "http://api.openweathermap.org/img/w/04n.png"
  },
  {<--->},
  {<--->},
  {<--->}
]

GET /weather/v1/find // Get the forecast for a city based on a textual search of that city.

Request

q - The search value.

Example

/weather/v1/forecast?q=Waterloo, Ontario

Response

{
  "weatherData": [
    {
      "locationId": 5913695,
      "temp": -5.29,
      "tempHigh": -4,
      "tempLow": -7,
      "humidity": 85,
      "description": "snow",
      "weatherIcon": "http://api.openweathermap.org/img/w/13d.png"
    }
  ]
}

About

An intermediary weather app for my pi.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published