Skip to content

Simple API delivering 🌞 β˜” weather related data via JSON.

Notifications You must be signed in to change notification settings

jobannon/sweater_weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LinkedIn Inline docs


Logo

Sweater Weather

Welcome to the Sweater Weather API


Table of Contents

About The Project

Sweater weather is a exercise in:

  • Consuming Weather data through the Dark Sky API,
  • Location data through Google Geocoding,
  • Yelp information from the Yelp Fusion API.

Built With

Getting Started

This API is hosted on Heroku Hosted

Project specs can be found here Specs

Usage/Endpoints

Run in Postman

This project exposes four endpoints. These endpoints will inform a fictitious front end

1. Create User

  • Endpoint

    • POST "<domain>/api/v1/users"
  • Required Params:

    - Returned JSON (click me):
      {
          "api_token": "qhEvzTfq6_p4KQm7_EzSJQ"
      }
  • Notes:
    • If this user is already registered, API will submit a redirect: 302 :found

2. Login User

  • Endpoint

    • POST "<domain>/api/v1/users"
  • Required Params:

    Returned JSON (click me):
      {
          "api_token": "qhEvzTfq6_p4KQm7_EzSJQ"
      }

3. Forecast

  • Endpoint

    • GET "<domain>/api/v1/forcast"
  • Required Params:

    • location:
      • IE- denver, co
    Returned JSON (click me):
      {
          "data": {
              "id": null,
              "type": "forecast",
              "attributes": {
                  "forecast_summary": {
                      "icon": "clear-day",
                      "summary": "Clear",
                      "temperature": 65.92,
                      "temperature_high": 77.76,
                      "temperature_low": 49.02,
                      "state": "denver",
                      "city": " co",
                      "time": 1588183457,
                      "date": 1588183457
                  },
                  "forecast_details": {
                      "summary": "Clear",
                      "feel_like": 65.92,
                      "humidity": 20,
                      "visiblity": "10.00",
                      "uv_index": 9,
                      "today_message": "Clear throughout the day.",
                      "tonight_message": "Clear",
                      "icon": [
                          "clear-day",
                          "Clear",
                          65.92,
                          20,
                          "10.00",
                          9,
                          "Clear throughout the day.",
                          "Clear"
                      ]
                  },
                  "forecast_days_in_review": {
                      "daily_stats": [
                          [
                              {
                                  "time": 1588140000
                              },
                              {
                                  "icon": "clear-day"
                              },
                              {
                                  "humidity": 0.3
                              },
                              {
                                  "temperatureHigh": 77.76
                              },
                              {
                                  "temperatureLow": 49.02
                              }
                          ],
                          [
                              {
                                  "time": 1588226400
                              },
                              {
                                  "icon": "partly-cloudy-day"
                              },
                              {
                                  "humidity": 0.25
                              },
                              {
                                  "temperatureHigh": 88.16
                              },
                              {
                                  "temperatureLow": 57.14
                              }
                          ],
                          [
                              {
                                  "time": 1588312800
                              },
                              {
                                  "icon": "clear-day"
                              },
                              {
                                  "humidity": 0.29
                              },
                              {
                                  "temperatureHigh": 86.44
                              },
                              {
                                  "temperatureLow": 52.09
                              }
                          ],
                          [
                              {
                                  "time": 1588399200
                              },
                              {
                                  "icon": "rain"
                              },
                              {
                                  "humidity": 0.61
                              },
                              {
                                  "temperatureHigh": 69.29
                              },
                              {
                                  "temperatureLow": 49.23
                              }
                          ],
                          [
                              {
                                  "time": 1588485600
                              },
                              {
                                  "icon": "partly-cloudy-day"
                              },
                              {
                                  "humidity": 0.42
                              },
                              {
                                  "temperatureHigh": 85.79
                              },
                              {
                                  "temperatureLow": 51.81
                              }
                          ],
                          [
                              {
                                  "time": 1588572000
                              },
                              {
                                  "icon": "clear-day"
                              },
                              {
                                  "humidity": 0.34
                              },
                              {
                                  "temperatureHigh": 80.56
                              },
                              {
                                  "temperatureLow": 48.99
                              }
                          ],
                          [
                              {
                                  "time": 1588658400
                              },
                              {
                                  "icon": "partly-cloudy-day"
                              },
                              {
                                  "humidity": 0.27
                              },
                              {
                                  "temperatureHigh": 75.02
                              },
                              {
                                  "temperatureLow": 51.9
                              }
                          ],
                          [
                              {
                                  "time": 1588744800
                              },
                              {
                                  "icon": "partly-cloudy-day"
                              },
                              {
                                  "humidity": 0.26
                              },
                              {
                                  "temperatureHigh": 81.49
                              },
                              {
                                  "temperatureLow": 43.67
                              }
                          ]
                      ]
                  },
                  "forecast_hours_in_review": {
                      "hourly_stats": [
                          [
                              {
                                  "time": 1588183200
                              },
                              {
                                  "temperature": 65.7
                              }
                          ],
                          [
                              {
                                  "time": 1588186800
                              },
                              {
                                  "temperature": 68.47
                              }
                          ],
                          [
                              {
                                  "time": 1588190400
                              },
                              {
                                  "temperature": 71.12
                              }
                          ],
                          [
                              {
                                  "time": 1588194000
                              },
                              {
                                  "temperature": 74.14
                              }
                          ],
                          [
                              {
                                  "time": 1588197600
                              },
                              {
                                  "temperature": 76.16
                              }
                          ],
                          [
                              {
                                  "time": 1588201200
                              },
                              {
                                  "temperature": 77.24
                              }
                          ],
                          [
                              {
                                  "time": 1588204800
                              },
                              {
                                  "temperature": 76.64
                              }
                          ],
                          [
                              {
                                  "time": 1588208400
                              },
                              {
                                  "temperature": 74.47
                              }
                          ],
                          [
                              {
                                  "time": 1588212000
                              },
                              {
                                  "temperature": 70.31
                              }
                          ]
                      ]
                  }
              }
          }
      }

4. Generate a RoadTrip!

  • Endpoint
    • GET "<domain>/api/v1/forcast"
  • Required Params:
    • origin:

      • IE- denver, co
    • destination:

      • IE- Fort Lupton, co
      Returned JSON (click me):
      {
          "data": {
              "id": null,
              "type": "road_trip",
              "attributes": {
                  "id": null,
                  "start_location": "kansas city, ks",
                  "end_location": "denver, co",
                  "travel_time": "8 hours 40 mins",
                  "forecast": "Possible light rain in the morning.",
                  "arrival_temperature": 60.31
              }
          }
      }

License

Distributed under the Creative Commons License.

Contact

Joshua O'Bannon - @jtobannon - jtobannon@gmail.com

Project Link: https://github.com/jobannon/sweater_weather

About

Simple API delivering 🌞 β˜” weather related data via JSON.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published