This is a simple API that returns quotes from famous people. The data is returned in JSON format. It's free and doesn't need a key.
- The API's endpoint is:
/api/v1/
or/api/v1/quotes
Returns the first 10 quotes in the database. - To navigate between pages:
/api/v1/quotes?page=:number
/api/v1/quotes/:id
returns the quote that belongs to the id given- The search function's endpoint is
api/v1/search/?q=:person
. The query only accepts the person name - The random function returns a random quote and its endpoint is:
api/v1/random/
id
: The id of the quoteperson
: Person who belongs the quotequote
: The quote itselfcreated_at
: When was created in the databaseupdated_at
: When was updated in the database
To test locally, install dependencies using bundle install
.
After that run the command rails db:migrate
to create and initialize the database,
populate the database with rails db:seed
and then run the API using rails s
or
rails server
.
The API will be running on localhost:3000
.
Ruby version 2.6.4 Ruby on Rails 6 SQLite for development PostgreSql for production