r/redditdev 1d ago

Reddit API Creating a new text post. Trouble setting default comment sort order.

3 Upvotes

Hello all. I am having trouble getting my script to set the default sort order in a new post. I think its possible, but I am most likely implementing it wrong.

Was trying to use the info found here:

https://praw.readthedocs.io/en/latest/code_overview/other/submissionmoderation.html#praw.models.reddit.submission.SubmissionModeration.suggested_sort

and here:

https://www.reddit.com/dev/api#POST_api_set_suggested_sort

But I could not get my script to successfully create a post, and set the default sort order to new.

new_submission = subreddit.submit(title=Title, selftext=post_text)
new_submission.mod.suggested_sort = 'new'

The post is successfully created, but does not have the default sort order set to "new".

Thanks!


r/redditdev 2d ago

Reddit API Problem with Api

2 Upvotes

Hi i am facing problem with my bot

https://www.reddit.com/user/MobileNewsBot

It stopped from posting since a month, when i did test i found out the problem was in the Api call

and it say it not registred app

sadly i dont have access to it i lost the password but i still have refresh token and client id and client secret

is there is way to reactivate it ?

Or i should make another account and register it ?


r/redditdev 6d ago

PRAW why praw not working as intended? leaves some comments

2 Upvotes

I'm trying to delete my comments. it deleted many of them but it left a lot. this generator is returning empty even though they're in my profile. I'm not being rate limited and those are the most recent 1000 (after deleting earlier one).

list(myreddit.user.me().comments.new(limit=None))

latest version of praw.

edit:

so visiting old reddit i can see the comments defaulting to new only returns one comment. fixed by going myreddit.user.me().comments.top(limit=None)

seems reddit changed the new sorting these comments are from 6 months ago or so. interesting enough. for posts it was fine with new for older comments

https://i.ibb.co/rGHRyCkV/image.png


r/redditdev 7d ago

Reddit API Json works in Browser, not in Java

3 Upvotes

I can access reddit's .json feeds, like this from Firefox, but not from Java using okhttp or python, using requests, both using the default user-agent and a custom one. Any idea why it works in the browser and not in my code?


r/redditdev 8d ago

Reddit API Reddit Data API as a researcher: approval time

Thumbnail
6 Upvotes

r/redditdev 9d ago

Reddit API Videos in comments not being returned correctly in API

5 Upvotes

For the following post there is a video on one of the comments:

https://www.reddit.com/r/purplepodrestricted/comments/1uefzsd/all_around_the_world/

When I call the API to pull the users comments with this endpoint:

https://oauth.reddit.com/user/purplepodtestuser7/comments?raw_json=1&limit=100&sort=new&showmedia=false

I get the following response. The video is provided as a link in the body, but the link to the video does not work and I'm unable to retrieve the video in the comment

{
    "kind": "t1",
    "data": {
        "link_url": "https://v.redd.it/nqe0s81mw89h1",
        "subreddit_id": "t5_631pew",
        "approved_at_utc": 1782376069,
        "author_is_blocked": false,
        "comment_type": null,
        "link_title": "All Around the World",
        "mod_reason_by": null,
        "banned_by": null,
        "ups": 1,
        "num_reports": 0,
        "author_flair_type": "text",
        "total_awards_received": 0,
        "subreddit": "purplepodrestricted",
        "link_author": "purplepodtestuser5",
        "distinguished": null,
        "likes": true,
        "replies": "",
        "user_reports": [],
        "saved": false,
        "id": "otoswhl",
        "banned_at_utc": null,
        "mod_reason_title": null,
        "gilded": 0,
        "archived": false,
        "collapsed_reason_code": null,
        "no_follow": false,
        "author": "purplepodtestuser7",
        "num_comments": 3,
        "can_mod_post": true,
        "created_utc": 1782376060.0,
        "send_replies": true,
        "parent_id": "t3_1uefzsd",
        "score": 1,
        "author_fullname": "t2_svk3s85z",
        "over_18": false,
        "report_reasons": [],
        "approved_by": "purplepodtestuser7",
        "controversiality": 0,
        "body": "This is more my sort of thing\n\nhttps://reddit.com/link/otoswhl/video/0y4dw9e33e9h1/player\n\n",
        "edited": false,
        "gildings": {},
        "author_flair_css_class": null,
        "author_flair_background_color": null,
        "is_submitter": false,
        "downs": 0,
        "author_flair_richtext": [],
        "author_patreon_flair": false,
        "body_html": "<div class=\"md\"><p>This is more my sort of thing</p>\n\n<p><a href=\"https://reddit.com/link/otoswhl/video/0y4dw9e33e9h1/player\">https://reddit.com/link/otoswhl/video/0y4dw9e33e9h1/player</a></p>\n</div>",
        "removal_reason": null,
        "collapsed_reason": null,
        "link_id": "t3_1uefzsd",
        "associated_award": null,
        "stickied": false,
        "author_premium": false,
        "can_gild": false,
        "top_awarded_type": null,
        "unrepliable_reason": null,
        "approved": true,
        "author_flair_text_color": null,
        "score_hidden": false,
        "permalink": "/r/purplepodrestricted/comments/1uefzsd/all_around_the_world/otoswhl/",
        "subreddit_type": "restricted",
        "link_permalink": "https://www.reddit.com/r/purplepodrestricted/comments/1uefzsd/all_around_the_world/",
        "name": "t1_otoswhl",
        "created": 1782376060.0,
        "subreddit_name_prefixed": "r/purplepodrestricted",
        "author_flair_text": null,
        "removed": false,
        "spam": false,
        "collapsed": false,
        "awarders": [],
        "all_awardings": [],
        "locked": false,
        "ignore_reports": false,
        "collapsed_because_crowd_control": null,
        "rte_mode": "richtext",
        "mod_reports": [],
        "quarantine": false,
        "mod_note": null,
        "treatment_tags": [],
        "author_flair_template_id": null
    }
}

