How to get post information - facebook-graph-api

How I can get informations from post ID of any page?
I try to get it with php sdk graph but I fuiled every times.
that what I want :
Just put ID of post from any page to get informations (page, img, quote, created date, ... ).
thanks.

Your Facebook app needs the Page Public Content Access Feature. Then your can fetch post information from any page, but depending on your use case it may be hard to get a positive review.

Related

Can we get who all liked our page post in Facebook using their APIs?

I tried to consume Facebook API which need to get the list of who liked my post in my page. Is there any endpoint available in v15.0 (latest) ?
For Example:
If I have a page named "Restaurant" and i have posted a story on that page's feed as "New restaurant on the way to launch" and peoples are liking that post. I want to retrieve who and all liked that post along with the total count. How is it possible ?
Also a question, if a private account is liking that post in that "Restaurant page", how will it be counted too and can we fetch those details too ?
I have tried with the URL, https://graph.facebook.com/101882636084088/feed to get the page feeds and https://graph.facebook.com/{page-id}_{post-id}/likes, but I'm not able to fetch likes.
I also tried, https://graph.facebook.com/{page-id}_{post-id}?fields=likes.summary(true), I'm not getting proper count or who and all liked as response. Have anyone came across this scenario ?

Is it possible to get comments from facebook on a topic through graph api

i want to get comments and sub comments from facebook is it possible through their api or are there any alternatives from where i can do it .
I want the comment , date and if possible location of the user
You cannot get a user's location, but you can get the comment and date/time.
Docs can be found here https://developers.facebook.com/docs/graph-api/reference/v3.3/comment
Access would either require manage_pages and a page token valid for the respective page or Page Public Content Access feature approved.

Replicate a Facebook page and all its content

I would like to achieve the following:
GET all posts from a page and their related content (attachments, likes, visibility, tags, shares, comments, creation time...)
POST all that content in a new page
Assuming that I am admin of both pages.
I know that it's pretty straight forward to loop over the feed of a page and get all the posts' information. However, I'm not so sure about the POST part:
I guess that Facebook doesn't allow to "clone" people's
like/shares/comments below each post, on their behalf?
Considering that I will delete the first page, will all attachments disappear from Facebook's servers as well?
You cannot post in behalf of another user. And you cannot get all information you need with the Graph API.
What about renaming the page? If you like to delete the first page and clone it before, it looks like a rebranding or something ...

Any Method to Get number of LIKES of a URL or PAGE of Facebook?

i am trying to show number of likes on my website of my page but i dont want that facebook widget. Please help me - Any API Request that i can use to pull number of likes.
Thanks in advance
Yes, you can do this easily with Facebook Graph API.
There are two options:
if you want to get number of likes of some Page or URL, use this piece of code:
https://api.facebook.com/method/fql.query?query=select%20like_count%20from%20link_stat%20where%20url=%27http://www.facebook.com/facebook/%27&format=json
NOTE that you need to change the part where i wrote URL that's http://www.facebook.com/facebook
The New Graph API provides a minimal pull request code e.g.
http://graph.facebook.com/[Type your Page USERNAME here]?fields=likes
Here replace [Type your page username] part with username e.g.
http://graph.facebook.com/facebook?fields=likes`
and it will give you an output like:
{
"id": "20531316728",
"likes": 92990262
}
I hope this helps and fulfills your purpose.

Facebook PHP SDK : Post a Check in without a PAGE_ID

I would like to know If it's possible to add a Check in on Facebook with PHP but without any Page id.
Because I have a database with a lot of places but I do not have a corresponding Facebook Page Id.
ANy idea?
To my knowledge, it is not possible to do a Check In without a page_id.
You can refer to How to get place_id before checkin? to find out how to get Facebook Page Id for your places.