Live Comments

This endpoint allows you to subscribe to real-time comments on Live Videos.

Creating

This operation is not supported.

Reading

Returns comments of a Live Video in real-time.

Permissions

To get comments for a Live Video on a User's or Group's timeline, you need:

  • A User access token that is able to see the Live Video.

To get comments for a Live Video on a Page, you need:

  • A Page access token that is able to see the Live Video.

Example

To subscribe to real-time comments on Live videos, send a GET request to:

https://streaming-graph.facebook.com/{live-video-id}/live_comments

Sample Request

GET https://streaming-graph.facebook.com/{live-video-id}/live_comments?
  access_token=[user-access-token]&
  comment_rate=one_per_two_seconds&
  fields=from{name,id},message
var source = new EventSource("https://streaming-graph.facebook.com/{live-video-id}/live_comments?access_token={access-token}&comment_rate=one_per_two_seconds&fields=from{name,id},message");
source.onmessage = function(event) {
  // Do something with event.message for example
};

Sample Response

[
  { "from": { name: "Joe Commenter", "id": 126577551217199 },
    "message": "Great photo!" }
]

Comment Rate

The comment_rate parameter can be used to specify the maximum comment rate that you want to receive. Note that comments are prioritized based on quality so if the comment rate exceeds the requested rate then you will receive the higher quality comments.

ValueDescription

one_per_two_seconds

Up to one comment will be delivered per two seconds. This is best if you intend to directly display comments to someone.


Note that (as with all rates, but it's more noticeable at a lower rate) the delivered comment will be the highest quality recent comment.

ten_per_second

Up to ten comments will be delivered per second. This is best if your comments are ingested by some system that is doing extra processing and analysis. For most normal broadcasts this will be sufficient to receive every comment.

one_hundred_per_second

Up to one hundred comments will be delivered per seconds. This is sufficient to receive every comment even on extremely popular broadcasts.

Fields

FieldDescriptionType

id

The comment ID.

string

attachment

Link or photo attached to the comment.

StoryAttachment

can_remove

Whether the viewer can remove this comment.

boolean

can_hide

Whether the viewer can hide this comment. Only visible to a page admin.

boolean

can_like

Whether the viewer can like this comment.

boolean

created_time

The time this comment was made.

datetime

from

The person that made this comment.

User

message

The comment text.

string

message_tags

An array of Profiles tagged in message.

Object[] (see below)

object

For comments on a photo or video, this is that object. Otherwise, this is empty. For Live Comments it will always be the Video.

Object

Message Tag Object

FieldDescriptionType

id

ID of the profile that was tagged.

string

name

The text used in the tag.

string

type

Indicates which type of profile is tagged.

enum{user, page, group}

offset

Where the first character of the tagged text is in the message, measured in unicode code points.

integer

length

How many unicode code points this tag consists of, after the offset.

integer

Updating

This operation is not supported.

Deleting

This operation is not supported.

Error Codes

HTTP Response Code Name What To Do

400

Bad Request

Check that the URL structure and parameters are correct

401

Unauthorized

Make sure your app has the right permissions and that the access token is valid.

500

Internal server error

Try again.