2016-02-24 17 views
30

Facebookはちょうど新しい反応ボタンをリリースしましたが、グラフAPI v2.5からこの情報を取得する方法はわかりません。/ likesエッジはインタラクションの合計数を返します。Facebook API Reactions with Graph API

投稿ごとにこの詳細な反応を得る方法を知った人はいませんか?

+3

すべてのリクエストのために今のように方法はありませんではない、反応が今日ロールアウトされています。それはすぐにAPIにすぐに来るでしょう。 – luschn

+1

Facebookからの公式な言葉はありませんが、これは利用可能になりますが、私は彼らが反応を完全に取り除くか、データを得るためのエッジを提供すると確信しています。 – jimplode

+1

ちょうどそれがchangelogでポップアップするのを待つ:https://developers.facebook.com/docs/apps/changelog – luschn

答えて

10

EDIT:4月12日、2016年の時点でFacebookは反応がGraphAPI

GETの/v2.6/{object-id}/reactions

の彼らのV2.6リリースの一部としてポストのエンドポイント公開しています

詳しい情報はここで見つけることができます:https://developers.facebook.com/docs/graph-api/reference/post/reactions

のEND EDIT

私はFacebookがこれをまだ公開しているかどうかわからないんだけど、反応情報は、グラフAPI v2.5の中で現在利用可能です。私は以下の回答を貼り付けた。私は洞察の終点を打つことによってこの結果を達成しました。以下のレスポンスに記載されている各オブジェクトについて、 'id'プロパティを見てください。より詳細なクエリのエンドポイントがあります。

GET /v2.5/{object-id}/insights 

応答:

{ 
    "name": "post_reactions_like_total", 
    "period": "lifetime", 
    "values": [ 
    { 
     "value": 0 
    } 
    ], 
    "title": "Lifetime Like Reactions", 
    "description": "Lifetime: The total number of like reactions to your post.", 
    "id": "{node_id}/insights/post_reactions_like_total/lifetime" 
}, 
{ 
    "name": "post_reactions_love_total", 
    "period": "lifetime", 
    "values": [ 
    { 
     "value": 0 
    } 
    ], 
    "title": "Lifetime Love Reactions", 
    "description": "Lifetime: The total number of love reactions to your post.", 
    "id": "{node_id}/insights/post_reactions_love_total/lifetime" 
}, 
{ 
    "name": "post_reactions_wow_total", 
    "period": "lifetime", 
    "values": [ 
    { 
     "value": 0 
    } 
    ], 
    "title": "Lifetime Wow Reactions", 
    "description": "Lifetime: The total number of wow reactions to your post.", 
    "id": "{node_id}/insights/post_reactions_wow_total/lifetime" 
}, 
{ 
    "name": "post_reactions_haha_total", 
    "period": "lifetime", 
    "values": [ 
    { 
     "value": 0 
    } 
    ], 
    "title": "Lifetime Haha Reactions", 
    "description": "Lifetime: The total number of haha reactions to your post.", 
    "id": "{node_id}/insights/post_reactions_haha_total/lifetime" 
}, 
{ 
    "name": "post_reactions_sorry_total", 
    "period": "lifetime", 
    "values": [ 
    { 
     "value": 0 
    } 
    ], 
    "title": "Lifetime Sorry Reactions", 
    "description": "Lifetime: The total number of sorry reactions to your post.", 
    "id": "{node_id}/insights/post_reactions_sorry_total/lifetime" 
}, 
{ 
    "name": "post_reactions_anger_total", 
    "period": "lifetime", 
    "values": [ 
    { 
     "value": 0 
    } 
    ], 
    "title": "Lifetime Anger Reactions", 
    "description": "Lifetime: The total number of anger reactions to your post.", 
    "id": "{node_id}/insights/post_reactions_anger_total/lifetime" 
}, 
{ 
    "name": "post_reactions_by_type_total", 
    "period": "lifetime", 
    "values": [ 
    { 
     "value": { 
     "like": 0, 
     "love": 0, 
     "wow": 0, 
     "haha": 0, 
     "sorry": 0, 
     "anger": 0 
     } 
    } 
    ], 
    "title": "Lifetime Reactions by type", 
    "description": "Lifetime: The total number of reactions to your post by type.", 
    "id": "{node_id}/insights/post_reactions_by_type_total/lifetime" 
} 
+0

