FCC Random Quote Challenge API

Official Unofficial FCC Quote API


Hello FCC community. My name is Wesley (@septimus) and I am a volunteer core-team member for FCC. You may have seen me twitch stream, or in as a guest in the FCC Summits. Today I am bringing you a (hopefully) helpful API. However, if don’t find it useful, well I had fun working with Restify and creating an API anyways :stuck_out_tongue:

The Problem

While doing the random quote machine challenge for myself I wanted my quotes to be random and come from a large pool of quotes. Every API (Wikiquotes, BrainyQuote NPM libs, etc) didn’t seem to be what I wanted or easy to use.

The Solution

Like any programmer would do: @atjonathan and myself (@septimus) created an “official” RESTful API to be used with the FCC Random Quote Machine Front-End Challenge. I have completed my challenge using this API and it can be used as a demo. I also tacked on a little extra so users can send their own quotes in.

Demo and new quote submission located at this website.

DISCLAIMER: Some quotes may be wrong, inappropriate, etc. We do not have anything in place to filter quotes right now. If you see a bad quote send me an email (septimus98@gmail.com) or message Jonathan or I on Gitter (@atjonathan or @Septimus)


How does it work?

The API uses restify to responed to HTTP requests to the base address: https://quote-api.gomix.me/

How to get a random quote

Simply send a GET request to the address: https://quote-api.gomix.me/pull/1

This will give you 1 random quote. If for any reason you want more than 1 quote sent back to you, just replace the 1 with any other number.

You can send us quotes too!

There are so many great quotes out there and two developers can’t get them all. If you know a quote or want to spend some time populating the DB with more quotes, here’s how you do it:

  • Send a POST request to this address and the following params: https://quote-api.gomix.me/push/quote?author=<author name>&quote=<the quote>

Quote Schema

author: { type: String, required: true }, 
body: { type: String, required: true }, 
createdAt: { type: Date, default: Date.now(), required: true } 

#Important Update!!
##We apologize but there is a problem with the DB right now. We are working on a fix. Will post again when fixed.

Another camper did this a few months ago :slight_smile:

1 Like

#Fixed and ready to use

###Unlisted post while we fixed the issue
Everything is working now. So give it a try. Let us know if there are any errors and we will fix them ASAP.


1 Like