Warning

The username or password typed are wrong.

Warning

You need to insert username and password

Warning

There is something wrong with your username or email...

Warning

There is something wrong with the data you have typed

Warning

Email already taken.

Warning

Username already taken.

Warning

Insert a valid email address.

Warning

You need to insert email and message

Warning

You need to insert name and description app

Warning

You need to insert username, password & email.

Success

Email sent!

Success

You just sent a ThankUmbrella!

Success

Congrats, app created!

Success

App edited correctly!

Warning

Some problem on updating your email. Try again.

Warning

You must accept our TOS for creating an app.

Warning

You must insert a name for this app.

Warning

You must describe this app.

Success

We just sent you an email with all the necessary information to use this service!

Success

Great! You will receive an email upon launch.

Warning

Some problem on saving your data. Try again.

Warning

Some problem on creating the contract of this application, try again.

Warning

The data sent with this form seems corrupted, invalid, or manipulated.

Success

Congrats, contract created. You can create an application with this contract.

Warning

General problem on creating your contract, try again or contact us.

Warning You already subscribed to this plan. You can choose another plan or create an application.
Warning

You have to choose a plan before creating an application.

Weather API & Social weather

monitors

monitors is a collection of Monitor objects. A Monitor is an object developers can use to get push notifications from Metwit API. A Monitor in its basics is made of a description for the event it is listening for, and the instructions to push the notification back to the developer (a callback URI).

At this time there is one event type you can register.

precipitation
a precipitation Monitor is given a location to monitor for nearby precipitations. It is triggered when a precipitation phenomenon (rain, snow, hail...) happens in the proximity of the monitored location (at most once in an hour).

In order to receive push notifications for some events your application has to register a callback URI. When the event is triggered, Metwit does a POST request on the callback URI. The POST payload is the Monitor monitor object which triggered the event in JSON format.

The API to add, remove and access monitors requires your app to be authenticated with the client credentials method (i.e. with the app's client_id and client_secret). There is a limit on the number of monitors an app can register. Check our pricing plans for more information.

GET /v2/monitors/
curl -H "Authorization: Bearer $ACCESS_TOKEN" https://api.metwit.com/v2/monitors/ Answer next
{
    "objects": [
        {
            "uri": "/v2/monitors/precipitation_11991095671986930713/",
            "geo": {
                "type": "Point",
                "coordinates": [
                    11.23765,
                    44.00691
                ]
            },
            "id": "precipitation_11991095671986930713",
            "callback_uri": "http://new.example.com/my-weather-callback",
            "monitor_type": "precipitation"
        },
        {
            "uri": "/v2/monitors/precipitation_690907710964466985/",
            "geo": {
                "type": "Point",
                "coordinates": [
                    11.23765,
                    44.00691
                ]
            },
            "id": "precipitation_690907710964466985",
            "monitor_type": "precipitation"
        }
    ],
    "meta": {}
}  
                          

Return monitors the app has registered

POST /v2/monitors/
curl -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-type: application/json" -X POST -d '{"monitor_type":"precipitation","callback_uri":"http://example.com/my-weather-callback", "geo": {"lat":44.00691,"lng":11.23765}}' https://api.metwit.com/v2/monitors/ Answer next
{
    "uri": "/v2/monitors/precipitation_11991095671986930713/",
    "geo": {
        "type": "Point",
        "coordinates": [
            11.23765,
            44.00691
        ]
    },
    "id": "precipitation_11991095671986930713",
    "callback_uri": "http://example.com/my-weather-callback",
    "monitor_type": "precipitation"
}
                          

Register a new monitor.

PUT /v2/monitors/
curl -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-type: application/json" -X PUT -d '{"monitor_type":"precipitation","callback_uri":"http://new.example.com/my-weather-callback", "geo": {"lat":44.00691,"lng":11.23765}}' https://api.metwit.com/v2/monitors/precipitation_11991095671986930713/ Answer next
{
    "uri": "/v2/monitors/precipitation_11991095671986930713/",
    "geo": {
        "type": "Point",
        "coordinates": [
            11.23765,
            44.00691
        ]
    },
    "id": "precipitation_11991095671986930713",
    "callback_uri": "http://new.example.com/my-weather-callback",
    "monitor_type": "precipitation"
}
                          

Update a monitor.

PATCH /v2/monitors/
curl -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-type: application/json" -X PATCH --data '{"callback_uri": "http://example.com/new-weather-callback"}' https://api.metwit.com/v2/monitors/precipitation_11991095671986930713/ Answer next
HTTP/1.1 202 ACCEPTED
Date: Fri, 17 May 2013 07:28:27 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: gunicorn/0.13.4
Vary: Accept-Language, Authorization
Content-Language: en-us
                          

Update the details for a monitor.

DELETE /v2/monitors/
curl -H "Authorization: Bearer $ACCESS_TOKEN" -X DELETE https://api.metwit.com/v2/monitors/precipitation_6292375931865123662/ Answer next
HTTP/1.1 204 NO CONTENT
Date: Fri, 17 May 2013 07:35:26 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Server: gunicorn/0.13.4
Vary: Accept-Language, Authorization
Content-Length: 0
Content-Language: en-us
                          

Unregister a monitor.

Monitor

A Monitor is an object that represents a registration for a push notification event. It contains details about the event it is listening to and the callback to call when the event is triggered.

Monitor objects fields vary upon the type of the event they are listening to (monitor_type). The table below shows the fields for the precipitation monitor type.

NAME flag Tag openbook
id guaranteed string unique identifier for the Monitor object
monitor_type mandatory,guaranteed monitor-type the type of this Monitor (precipitation)
callback_uri mandatory,guaranteed string the uri that is going to be called back when the event is triggered
geo mandatory,guaranteed GeoJSON the location this precipitation Monitor is monitoring for nearby precipitations
Are you a Developer? Hack the weather in your app with our weather API Weather API