Skip to content

A Node.js REST API I created for fetching memes off Reddit. This repository currently hosts the old source code of my API. This project has since been reworked and can be found at memes.rafi-codes.dev

Notifications You must be signed in to change notification settings

Rafi-99/Meme-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meme API

About

A simple Node.js Web API I created for fetching memes off Reddit. Each GET request to my API returns a new random meme in JSON format.

How It Works

  1. My API uses the GOT HTTP request library to parse the following URL: https://www.reddit.com/r/{insert_a_subreddit_name_here}/random.json

  2. Relevant information is retrieved from the URL such as the meme's title, image URL, upvotes, downvotes, and comments.

  3. My API then takes that information to construct a JSON object that gets returned to the user.

Note: My API will work for most subreddits. Obviously it will return an error if you try to access a subreddit that doesn't exist. Most banned and NSFW subreddits will not work either since Reddit returns an error code if you try to access them.

Example Endpoints

About

A Node.js REST API I created for fetching memes off Reddit. This repository currently hosts the old source code of my API. This project has since been reworked and can be found at memes.rafi-codes.dev

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published