Webhooks and Pushed Data
Xweather API data can also be consumed via server-push instead of polling for data. Webhooks are particularly useful when your application needs to consume large amounts of data efficiently and in a timely manner. With this push strategy, Xweather can send data to your application with as little delay and latency as possible.
Contact us to learn more (opens in a new tab) about our webhooks.
What are webhooks?
Webhooks are a way for a server to push data to a client, as opposed to the typical HTTP GET request sent by an application or browser to a server. The user provides an HTTP URL for our webhooks system to POST data to. Your application can then react to that data and process it as instructed.
Common use cases for webhooks
- A list of all alerts in the US
- Every new lightning strike
- Updates of station observations in a bounding box
- Automated notifications warning customers, facilities, and assets of incoming severe weather
Using webhooks
Webhooks use standard HTTP or HTTPS to communicate. Our system sends a POST request to your server containing an update for the data set you requested. Data is sent in the same response format as it is returned by the Xweather API. This greatly simplifies the adoption and transition from a poll-based architecture to a push-based architecture of your application. Your server should quickly return a response to our server indicating that you received the data (typically a 201 status code) and then you can further process the data as you see fit.
You should create a web service that can receive POST requests at an endpoint. This endpoint may use a secret key in the path for our service to hit (a shared key auth scheme) or another scheme may be possible if you have specific needs. You may register multiple URLs with our service for your different dev, staging, and production environments.
Which endpoints support webhooks?
Most of our endpoints are available with our webhooks delivery format. Some of the most common include:
alerts, fires, lightning, tropicalcyclones
Other available endpoints:
airquality, earthquakes, lightning/threats, observations, rivers, stormreports, stormcells
Getting Started
To get started, contact our sales team (opens in a new tab) for more information, pricing, and security considerations.