JavaScript

Live Examples

CoinDesk provides current pricing for Bitcoin. This data is available for free on their website. Using API Streamer, it’s easy to access this data as a realtime stream. View the documentation for this product on Ably Hub to learn how to implement this yourself.

<div class=“c-flashbox”>
</div>

OpenWeatherMap provides live weather data for almost any location over the world. This data is available for free on their website. Using API Streamer, it’s easy to access this data as a realtime stream. View the documentation for this product on Ably Hub to learn how to implement this yourself.

City:

<div class=“c-flashbox”>
</div>

Bitflyer provides current pricing for Bitcoin. This data is available for free on their website. Using API Streamer, it’s easy to access this data as a realtime stream. View the documentation for this product on Ably Hub to learn how to implement this yourself.

<div class=“c-flashbox”>
</div>

The British Broadcasting Corporation (BBC) is a British public service broadcaster. Their latest news is available for free on their website. Using API Streamer, it’s easy to access this data as a realtime stream. View the documentation for this product on Ably Hub to learn how to implement this yourself.

<div class=“c-flashbox”> <h5 id=“result-bbc-desc”></h6>
</div>

TFL publishes information such as arrivals at stations and existing disruptions into the Ably Hub. Using the Ably API Streamer, you can trivially subscribe to this data for free. See the example below:

<div> Station:
DueDestinationPlatformLine

Subscribing to a data stream product requires the producer and product identifier, and then the channel name. In the example below:

  • The producer is TFL
  • The product is Tube
  • The channel is tube:northern:940GZZLUEUS:arrivals which corresponds to Euston Underground station NAPTAN code, for the Northern Line. Find more station NAPTAN codes.
let ably = new Ably.Realtime('YOUR_API_KEY'); let channelName = '[product:ably-tfl/tube]tube:northern:940GZZLUEUS:arrivals'; let channel = ably.channels.get(channelName); channel.subscribe((msg) => { /* station update in msg */ });
Copied!