title: Facebook Graph API: Find graph object from post URL
body: <p>Given the URL of a public Facebook post, how can one find the post object in the FB Graph API? (secondarily, why are so many user feeds empty or nearly empty when accessed through the API?)</p>
  
  <p>We would like to be able to <a href="https://developers.facebook.com/docs/graph-api/reference/v2.2/object/comments">comment on</a> or <a href="https://developers.facebook.com/docs/graph-api/reference/v2.2/object/likes">like</a> a post via the v2.x
  Graph API, given the post's URL. Doing so requires the post's object
  ID, which we can make some educated guesses about, but accessing
  the actual object through the API has proven unreliable (works for some posts but
  not others).</p>
  
  <p>v2 of the API introduced <a href="https://developers.facebook.com/docs/apps/upgrading/#upgrading_v2_0_user_ids">app-scoped user IDs</a>, and post IDs generally seem
  to be of the form {app-scoped user id}_{unique post id}. Here are the
  details of some attempts to find posts in the API with various combinations of
  these IDs (global user id, app-scoped user id, and post id).</p>
  
  <ul>
  <li><p>Starting with a simple example: <a href="https://www.facebook.com/evan.prodromou/posts/10153023417510505">https://www.facebook.com/evan.prodromou/posts/10153023417510505</a>. Key characteristics are that it's public, it's not a share of another post, and most importantly it has no photo(s), which add extra ids and URLs for the individual photo(s) and photo set. Evan's profile is also public, i.e. <a href="https://www.facebook.com/evan.prodromou">https://www.facebook.com/evan.prodromou</a> doesn't show the generic This content is currently unavailable</p></li>
  <li><p>Trying the bare post id from that URL, <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v1.0/10153023417510505&amp;version=unversioned&amp;">/v1.0/10153023417510505</a> and <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/10153023417510505&amp;version=unversioned&amp;">/v2.2/10153023417510505</a> both give the <em>Unsupported get request</em> (code 100) error.</p></li>
  <li><p>Evan's global user id is 525575504. Attaching that as a prefix, <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v1.0/525575504_10153023417510505&amp;version=unversioned&amp;">/v1.0/525575504_10153023417510505</a> and <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/525575504_10153023417510505&amp;version=unversioned&amp;">/v2.2/525575504_10153023417510505</a> still both give the same <em>Unsupported get request</em> error. </p></li>
  <li><p>Same error using his app-scoped user id instead, <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/10152350676805505_10153023417510505&amp;version=unversioned&amp;">/v2.2/10152350676805505_10153023417510505</a>.</p></li>
  </ul>
  
  <p>OK let's try the other direction. We'll page through the user's feed until we find the post in question. It feels like this is more the <em>expected</em> use case for the API...</p>
  
  <ul>
  <li><p>Both the global <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/525575504/posts&amp;version=unversioned&amp;">/v2.2/525575504/posts</a> and app-scoped <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=10152350676805505%2Fposts&amp;version=v2.2&amp;">/v2.2/10152350676805505/posts</a> return nothing, but <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v1.0/525575504/posts&amp;version=unversioned&amp;">/v1.0/525575504/posts</a> returns two recent posts, <a href="https://www.facebook.com/evan.prodromou/posts/10153045879215505">this like</a> and <a href="https://www.facebook.com/525575504/posts/351575675029953">this post</a>. Not sure why only those two, even though has plenty of other recent public posts. The like is fetchable via its <code>id</code> field in both api versions, i.e. <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v1.0/525575504_10153045879215505&amp;version=unversioned&amp;">/v1.0/525575504_10153045879215505</a> and <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/10152350676805505_10153045879215505&amp;version=unversioned&amp;">/v2.2/10152350676805505_10153045879215505</a>, but both API versions return the <em>Unsupported get request</em> error when fetching the post via its id field, e.g. <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v1.0/525575504_351575675029953&amp;version=unversioned&amp;">/v1.0/525575504_351575675029953</a> and <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/10152350676805505_351575675029953&amp;version=unversioned&amp;">/v2.2/10152350676805505_351575675029953</a></p></li>
  <li><p>Trying another public post, this one with pictures: <a href="https://www.facebook.com/andigalpern/posts/678121182314631">https://www.facebook.com/andigalpern/posts/678121182314631</a> . <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v1.0/100003502653187_678121182314631&amp;version=unversioned&amp;">/v1.0/100003502653187_678121182314631</a>, <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/100003502653187_678121182314631&amp;version=unversioned&amp;">/v2.2/100003502653187_678121182314631</a>, and <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/499657186827699_678121182314631&amp;version=unversioned&amp;">/v2.2/499657186827699_678121182314631</a> all error.</p></li>
  <li><p><a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v1.0/100003502653187/posts&amp;version=unversioned&amp;">/v1.0/100003502653187/posts</a> only includes one post, a like, and <a href="https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&amp;path=v2.2/100003502653187/posts&amp;version=unversioned&amp;">/v2.2/100003502653187/posts</a> is empty.</p></li>
  </ul>
  
  <p>For reference, here is <a href="https://github.com/snarfed/bridgy/issues/350">the GitHub issue</a> where we have been tracking this problem.</p>