これはコメントの写真からでしたか?私が見ている写真でそれを見つけることはできません...そして、二重チェックのための私のコメントのIDを見つけるのは難しいです。 –

+0

[OK]をもう少し研究しました...洞察はページ/ドメイン/投稿のみで利用でき、投稿数は30人以上の投稿のみ可能です。 src:https://developers.facebook.com/docs/graph-api/reference/v2.5/insights/ –

+1

は、Insights APIにかなりの遅延があり、誰かが変更した場合に反応を2倍にするというメモを追加する必要があります(誰かが最初に恋愛反応をしてからそれを笑に変えれば、愛と笑はともに1になります)。実際の反応APIを使用してリアルタイムの結果を得ようとすると、残念ながら合計数を解析する必要があります。 – dprogramz

3

次のバージョンのGraphAPI(2.6)は、3月/ 4月のタイムフレームに予定されています。

3

新反応は絵:私は代を追加したいのでhttp://i.stack.imgur.com/d6kcp.jpg

このトピックについての情報はありません。

次のバージョンのGraphAPI(2.6)は、3月/ 4月のタイムフレームに予定されています。 (ありがとう、Justin Bowler)

今、グラフのapi 2.5の新しいfacebookの反応は数えません。 あなたがポスト好きを見ると、あなたはそれらを見ることができませんので、私たちは新しいAPIバージョンを待つ必要があります。

1

新しい反応は今のところカウントされていません。現在のAPIは、ボタンのような、ワウ、悲しい、ETCのクリック数はバケツに集計されていません。

2

これらの反応は、Insights API v2.5で既に利用可能です。投稿レベルでpost_reactions_by_type_totalエッジとページレベルでpage_actions_post_reactions_totalエッジを介して取得できます。

+0

ライブビデオのためにこのAPIをどのように呼び出すべきか考えていますか?私はそれのためのアプリを作るべきであるか、またはwebhookか何かのような他の方法があるかどうかを教えてください。どうすれば私は始めるのですか? – Rickie

6

FacebookでリリースされたばかりのグラフAPI 2。6、反応終点がここ

{ 
    "data": [ 
    { 
     "id": "ACCOUNT-ID", 
     "name": "ACCOUNT-NAME", 
     "type": "HAHA" 
    }, 
    { 
     "id": "ACCOUNT-ID", 
     "name": "ACCOUNT-NAME", 
     "type": "LIKE" 
    } 
    ], 
    "paging": { 
    "cursors": { 
     "before": "TkRZAMU9EWTROakF6TmpBM01qYzJPak2TnpnNE5qUTRNRE0zT1RFek16RXkZD", 
     "after": "TVRBd01EQTNOekEwTWpnME1EUTJPakUwTazJNVFl4TXc9PQZDZD" 
    } 
    } 
} 

詳細に関する情報のようなものを返されたので

GET /v2.6/{object-id}/reactions 

のように提供されています:https://developers.facebook.com/docs/graph-api/reference/post/reactions/

2

を返す

GET /v2.5/{post_id}/insights/post_reactions_by_type_total 

試してみてください

{ 
"data": [ 
    { 
    "name": "post_reactions_by_type_total", 
    "period": "lifetime", 
    "values": [ 
     { 
      "value": { 
       "like": 9, 
       "love": 0, 
       "wow": 1, 
       "haha": 0, 
       "sorry": 0, 
       "anger": 0 
      } 
     } 
    ], 
    "title": "Daily total post reactions by type.", 
    "description": "Daily total post reactions by type.", 
    "id": "{post_id}/insights/post_reactions_by_type_total/lifetime" 
    } 
], 
} 

私はFacebookのグラフAPI 2.3で同じを使用して、いくつかの運を持っていたが、

+0

これはページアクセストークン。他のユースケースにはアクセスできない可能性があります。 – Dean