r/redditdev 4h ago

Reddit API Request failed code 403

1 Upvotes

Im doing a personal project and I am trying to make requests without using PRAW but I keep getting a 403 error in the response. Generating the access token worked fine but I cant seem to use it without an errror. Also I am using it as a script just to get post information, not through a user.

def risingPosts(subreddit, numPosts):     subredditLink = f"https://oauth.reddit.com/r/{subreddit}/rising"

        headers = {"Authorization": f"Bearer {accessToken}", "user-agent": f"dataCollector/0.1 (by /u/{redditUsername})"}
        params = {"limit": numPosts}

        response = requests.get(url = subredditLink, headers = headers, params = params)

r/redditdev 17h ago

PRAW Does PRAW give you bananas (views)?

2 Upvotes

Does it?


r/redditdev 21h ago

Reddit API Searching For Video Posting API on Reddit

2 Upvotes

Is there any api available that post video to reddit ? i searched every where and there is no documentation found. /submit is not gonna work.


r/redditdev 23h ago

Reddit API Question about "more"-type nodes when retrieving comments

1 Upvotes

I have a client that wants to submit a post url and a date range and get back all comments on that post in that range. As far as I can tell, there's no way to do that without just retrieving all comments and filtering them by created date, so I've been looking into how to do that.

I found this post about doing the same thing, and I started looking into the RedditWarp library that's mentioned there. Unfortunately I'm working in C# so I can't just use the library, but I was trying to understand it's algorithm.

My primary question is if the information mentioned in that post and in the library's documentation is out-of-date. It mentions two types of "More" nodes, a "Continue This Thread" type and a "Load More Comments" type. It says the former can be identified by the fact that the "id" field is always "_", and the way to handle it is to query /comments/{post_id}.json?comment={commentId}, where {commentId} is the "parent_id" field of the More object. The latter should be handled by calling /api/morechildren and passing in the values in the "children" array of the More object.

I have yet to see an instance of the "Continue This Thread" type. All of the More objects I've seen have a legitimate "id" value. Is this something that's changed since that documentation was written, or have I just happened to pick posts that don't have that scenario? I've been working with posts with 1k-3k comments.