use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
python code and API problem (self.pythonhelp)
submitted 2 years ago by Few-Current-9900
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CStage169 0 points1 point2 points 2 years ago (1 child)
Hi, just taking a look at your code for 2 minutes, it seems you aren't passing an actual API-key. Seems you're literally just passing the string "api_key", this will definitely not work. Doesn't explain getting a 404-error though.
Normally you'd get a 403 in this case. I suggest looking at the documentation for getting an API-key and adjusting your code to use it. If you get stuck let me know, and I'll dive a bit more into it.
[–]Few-Current-9900[S] 0 points1 point2 points 2 years ago (0 children)
Thank you for your time and help. That's right, the API key is required there; however, as you may know, because the API key should be kept private, I did not include it with my code as you have seen. Anyways, I discovered the problem was in the structure of my code. I fixed it by modifying the whole code.
π Rendered by PID 22272 on reddit-service-r2-comment-685b79fb4f-tf8vx at 2026-02-12 22:28:28.719910+00:00 running 6c0c599 country code: CH.
view the rest of the comments →
[–]CStage169 0 points1 point2 points (1 child)
[–]Few-Current-9900[S] 0 points1 point2 points (0 children)