r/redditdev 9d ago

redditdev meta Just thought that the Reddit staff might want to look into this.

0 Upvotes

While this was generated by Gemini it is the result of a personal experience I've had on reddit multiple times and it pertains to the error reporting system that the reddit base code uses.

A generic, lazy error message feels like a shrug. It says, "We crashed, we don’t know why, and we'll get to it when we get to it." It projects chaos and incompetence.

When a company uses a structured, custom error system, they are projecting command and control. Even though the system is temporarily broken, the message they send is entirely different:

  • "We anticipated this:" A custom code proves the developers built a safety net. They knew things could break, and they designed an orderly way to handle the failure.
  • "We are actively tracking it:" Seeing a unique ID or a specific category code lets you know the system just flagged an engineer in the background. It feels like a process is in motion.
  • "We respect your time:" It acknowledges the user. It treats you like a stakeholder who deserves a status update, rather than an annoyance.

r/redditdev 10d ago

Reddit API Reddit Commercial API

6 Upvotes

Hello, I am building a SaaS app that uses reddit data as a part of a feature. I have a couple questions if someone could be kind enough to put away some of my worries at rest.

  1. Can I get access if the number of calls I need to make is very few (only 300 a month per paid customer). So, in the start, it will be just a few hundred to a few thousand monthly API calls.

  2. How long does it take to hear back from them after filling their forum and getting the commercial license?

  3. Can the $0.24/1000 API calls be negotiated. And does it work on a subscription basis (like buying a set of API calls a month) or pay-as-you-go?


r/redditdev 10d ago

Reddit API Can I get Reddit API?

0 Upvotes

I want to use it in my app but I tried to press create app after entering some datas like name, description, url and uri but the website doesn't direct me anywhere after doing capcha. I get the message

In order to create an application or use our API you can read our full policies here: https://support.reddithelp.com/hc/en-us/articles/42728983564564-Responsible-Builder-Policy

What can I do?


r/redditdev 10d ago

General Botmanship Is there a way to access all images from a reddit gallery post?

2 Upvotes

Hi, I'm currently a bit vibecoding a (RSS) feed reader for reddit. I only ever seem to be able to fetch one imagine, even if the post contains several. (Im basically adding ".rss" to user- and subreddit URLs, everything else doesn't work.

Cheers ✌️


r/redditdev 12d ago

Reddit API Comments with videos missing a media metadata entry?

4 Upvotes

Here are 3 comments that include sort form of media:

video: https://www.reddit.com/comments/1ur2pcz/comment/owcleen/

gif: https://www.reddit.com/comments/1ur2pcz/comment/owckyc1/

image: https://www.reddit.com/comments/1ur2pcz/comment/owgqbcu/

If I use the .json endpoint for each comment, the image and gif have media metadata entries:

"media_metadata": {
  "wfqz4qxpl6ch1": {
    "status": "valid",
    "e": "Image",
    "m": "image/jpeg",
    "p": [...],
    "s": {...},
    "id": "wfqz4qxpl6ch1"
  }
},

"media_metadata": {
  "1h1tlly742ch1": {
    "status": "valid",
    "e": "AnimatedImage",
    "m": "image/gif",
    "p": [...],
    "s": {...},
    "id": "1h1tlly742ch1"
  }
},

while the video comment does not have a media_metadata at all, only having a body with a broken link?

"body": "https://reddit.com/link/owcleen/video/1g7jzy4k42ch1/player\n\ncomment with a video??",

If I add the rtj=all param to return the richtext json alongside the markdown and html, I get the following:

"rtjson": {
  "document": [
    {
      "e": "video",
      "id": "1g7jzy4k42ch1"
    },
    {
      "c": [
        {
          "e": "text",
          "t": "comment with a video??"
        }
      ],
      "e": "par"
    }
  ]
},

But the video id has no extra metadata about it that should be provided (width, height, hsl and dash urls, is gif)

On the other hand, if the video is included in the selftext of a post instead of the body of a comment, the metadata entry is present:

post: https://www.reddit.com/comments/1ukt1tb/

