Use Bootstrap and Stream API with Livefyre Apps

Bootstrap API

How can I retrieve content older than the newest 50 pieces?

Bootstrap is all content in a Livefyre App. It is the cached data, typically 12-20 minutes old. It is delivered in chunks of 50 pieces and is paginated so you can retrieve content older than 50 pieces.

API Reference

Example request

The example request above loads the init page which contains Collection Settings and the only initial set of ~50 pieces of newest content. To poll older content, you must load subsequent bootstrap pages with N being the page number:

Request: https://{networkName}{network}/{siteId}/{b64articleId}/N.json

For example, a sample app has 120 pieces of content. Content “1” is the oldest piece of content and Content “70” is the newest piece of content.

  • Init will load ~120-70 pieces of content in descending order:

  • O.json will load ~ 1-50 pieces of content in ascending order:

  • 1.json will load ~ 51-100 pieces of content in ascending order:

  • 2.json will load ~101-120 pieces of content in ascending order:

Click here to see the Bootstrap Poll Flowchart.

Stream API

What is Stream API?
Stream is a long poll which by design is intended to stay open for approximately 30 seconds. Description on Long Polling technique can be found here:

This long-polling endpoint streams new content (e.g. a user posts a comment), content status changes (e.g. user deletes their comment, likes) and moderation changes to content (e.g. moderator approves a piece of content) to a Livefyre App.

The request to Stream API should be ~30 seconds (long-polling) with expected timeout after 30 seconds when no new content streams in.

API Reference:

Example request:


Please note: The maxEventId in a Stream API response is the highest Event ID of the updates in this response. Use this value as lastEventId path parameter when building the URL of your next Stream API request to get updates occurring after all the updates in this response.

The example below is based on a Comments App:

Comment “First comment” was posted first. “Second Comment” was posted after.

First Comment Stream API response:


The maxEventId in the response is “1520289700953369” which will be used as lastEventId to poll the endpoint to get updates (i.e. Second Comment) occurring after all the updates in this response.

Second Comment Stream API response:


The maxEventID “1520289700953369” in the response should in turn be used as the lastEventID to build the Stream API response for the next update.

On this page