Introduction to data outputs and FLOW's public API

Learn how you can receive traffic data in your own application quickly and on demand with widgets and sinks.

FLOW is an open platform. It was designed to easily interact with third-party applications and devices through HTTP and UDP protocols. These advanced guides will show you how you can integrate your own solution with it. If you're not familiar with FLOW and FLOW Insights, we recommend reading the introductory articles first.

If you’re interested in receiving the output of any FLOW operator in your own application, you first need to set this up in a client application like FLOW Insights. Consider the following setup:

There’s a zone spatial filter named ZONE 1 on one of the lanes on the left. It considers only traffic objects that are within the marked zone in a given time frame. Any operator lets you assign an output (widget or sink) to it. When you do, it lets the server know that you intend to query for the operator’s output. Simply drag the desired output type onto the filter.

Then you can define the sink’s name and select an attribute the output will be tied to.

Select Apply settings and the output will be assigned.

Afterward, any client application can start communicating and querying the server as long as it's done right. There are multiple types of outputs based on their behavior and the way data is obtained from them.

Widgets and REST sinks

With widgets and REST sinks, your applications would use the HTTP protocol to send queries to the server and obtain responses. FLOW API conforms to the style and constraints of REST and message bodies use the JSON syntax. For example, the distribution widget shown above lets you retrieve a color or category distribution of trajectories that pass through the corresponding operator.

The difference between widgets and sinks is that widgets can also be viewed on FLOW Insights' dashboard. The requests to either are also sent to different endpoints.

Learn the basics of authentication and communication with FLOW's REST API in the next guide.

Then learn more about widgets and REST sinks.

To handle any errors that you might encounter, see the Error reference.

UDP sinks

UDP sinks let applications subscribe to their output via the UDP protocol. All status updates are automatically sent to every client that has subscribed until a timeout expires. Therefore UDP sinks are suitable in applications where it’s critical to know about every situation update as fast as possible. Some UDP sinks also support the query-response mode of communication, but options regarding the types of outputs are not as wide. Learn more about UDP sinks.

Webhooks

With webhooks, you can have widget data sent to your server automatically each time its value changes. Its output is very similar to REST sinks. Learn more about them here.