"media_metadata": {
  "fj9mi7viqnah1": {
    "status": "valid",
    "e": "RedditVideo",
    "dashUrl": "https://v.redd.it/link/1ukt1tb/asset/fj9mi7viqnah1/DASHPlaylist.mpd?...",
    "x": 1780,
    "y": 1080,
    "hlsUrl": "https://v.redd.it/link/1ukt1tb/asset/fj9mi7viqnah1/HLSPlaylist.m3u8?...",
    "id": "fj9mi7viqnah1",
    "isGif": false
  }
},

Adding the always_show_media param to the url of the comment does not change anything

This feels like a bug to me, as videos in comments are a fairly new feature and I would expect more than just the video id to be returned by the api


r/redditdev 13d ago

Reddit API How can I pay reddit to programmatically retrieve .json of some posts?

4 Upvotes

I've accessed https://developers.reddit.com/ but it doesn't seem to serve my use case. I need to examine some discussions that mention my clients brands and would like to do this programmatically. How can I pay reddit to access an api of this kind?


r/redditdev 14d ago

Reddit API 500 error when creating app

2 Upvotes

500 error on /api/updateapp when creating app


r/redditdev 16d ago

Reddit API I Submitted an API Request For a Reddit Bot, And Still No Answer From Reddit. It's Becomming Unsettling...

0 Upvotes

Should I still expext it to arrive, or submit another request?


r/redditdev 16d ago

Reddit API New to this platform

0 Upvotes

I am literally new and not aware of how this platform works. Can anyone help me with this?


r/redditdev 17d ago

Reddit API Submitted a Data Access Request and got zero confirmation. Is that normal?

0 Upvotes

filled out the data access request form yesterday, the enterprise/commercial one because honestly none of the roles really fit me (solo dev, no company). hit submit and the page just... sat there. no confirmation, no receipt email, nothing under my requests on the support site either.

so now I'm in this weird spot where I don't know if my application exists or if I'm waiting on something that was never submitted lol. I did resubmit with a note apologizing in case it's a dupe but I don't wanna keep hammering their queue either.

anyone been through this recently? did you actually get a receipt email? how long before you heard ANYTHING back, even a rejection? and is there some way to check a ticket exists that I'm missing?

my use case is boring and read-only btw, surfacing relevant discussions for a little maker tool and linking people back here to participate themselves, nothing automated. totally fine waiting my turn, would just like to know I'm actually in line and not talking to a wall.


r/redditdev 18d ago

Reddit API Http status 500 reddit app

0 Upvotes

hi, if I want to create an app in the Reddit Developer section ( I have inserted only the name, the redirect uri and the type, script ), I receive error 500. Same result with the anonimus navigation browser.


r/redditdev 17d ago

Other API Wrapper Accidentally burned a massive amount of tokens letting an agent loop on a 404 error. How do you catch infinite logic loops before they drain your account?

0 Upvotes

I just accidentally let a LangGraph agent loop on a broken tool over the weekend and woke up to a massive API token burn. How are you guys preventing runaway cloud bills when your autonomous agents get stuck in logic loops? Are you just hardcoding static limits, or is there a better way to catch it?


r/redditdev 18d ago

Reddit API I need help publishing my telegram bot to work 24/7 "free"

0 Upvotes

""mobile no PC"" I made a bot for the first time using ai just for personal interest and some other individuals and it works fine when I have the coding app opened or as it says using the web app or whatever ( I know nothing about coding ) but I need to publish my bot for it to work 24/7 without having to activate it with the coding app so please help. I have the main python and requirements.txt ready.bot is functional with all the secrets ready it just needs to be published.


r/redditdev 19d ago

Reddit API Getting Reddit on Kindle, a series of unfortunate requests

7 Upvotes

Hello, I've been attempting to read Reddit on my kindle for a while now (more relaxing to read) and have 'created' a reddit-to-kindle program that grabs the articles' text and also the top replies from reddit and formats it in an EPUB and sends it to the Kindle address.

The problem is reddit keeps restricting every access point, I've started with: API > reddit blocked that > JSON & RSS > reddit blocked comments > HTML > reddit blocked old.reddit w/o account

I can still get it to work by putting in my session cookie's to the request, however I am worried my account might get banned as it would link it straight to my account. Is there any chance doing this might flag my account, and is anyone doing anything similar and has found any luck? Should I just forget about comments and rely on RSS (even though they have restricted that too)?


r/redditdev 20d ago

Reddit API How to get API for Reddit? help me

7 Upvotes

I did not know how to get, and I submitted a application for Reddit workers. But they did not give me reply, I really need this API for my acadmic research. If you know how to reslove this difficulity, please teach me !


r/redditdev 21d ago

Reddit API Data API Application

Thumbnail
3 Upvotes

r/redditdev 21d ago

Reddit API Reddit Requests

Thumbnail
2 Upvotes

r/redditdev 25d ago

Reddit API Questions Regarding Reddit API

Thumbnail
1 Upvotes

r/redditdev 25d ago

Reddit API Reddit oauth api does not have CORs headers when there is an error status

4 Upvotes

The Reddit api works fine with cors when the request is successful, but when it errors out the cors headers are missing making it impossible to see the status code in a web browser so it’s impossible to know what the error is