ℹī¸/reddit

This is complete documentation about how to get Reddit Images using Random Stuff API (This Endpoint is accessible using free plan as well as Paid plan)

Since this API is only accessible using RapidAPI, you need to change the base URL to https://random-stuff-api.p.rapidapi.com

This endpoint allows you to access reddit images/posts from any sub-reddit.

GET https://api.pgamerx.com/reddit

Path Parameters

NameTypeDescription

method*

String

What type of function do you want to perform?

Query Parameters

NameTypeDescription

searchType*

String

What type of post do you want to search- hot, top, new, or rising

Headers

NameTypeDescription

Authorizaion*

String

x-rapidapi-key*

String

The API key you received from RapidApi

x-rapidapi-host*

String

It should always be:

"random-stuff-api.p.rapidapi.com"

{
  "id": "rnqun9",
  "type": "rising",
  "title": "Visiting rural Europe as a foreigner starterpack",
  "author": "Desertedfoxx",
  "postLink": "https://redd.it/rnqun9",
  "image": "https://i.imgur.com/moDA6p7.png",
  "gallery": false,
  "text": "",
  "thumbnail": "https://b.thumbs.redditmedia.com/y4pktIWFITDS3xUiIzD4ciDFIu3cQKvrfvfsEyI4vvU.jpg",
  "subreddit": "starterpacks",
  "NSFW": false,
  "spoiler": false,
  "createdUtc": 1640367106,
  "upvotes": 246,
  "downvotes": 0,
  "upvoteRatio": 0.96
}

Available Methods:

  1. FetchSubredditPost

2. FetchPost

The above 2 methods require another query parameter: subreddit

3. fetchPostById

This method require another query parameter: id

4. RandomMeme

5. FetchRandomPost

var axios = require("axios").default;

var options = {
  method: 'GET',
  url: 'https://random-stuff-api.p.rapidapi.com/reddit/RandomMeme',
  params: {searchType: 'rising'},
  headers: {
    authorization: 'Random Stuff API',
    'x-rapidapi-host': 'random-stuff-api.p.rapidapi.com',
    'x-rapidapi-key': 'RapidAPI key'
  }
};

axios.request(options).then(function (response) {
	console.log(response.data);
}).catch(function (error) {
	console.error(error);
});

For examples in all languages, checkout RapidAPI Page

Last updated