Alright, So I am making a website that will have groups of pages, on those pages it will have the ability for a user to paste a Facebook page URL. How would I go about using their API to retrieve that pages news feed? It baffles me that Facebook expects everyone to know how to use it. I am new to this whole API thing and the documentation is not very clear. Any and all help would be appreciated.

Dani AI

Generated

— short, practical plan and a few gotchas so you can move from "paste URL" to a feed on your site. is right that the docs exist, but here’s a concrete workflow and what usually trips people up.

  1. Resolve the URL to a page identifier, then to a numeric page ID. Extract the last path segment from the Facebook URL (the vanity name or numeric ID) and query the Graph endpoint for that identifier to get the page’s id. (stackoverflow.com)

  2. Choose the correct edge: use /{page-id}/posts to return only posts authored by the Page itself; use /{page-id}/feed if you also want visitor posts. That difference is why people see unexpected results. (stackoverflow.com)

  3. Tokens & permissions: if you control the Page, call the Graph API with a Page Access Token (you can fetch it with GET /{page-id}?fields=access_token using a user token that has page permissions). If you need content from pages your app doesn’t manage, Facebook requires either the pages_read_engagement permission or an approved “Page Public Content Access” feature (app review). Expect an OAuthException if you don’t have the right token/feature. (stackoverflow.com)

Example (PHP — replace placeholders, handle paging and errors):

$graph = "https://graph.facebook.com/v16.0/{$page_id}/posts?fields=message,created_time&access_token={$page_access_token}";
$ch = curl_init($graph);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close($ch);
$data = json_decode($json, true);

Troubleshooting checklist: confirm you’re using a Page (not user) access token; check for OAuth errors (code 10/100 commonly mean missing permissions or review); implement server-side caching to avoid rate limits and improve page speed; if you don’t want API complexity, the Facebook Page Plugin is a reliable fallback for simple embedding.

Facebook does not expect everybody to know this. That's why they wrote documentation on the api after all. If you don't understand it, well, there's a lot to find about it.

Page object: http://developers.facebook.com/docs/reference/api/page/
Example json return: (for http://www.facebook.com/platform)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.