Producer
The Ably API Streamer makes it easy and cost-effective for organizations and developers to offer realtime APIs, at any scale. It provides a unified solution for publishing, managing and distributing realtime data via open protocol APIs, all built on the global Ably Platform. API Streamer, amongst other things, is being used to share live sports scores and financial market data, mobility IoT data such as GPS locations, and SaaS integration updates in real time.
Using the API Streamer to publish data streams
You can share your realtime data streams with consumers in three distinct steps: 1) Deploy, 2) Manage and 3) Distribute.

Deploy
Event-driven and realtime data, by its very nature, needs to flow from the producer to the consumer with the lowest possible latency. Given producers in most cases are decoupled from consumers of data, and not all data that is published is needed by all subscribers, the publish/subscribe pattern is most commonly used in systems designed to deliver realtime data as streams of events or messages.
In the first step of publishing data streams, you’ll need to set up an app on the Ably app dashboard or use one of the existing apps. By default, all the Ably accounts come with two pre-loaded apps called ‘Production’ and ‘Sandbox’. If you are just trying out the API Streamer for the first time, we recommend you use the ‘Sandbox’ app to get up and running quickly.
Ably fundamentally organizes all the data into units called channels. In order to deploy your data into your Ably apps, you’ll need to publish it to one or more channels.
You can do this by either by using our Realtime Client SDKs, our REST Client SDKs, our MQTT adapter, or directly using our raw REST API (although this last option isn’t recommended as it is inferior to our SDKs in terms of performance and resilience).
In most cases, if you are only publishing your data streams and not expecting a two-way communication between you and the consumer of the data, the most efficient way is to use the REST Client SDKs.
You authenticate yourself using the API Key in your app, and start publishing your data into one or more channels. Additionally, if your publisher is not secure enough to embed API Keys directly, you can set up a separate authentication server and issue tokens to your publisher who can then use them to authenticate with Ably before being able to publish.
Deploying data streams using Ably’s REST Client SDKs
Using Ably’s REST Client SDKs to deploy your data streams to one of your apps is very easy. Note: You can choose the language of your choice from the navbar on the top of this page to see an example in that language.
The following example shows a mock data stream by repeating the publish action at regular intervals.
var rest = new Ably.Rest('<loading API key, please wait>');
var channel = rest.channels.get('sax-pan-boo');
setInterval(function(){
channel.publish('example', 'message data');
}, 3000);
Demo OnlyCopyCopied!
Deploying data streams using Ably’s Realtime Client SDKs
Using Ably’s Realtime Client SDKs to deploy your data streams to one of your apps is very easy. Note: You can choose the language of your choice from the navbar on the top of this page to see an example in that language.
The following example shows a mock data stream by repeating the publish action at regular intervals.
var realtime = new Ably.Realtime('<loading API key, please wait>');
var channel = realtime.channels.get('sax-pan-boo');
setInterval(function(){
channel.publish('example', 'message data');
}, 3000);
Demo OnlyCopyCopied!
Manage
After you’ve successfully set up your app and know how to deploy your data streams into them, you can set up products to manage those data streams. Products allow you to distribute different subsets of data streams within your apps to different consumers.
In your API Streamer producer dashboard’s products tab, you can create new Products. While doing so, you can select the app into which you have deployed the data streams you intend to share using that Product. You can then specify a channel namespace, which is essentially a name given to the logical subset of the data in your app that you wish you share. For example, if you are publishing transport data to one of your apps called Public Transport Data
, you could be publishing the data related to buses into the namespace called bus
and the data related to trains into another namespace called train
. You can then create two separate products, one for each of these namespaces to be distributed to the same or different sets of consumers.
The concept of channels explained earlier brings further categorization to each of these namespaces. For instance, the bus data for London and Manchester could go in two channels bus:london
and bus:manchester
. A product created using the namespace bus
will give its consumers access to all the channels that are part of that namespace, in this case london
and manchester
.

Distribute
After you’ve set up products to manage the data within your apps, it’s time to distribute them to the consumers of data. You can do this by setting up subscriptions in your API Streamer producer dashboard.
Creating new subscriptions is an easy way to give access to one or more of your products to the intended consumers of your data. When setting up subscriptions, you can also specify how your consumers will be charged for the data they consume. You have the options for bearing all the charges yourself, letting Ably bill the consumers directly for what they consume or even set up a custom option where you incur their charges up to a certain limit and Ably will charge them directly for any messages consumed over that limit.

After you’ve set up new subscriptions, your intended consumers will automatically receive an invitation via email to use the data streams they’ve been given access to, with the pricing agreements you’ve specified in the subscription.
Next up
You are currently in the producer page of the API Streamer documentation. You can read more about: