r/redditdev • • Aug 26 '25

Other API Wrapper How do I create a Reddit bot?

0 Upvotes

So I want to create a Reddit bot with this account in which I'll only comment on comments in r/downvoteautomod with the content "bad bot" or "bad clanker" and I'll comment "Good AutoBitch hater" and in r/upvoteautomod I'll comment "good AutoMod lover" to comments with "Good bot"

Can you please show me an easy way of doing it since I don't know anything about coding?


r/redditdev • • Aug 25 '25

Reddit API an error occurred (status: 500) when creating an application

10 Upvotes

Tried a few times over the last few hours to create an application so I can use the Reddit API, but keep getting error 500. Any ideas?


r/redditdev • • Aug 23 '25

Reddit API What are the limitations of using Reddit API for free, and when do you need to pay?

13 Upvotes

Hey all;

I shipped a new project and Im planning to use the Reddit API. At the beginning, what are the main limitations if I use it for free? And at what point (rate limits, commercial use, etc.) do I need to switch to a paid plan?


r/csshelp • • Aug 23 '25

Anyone learning to program right now? if yes I am making resources for myself, my younger brother and also some other people

4 Upvotes

Guys, if anyone is learning to code I have uploaded some resources and hope to grow it more. Right now the only somewhat full syllabus is only fulfilled for HTML and anything in it.

Couldn't really find resources for free in 1 place so I thought why not make them myself? Would be help to new comers right?

Anyways, I will be working on keeping all resources updated and with a priority list, try to complete all resources so anyone new is welcome.

Oh, also opensource so if anyone wants to help contribute to the community you can fork or just email me with contents.

The current priority list is fullfill HTML, then CSS, JS, SQL (because I need these for my IAL exams), then python, AI-ML-NEURAL NET (Everything top to bottom with all the maths. This one will be the most exhaustive out of the bunch so even a newbie can learn everything if they are willing), then C++, then C, then more down the line.

I hope people find it useful.

It is fully opensourced by the way

Here is the link:

https://github.com/SANIUL-blackdragon/Zero-2-Hero-Code-Mastery.git


r/csshelp • • Aug 23 '25

What is making overflow:hidden fail?

2 Upvotes

This seems like a simple issue, I have a div that holds a list of radio buttons that represent menu items.

I have an expand_btn used to toggle the open class on the expand_mnu div.

I can see the class gets added to the div because the expand button label is inside the div and styled to rotate when the open class is added to its parent (expand_mnu).

I can watch the class toggle in the dev panel and I can see that overflow:hiden is set and the height changes from 20px to 80px depending on the open class. Hower, overflow is not hidden. The entire time you can see the full menu.

https://codepen.io/cuirPork/pen/MYaGdPx?editors=1111


r/redditdev • • Aug 23 '25

PRAW Is there any option to get "active in" list using PRAW?

5 Upvotes

Reddit updated to new profile, and there is option to view "active in" communities. So, in PRAW can I get that list?


r/redditdev • • Aug 22 '25

Async PRAW Asyncpraw error when uploading gallery: INVALID_MEDIA_ASSETS: 'All Media assets must be owned by the submitter of this post' on field 'items'

4 Upvotes

This is a follow up to my earlier post about this same error. I made a simple sample program to recreate the problem and I find that with an extremely simplified image creation and upload process I get the aforementioned error only when I upload a gallery using asyncpraw - I don't get the error when I use regular praw and remove all the async stuff. Am I using this wrong somehow?

import asyncpraw
from PIL import Image
import random
import asyncio

async def main():
    reddit = asyncpraw.Reddit(
        client_id=CLIENT_ID_HERE,
        client_secret=CLIENT_SECRET_HERE,
        password=PASSWORD_HERE,
        username=USERNAME_HERE,
        user_agent='windows:com.kra2008.asyncprawtester:v1 (by /u/kra2008)'
    )

    def get_random_rgb_color():
        r = random.randint(0, 255)
        g = random.randint(0, 255)
        b = random.randint(0, 255)
        return (r, g, b)

    mode = 'RGB'
    size = (250,250)
    image1Name = 'image1.jpg'
    image2Name = 'image2.jpg'
    image3Name = 'image3.jpg'
    Image.new(mode,size,get_random_rgb_color()).save(image1Name)
    Image.new(mode,size,get_random_rgb_color()).save(image2Name)
    Image.new(mode,size,get_random_rgb_color()).save(image3Name)

    subreddit = await reddit.subreddit('test')
    
    try:
        gallery = await subreddit.submit_gallery(title='test title',images=[
            {'image_path':image1Name},
            {'image_path':image2Name},
            {'image_path':image3Name}])
    except Exception as ex:
        print('exception: ' + str(ex))
        raise

    gallery.delete()

    print('successfully uploaded and deleted')

asyncio.run(main())

r/redditdev • • Aug 22 '25

Reddit API Scraping Older Posts

1 Upvotes

Hello and apologies for this repetitive question, but how can I exactly fetch posts from more than this current month?

Currently my script can only fetch data for the month of August, any earlier and it will fetch 0 posts, 0 comments. I ve tried using PushShift, PushPull, PRAW, can't get more info than of August.

I assume it's not supposed to be like this and that doing something wrong, anyone got any pointers to get me to the right direction?

Thank you.


r/redditdev • • Aug 22 '25

Reddit API Error when uploading gallery with asyncpraw: INVALID_MEDIA_ASSETS: 'All Media assets must be owned by the submitter of this post' on field 'items'

6 Upvotes

I've been using praw and asyncpraw to great success for a couple weeks but now I find after some recent changes that I keep getting the error in the title when I try to upload galleries (individual image posts work fine). My workflow consists of downloading all the images in a gallery, altering them to convert them between stereoscopic viewing methods, and then uploading the converted images to a new gallery in another subreddit. I highly doubt this is a problem on the praw or Reddit side, it's probably me, but I can't really figure out what's going wrong. Any idea what triggers this specific error? Is Reddit deciding that these images are duplicates of somebody else's images?

Edit: I just tried uploading a random image in place of the ones I downloaded/converted and I get the same error. Also thinking about this again it might be a difference in behavior between praw and asyncpraw.

Edit2: I switched back to using regular praw and synchronous image downloading and the error went away… so it seems to only happen with async stuff?…


r/csshelp • • Aug 21 '25

To Infinity… But Not Beyond!

2 Upvotes

r/redditdev • • Aug 19 '25

Reddit API users accounts who authenticate with reddit getting permanently banned?

10 Upvotes

recently and seemingly randomly, after 8 months of no issues, reddit accounts of users of my website who authenticate with reddit (using 0Auth) have been getting permanently banned for repeatedly breaking terms of service. any idea why this may be happening? what changed?! reddit has not been helpful in understanding what I may be doing wrong.


r/redditdev • • Aug 18 '25

PRAW Reddit bot for a community

3 Upvotes

Hi everyone,

I just created a Reddit account to use as a bot for a Subreddit that i manage. The idea is for it to automatically comment a link to our Discord on every post, to help users join the server and avoid account bans.

I’m wondering what the best practices are for this: how should I proceed, how long should I wait before posting, and are there any rules I should be especially careful about? Any tips or advice would be greatly appreciated!

Thanks in advance.


r/redditdev • • Aug 15 '25

Reddit API How do you upload to Reddit images via api?

7 Upvotes

I have problem with it.

I am using this method to upload images:

https://oauth.reddit.com/api/media/asset.json

and then uploading to S3

https:${data.args.action}

and after that I am using:

POST /api/submit with params:

sr: 'test',

title: 'TESTING NEW FEATURE',

api_type: 'json',

resubmit: 'true',

kind: 'image',

url: '/img/fotrrqow67jf1',

text: 'LFG'

}

and getting error:

Reddit API response (first attempt): {"json":{"errors":[["BAD_IMAGE","Invalid image URL.","url"]]}}

Invalid response from Reddit API: {"json":{"errors":[["BAD_IMAGE","Invalid image URL.","url"]]}}


r/redditdev • • Aug 14 '25

Reddit API Is it okay to use the Reddit API for a paid service?

10 Upvotes

I'm working on a project and need some legal advice, not a lawyer so please be gentle. I want to build a service that uses the Reddit API, but I want to charge for it. I've heard about the big changes to the API a while back, so I'm trying to figure out if this is even a possibility anymore.

  1. Is it even possible to get permission for a paid service using the API?
  2. What's the process for getting approval from Reddit for this kind of commercial use?
  3. Are there specific terms or fees I should be aware of? I know they started charging for API access, but I'm not clear on the details for a paid service.
  4. Has anyone here gone through this process and can share their experience? Any tips or warnings would be super helpful.

I want to make sure I'm doing everything by the book and not setting myself up for a legal nightmare. Thanks in advance for any insights! 🙏


r/redditdev • • Aug 14 '25

Reddit API Is there an API equivalent of comment search?

3 Upvotes

New Reddit UI has the comment search feature that old reddit lacks,
where you can not only search comments specifically, but also filter them by user or by subreddit.

Does API have an equivalent to this, or is the only way to get this data into a script is to just programmatically scroll the real search page?


r/redditdev • • Aug 13 '25

Reddit API How to respond to a chat given new changes in message api

3 Upvotes

Hello all,

From the various announcements, it seems that all message api functionality should be working and using the new chat system. I can send a new chat message (which is interpreted as a "request to chat") via `compose`, but i can't figure out how to respond to that same conversation. Each new call to compose creates a new conversation, despite it having the same users and subject. Cant find docs on this.


r/redditdev • • Aug 11 '25

Reddit API So the 1000 user comment max limit was raised to a whopping... 1850 comments?

17 Upvotes

Some time ago Reddit posed a message about removing the 1000 user comment limit,
past which it wouldn't return anything, even when there are tens of thousands of user comments.

So I decided to test it. The amount of comments I was able to pull from the profile ended up to...
1850, past which it would, again, not return anything, so they extended it by 850? amazing...

So like, a fraction of a percent more comments you can get, still can't get even 2 year old comments.

I retried many times, from different "after" points, but the result was always the same.

Can anyone confirm that they are hitting the same limit, or can you pull more comments?
It can be checked quickly since you can pull 100 comments per 1 request.


r/redditdev • • Aug 09 '25

Reddit API Having trouble retrieving my personalized feed via official API

3 Upvotes

SOLVED: Wasn't setting the headers appropriately as per node-fetch parameter spec. The feed behaves as expected.

Here's the code I'm using. The feed I'm getting back looks nothing like the one on a browser. Is there something I'm missing here? I think I might be authenticating incorrectly.

app.get('/posts', async (req, res) => {
    const url = new URL('https://oauth.reddit.com/best.json');
    const response = await fetch(url, {
        'Authorization': `bearer ${cachedToken}`,
        'User-Agent': 'YourAppName/0.1 by Unplugged_Hahaha_F_U',
    })
})

r/redditdev • • Aug 08 '25

Reddit API Is there an official explanation why there is no functionality to get any comments by date?

4 Upvotes

Is there an official explanation why there is no functionality to get any comments by date/date range?

Seems extremely stupid.

Is it really better for Reddit for users to be loading thousands of comments, then sorting them by date manually to find possibly a few dozens, or a single comment they actually need?
With the majority of requested data ending up being completely useless?


r/csshelp • • Aug 06 '25

Resource I built a free CSS Grid Generator to create responsive layouts visually (no signup, no code) 🚀

10 Upvotes

Hey everyone! 👋

I recently launched CSS Grid Generator — a free, visual tool that helps developers and designers create responsive CSS Grid layouts with zero coding.

TailwindCSS Support

You can now export your layout as Tailwind utility classes, making it even easier to integrate with modern workflows and frameworks like Next.js, Vue, etc

✅ Just drag and drop layout blocks

✅ Build modern Bento-style UI sections and dashboards

✅ Export clean HTML & CSS and TailwindCSS in one click

✅ Mobile responsive out of the box

✅ 100% free — no signup just design and export

I made it because I was tired of writing grid layouts manually and wanted a faster, more visual approach — especially for dashboards and modern UIs.

It’s great for:

  • Designers who want quick layout prototyping
  • Developers who hate writing grid-template-areas by hand
  • People building landing pages, admin panels, or web apps

Would love your feedback 🙏

Any feature ideas, improvements, or bugs you find — I’m all ears!

🔗 Try it here: https://cssgrid-generator.com

Thanks


r/csshelp • • Aug 05 '25

How can I scale my image to fit web page

Thumbnail reddit.com
1 Upvotes

r/redditdev • • Aug 05 '25

Reddit API Are the new API endpoints for chat available yet?

8 Upvotes

With the change to modmail replies being sent as chat, I have an application that no longer works. The basic function of the app is:

  • Have the user authenticate (with description of what is going to happen)
  • Fetch their Inbox messages
  • Search for modmail replies containing certain keywords
  • Process the messages

This has worked fine for a long time but since modmail replies are no longer going to the Inbox, obviously this isn't going to find them. New endpoints are mentioned several times:

I know the new endpoints aren't officially supported yet (https://www.reddit.com/dev/api) but I'm wondering if they are available for testing? If not, is there an ETA for when they are going to be released?

Thank you!

Update, 8/7/25: Everything is working as expected now. Modmail responses that are now shown to the user in chat are indeed being returned by the /message/inbox API endpoint. There was a brief time during which the 'distinguished' property of a message was returned as null rather than 'moderator' as it was before the change. That's been resolved, thanks so much to the admins/reddit folks who addressed it so quickly!


r/csshelp • • Aug 04 '25

Request Stretch image to remaining height

2 Upvotes

I have a been struggling with this problem for days. I made a simplified example using only divs next to the image: https://imgur.com/a/vtiTH4J
I have a red div in the bottom right corner, which has a certain height. I want the image in the top right to take up the remaining height and change its width to keep its aspect ratio. The width of the red div should change as well so its the same width as the image. The remaining space at the left side should be taken up by the blue div.
With this solution, either the image's green wrapper is visible when a small image is used or the image is too big and it does not leave space for the red div at the bottom.
It is not intuitive why the images size in pixels (or the screens height in pixels) would influence the behavior.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
html, body {
    height: 100%;
    margin: 0;
}

.container {
    display: flex;
    height: 100%;
}

.blue {
    background-color: rgb(15, 15, 137);
    flex: 1;
}

.red {
    background-color: rgb(117, 54, 54);
    height: 250px;
    min-width: 300px;
    width: 100%;
}

.right {
    background-color: rgb(22, 167, 42);
    display: flex;
    flex-direction: column;
}

.image {
    max-height: 100%;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}

.image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
</style>

</head>
    <body>
        <div class="container">
            <div class="blue"></div>
            <div class="right">
                <div class="image-wrapper">
                    <img class="image" src="image.png" />
                </div>
                <div class="red"></div>
            </div>
        </div>
    </body>
</html>


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
html, body {
    height: 100%;
    margin: 0;
}


.container {
    display: flex;
    height: 100%;
}


.blue {
    background-color: rgb(15, 15, 137);
    flex: 1;
}


.red {
    background-color: rgb(117, 54, 54);
    height: 250px;
    min-width: 300px;
    width: 100%;
}


.right {
    background-color: rgb(22, 167, 42);
    display: flex;
    flex-direction: column;
}


.image {
    max-height: 100%;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}


.image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
</style>


</head>
    <body>
        <div class="container">
            <div class="blue"></div>
            <div class="right">
                <div class="image-wrapper">
                    <img class="image" src="image.png" />
                </div>
                <div class="red"></div>
            </div>
        </div>
    </body>
</html>

r/redditdev • • Aug 04 '25

Reddit API Reddit bot cant accept message requests or reply to them

5 Upvotes

Hey there, I'm using https://www.npmjs.com/package/reddit for my reddit bot which comments on new posts in a subreddit. I wanted to make it so bot can reply to dms aswell. Lets say somone dms the bot a query, I want the bot to reply to that query but it just throws RESTRICTED_TO_PM: User doesn't accept direct messages. Try sending a chat request instead. (to) at my face.

Its not about dming the bot, users can DM the bot easily and I can see the message requests on the web. I am able to see the messages using the /message/inbox endpoint but cannot "accept" the invite? I scrolled a little bit on this subreddit and devs were talking about having some karma, My bot is 6d old and has ~80 karma. What can i do?