https://github.com/idimetrix/weather-api
A RESTful API to check the weather
https://github.com/idimetrix/weather-api
Last synced: about 2 months ago
JSON representation
A RESTful API to check the weather
- Host: GitHub
- URL: https://github.com/idimetrix/weather-api
- Owner: idimetrix
- License: mit
- Created: 2021-05-12T12:43:02.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T13:36:50.000Z (about 4 years ago)
- Last Synced: 2025-03-13T04:34:02.426Z (2 months ago)
- Language: Go
- Homepage: https://weather-restful.herokuapp.com/weather/Singapore
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# weather-api
[](/LICENSE)
[](https://travis-ci.org/idimetrix/weather-api)
[](https://goreportcard.com/report/github.com/idimetrix/weather-api)
[](https://godoc.org/github.com/idimetrix/weather-api)> A REST API to check the current weather.
> https://weather-restful.herokuapp.com/weather/Singapore
https://weather-restful.herokuapp.com/weather/{city}## Install
```sh
dep ensure
```
## Build
```sh
go build
```
## Run
```sh
./weather-api
```
## Usage
```sh
curl http://localhost:3000/weather/{city}
```
## Example
#### Request
```sh
curl http://localhost:3000/weather/Singapore
```
#### Response
```json
{
"temperature": "+28 °C",
"wind": "11 km/h",
"description": "Partly cloudy",
"forecast": [
{
"day": "1",
"temperature": "+30 °C",
"wind": "13 km/h"
},
{
"day": "2",
"temperature": "32 °C",
"wind": "5 km/h"
},
{
"day": "3",
"temperature": " °C",
"wind": "11 km/h"
}
]
}
```