ReddViz

Random image posts from Reddit, as JSON.

Endpoints

Endpoint Returns
GET /gimme/:subreddit? A random post with an image
GET /health Deployed version, no Reddit call

GET /gimme/:subreddit?

One random post, or several with c. Omit the subreddit to pick one of the defaults.

Param Value Default
c, count 1 to 50 posts a single post
t, time day, week, month, year, all day
nsfw true, false, only true
nonsfw Shorthand for nsfw=false none

Examples

GET /gimme/memes
GET /gimme/me_irl?t=day
GET /gimme/memes?c=5&nsfw=false

Responses

One post:

{ "id": "abc123", "title": "Some meme", "image": "https://i.redd.it/….jpg", … }

Several posts (c):

{ "count": 2, "posts": [ … ] }

Errors:

{ "success": false, "message": "r/memes does not exist" }

Status codes

Code Meaning
400 Invalid c, nsfw, t or time value
404 No posts, or the NSFW filter matched none
500 Unexpected error from Reddit
503 Reddit unreachable, rate limiting us, or rejected our credentials

GET /health

{ "status": "ok", "version": "1.0.1" }

Source: noz.one/ujol/reddviz · github.com/amrkmn/reddviz