I try to get the comments of a post from a group that I am a member (only member) and that by the way, the group is closed, but it does not return anything ..
I try it this way: {postid}/comments
I really do not know if you're allowed what I'm trying to do. What if you let me get is information about the videos that have been posted in the group.
I have never used the Facebook API before, so I know very little about the topic.
If I remember right facebook api allows you to programmatically access content of only public groups. To get data from private/closed groups you need to be admin, as user #WizKid pointed out
Related
I want to remove my own instagram followers without blocking them, using python.
I have seen many, many, many, many instagram python libraries online that allow you to stop or start following a person, but that is not what I'm looking for; I don't want to remove who I am following or start following someone, I want to remove people who are following me.
I looked into the official documentation of Instagram's HTTP API trying to make my own solution, but I couldn't find the documentation of this action under any endpoint ( I assume it should be under /friends/ ).
I vaguely remember some library that used to do this, but I cannot find it. Does anyone know of a good way to achieve this, preferably via passing an inclusion/exclusion list for the followers I want to have as a result?
I found a solution in an old library that does something similar. You can't directly remove followers through most tools, but if you block and then unblock a user, the effect you want is achieved. Example code:
# https://instagram-private-api.readthedocs.io/en/latest/_modules/instagram_private_api/endpoints/friendships.html
import instagramPrivateApi
# ...
# Implement a Client class that inherits FriendshipMixin
api = new Client()
api.friendships_block(uid)
api.friendships_unblock(uid)
Here is the API endPoint for removing a follower https://www.instagram.com/web/friendships/{user_id}/remove_follower/
You can do a post request on this URL with appropriate headers and that can do the job.
Using Facebook's GraphAPI I am trying to post to a public group. It appears that a page by the same name also exists and it is defaulting to post to that instead.
Currently I am using
posts = graph.get("NAME_OF_GROUP/feed", page=True, limit=1):
Hopefully there is a way to default it to group over page. I cannot find much in the documentation.
Only pages have a name that they are accessible by via API. A group name is "just for people", for display purposes, it was never possible to use that to access the group in API calls. So there is no defaulting of page over group going on here; if the page did not exist at all, you would still not be able to access the group this way - the group ID is the only way to do that.
And posting to a group will require an access token from the group admin these days, https://developers.facebook.com/docs/graph-api/reference/v2.12/group/feed#publish
I'm trying to automatically delete certain comments on posts within a facebook group which I admin.
When I try and delete it, I get this:
facebook.GraphAPIError: (#3) Publishing comments through the API is
only available for page access tokens
I happen to have a page which I have a page access token for. When I use it I get:
facebook.GraphAPIError: Unsupported delete request. Object with ID
'722227087901405' does not exist, cannot be loaded due to missing
permissions, or does not support this operation. Please read the
Graph API documentation at
https://developers.facebook.com/docs/graph-api
I've set every permission possible and have also tried to see if it's possible to get a page access token for the group I admin to no avail.
Is what I'm trying to do possible or just not supported?
Also I don't know how much it matters but I'm doing this with the python SDK.
Any help would be appreciated, thank you!
I’ve seen a couple examples of this ( Storing auth tokens in a cookie )already; but I’d like to understand the reason for doing this.I think this would create more problems because you have to specifically remember to delete the cookie after you’re finished. For my specific example ; I am dealing with Instagram via the API
Thank you for any and all help
I`m not sure exactly what you're asking for. You need to know how to store the token? However, then is no need to remember to delete a cookie, just set an expiration date.
Regarding the API, you will need a valid token everytime you do a request to API, so don`t delete it, otherwise you will need to re-authenticate everytime.
Note: For Instagram Business Accounts you need to use Facebook API.
https://developers.facebook.com/docs/instagram-api/v2.10
Is there a way to get the hometown and gender of users who comment on a specific Page Post, using the facebook graph API or any other?
More precisely, when I do extract comments on a Page Post with Graph API, it shows me all the IDs of Users who had posted comments. But I need also hometown where they live in order to assign the results of Sentiment Analysis to each city.
GET /v2.6/{PageID_PostID}/comments?fields=from&limit=150
so far as I know Twitter API has such a possibility (using Python’s Tweepy library), but is it possible to extract such a data from Facebook?
I appreciate any help you might have.
Vahid
That´s not possible, you even need an extra permission to authorize a user in order to get his hometown, and you can´t get the gender without authorization either.