Quotes API for your project

I finished the quotes application a few days ago, but I have noticed many campers struggling with an API, so I made mine public.

You should either get all the quotations from:
https://mysterious-sierra-49778.herokuapp.com/api/quotations

Or get a quotation by its ID at https://mysterious-sierra-49778.herokuapp.com/api/quotations/ID where ID is an integer between 1 and 10 (there are only 10 quotes in the database).

The API returns JSON, and only accepts GET requests.

The code is at https://github.com/Oxyrus/Wonka

Hope this makes your project easier to accomplish :slight_smile:

I also struggled with this a bit and ended up using https://quotesondesign.com for mine. Their API has good documentation, doesn’t require any sign-up, uses https (which gets around cross security issues which seem to come up with some these these projects) and the quotes fit the content of the course fairly well too.

Details can be found at https://quotesondesign.com/api-v4-0/

1 Like

I’ve built a Golang application, it’s database-less, you must have Go installed in order to compile it, the quotes are hard-coded (that’s why it doesn’t use a database), and it serves an API over localhost:8080/quotes.

A GET request to localhost:8080/quotes would return

[
  {
    "id": "1",
    "content": "Don't cry because it's over, smile because it happened.",
    "author": {
      "name": "Dr. Seuss"
    }
  },
  {
    "id": "2",
    "content": "So many books, so little time.",
    "author": {
      "name": "Frank Zappa"
    }
  },
  {
    "id": "3",
    "content": "You know you're in love when you can't fall asleep because reality is finally better than your dreams.",
    "author": {
      "name": "Dr. Seuss"
    }
  }
]

Whereas a request to localhost:8080/quotes/1 would return

{
  "id": "1",
  "content": "Don't cry because it's over, smile because it happened.",
  "author": {
    "name": "Dr. Seuss"
  }
}

This is my first Golang application, if someone is a seasoned Go programmer, please let me know your comments and suggestions :slight_smile: