All Projects → lukePeavey → Quotable

lukePeavey / Quotable

Licence: mit
Random Quotes API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Quotable

Gores
Go package that handles HTML, JSON, XML and etc. responses
Stars: ✭ 94 (-67.92%)
Mutual labels:  rest-api, json-api
Frequest
FRequest - A fast, lightweight and opensource desktop application to make HTTP(s) requests
Stars: ✭ 130 (-55.63%)
Mutual labels:  rest-api, json-api
Dcrdata
Decred block explorer, with packages and apps for data collection and storage. Written in Go.
Stars: ✭ 104 (-64.51%)
Mutual labels:  rest-api, json-api
Server
Serve your Rubix ML models in production with scalable stand-alone model inference servers.
Stars: ✭ 30 (-89.76%)
Mutual labels:  rest-api, json-api
Spine
A Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.
Stars: ✭ 267 (-8.87%)
Mutual labels:  rest-api, json-api
Json Api Dart
JSON:API client for Dart/Flutter
Stars: ✭ 53 (-81.91%)
Mutual labels:  rest-api, json-api
Coronavirus Tracker Api
🦠 A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!
Stars: ✭ 1,577 (+438.23%)
Mutual labels:  rest-api, json-api
Dashboard Server
A JSON file RESTful API with authorization based on json-server
Stars: ✭ 48 (-83.62%)
Mutual labels:  rest-api, json-api
Datoji
A tiny JSON storage service. Create, Read, Update, Delete and Search JSON data.
Stars: ✭ 222 (-24.23%)
Mutual labels:  rest-api, json-api
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (-30.72%)
Mutual labels:  rest-api, json-api
Para
Open source back-end server for web, mobile and IoT. The backend for busy developers. (self-hosted or hosted)
Stars: ✭ 389 (+32.76%)
Mutual labels:  rest-api, json-api
Iotwifi
Raspberry Pi (arm) wifi configuration container. Configure and control wifi connectivity with a JSON based REST api.
Stars: ✭ 236 (-19.45%)
Mutual labels:  rest-api, json-api
Laravel Api Boilerplate
A Boilerplate Project For Laravel API's (NOT MAINTAINED)
Stars: ✭ 113 (-61.43%)
Mutual labels:  rest-api, json-api
Nginx upstream module
Tarantool NginX upstream module (REST, JSON API, websockets, load balancing)
Stars: ✭ 157 (-46.42%)
Mutual labels:  rest-api, json-api
Crnk Framework
JSON API library for Java
Stars: ✭ 234 (-20.14%)
Mutual labels:  rest-api, json-api
Safrs
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI
Stars: ✭ 255 (-12.97%)
Mutual labels:  rest-api, json-api
Vscode Restclient
REST Client Extension for Visual Studio Code
Stars: ✭ 3,289 (+1022.53%)
Mutual labels:  rest-api
Airflow Rest Api Plugin
A plugin for Apache Airflow that exposes rest end points for the Command Line Interfaces
Stars: ✭ 281 (-4.1%)
Mutual labels:  rest-api
Reservoir
A back end for your front end: a content repository. Powered by Drupal 8, JSON API and OAuth2.
Stars: ✭ 262 (-10.58%)
Mutual labels:  json-api
Roapi
Create full-fledged APIs for static datasets without writing a single line of code.
Stars: ✭ 253 (-13.65%)
Mutual labels:  rest-api

Quotable

Quotable is a free, open source quotations API. It was originally built as part of a FreeCodeCamp project. The database includes over 2000 quotes by 900 authors.

Servers

Name URL Description
Staging staging.quotable.io Synced with the master branch of this repository
Production api.quotable.io The primary API server

API Reference

Get random quote

Returns a single random quote from the database

GET /random

Query parameters

param type Description
maxLength Int The maximum Length in characters ( can be combined with minLength )
minLength Int The minimum Length in characters ( can be combined with maxLength )
tags String Filter random quote by tag(s). Takes a list of one or more tag names, separated by a comma (meaning AND) or a pipe (meaning OR). A comma separated list will match quotes that have all of the given tags. While a pipe (|) separated list will match quotes that have either of the provided tags.
author String Get random quote by a specific author(s). The value can be an author name or slug. To include quotes by multiple authors, provide a pipe-separated list of author names/slugs.
authorId String deprecated
Same as author param, except it uses author _id instead of slug

Response

{
  _id: string
  // The quotation text
  content: string
  // The full name of the author
  author: string
  // The `slug` of the quote author
  authorSlug: string
  // The length of quote (number of characters)
  length: number
  // An array of tag names for this quote
  tags: string[]
}

Examples

Random Quote try in browser

GET /random

Random Quote with tags "technology" AND "famous-quotes" try in browser

GET /random?tags=technology,famous-quotes

Random Quote with tags "History" OR "Civil Rights" try in browser

GET /random?tags=history|civil-rights

Random Quote with a maximum length of 50 characters try in browser

GET /random?maxLength=50

Random Quote with a length between 100 and 140 characters try in browser

GET /random?minLength=100&maxLength=140

List Quotes

Get a paginated list of all quotes. This method supports several filter and sorting options.

GET /quotes

Query parameters

param type Description
limit Int Min: 1 Max: 100 Default: 20
The number of quotes to return per request. (for pagination).
skip Int Min: 0 Default: 0
The number of items to skip (for pagination).
maxLength Int The maximum Length in characters ( can be combined with minLength )
minLength Int The minimum Length in characters ( can be combined with maxLength )
tags String Filter quotes by tag(s). Takes a list of one or more tag names, separated by a comma (meaning AND) or a pipe (meaning OR). A comma separated list will match quotes that have all of the given tags. While a pipe (|) separated list will match quotes that have either of the provided tags.
author String Get quotes by a specific author. The value can be an author name or slug. To get quotes by multiple authors, provide a pipe separated list of author names/slugs.
authorId String deprecated
Same as author param, except it uses author _id instead of slug

Response

{
  // The number of quotes returned by this request
  count: number
  // The total number of quotes matching this request
  totalCount: number
  // The index of the last quote returned. When paginating through results,
  // this value would be used as the `skip` parameter when requesting the next
  // "page" of results.
  lastItemIndex: number
  // The array of quotes
  results: Array<{
    _id: string
    // The quotation text
    content: string
    // The full name of the author
    author: string
    // The `slug` of the quote author
    authorSlug: string
    // The length of quote (number of characters)
    length: number
    // An array of tag names for this quote
    tags: string[]
  }>
}

Get Quote By ID

Get a quote by its ID

GET /quotes/:id

Response

{
  _id: string
  // The quotation text
  content: string
  // The full name of the author
  author: string
  // The length of quote (number of characters)
  length: number
  // An array of tag names for this quote
  tags: string[]
}

List Authors

Get a paginated list of all authors. By default, authors will be returned in alphabetical order (ascending).

GET /authors

Query parameters

param type Description
sortBy enum: ['name', 'quoteCount'] Default: "name"
The field used to sort authors.
sortOrder enum: ['asc', 'desc'] Default: "asc"
The order results are sorted in.
limit Int Min: 1 Max: 100 Default: 20
The number of authors to return per request. (for pagination)
skip Int Min: 0 Default: 0
The number of items to skip (for pagination)

Response

{
  // The number of authors return by this request.
  count: number
  // The total number of authors matching this request.
  totalCount: number
  // The index of the last item returned. When paginating through results,
  // this value would be used as the `skip` parameter when requesting the next
  // "page" of results. It will be set to `null` if there are no additional results.
  lastItemIndex: number | null
  // The array of authors
  results: Array<{
    // A unique id for this author
    _id: string
    // The authors full name
    name: string
    // The number of quotes by this author
    quoteCount: string
  }>
}

Get Author By ID

Get a specific author by ID. The response includes all quotes by the given author.

GET /authors/:id

Response

{
  // A unique id for this author
  _id: string
  // A slug is a unique string that can be used to identify an author. Unlike _id,
  // the slug is derived from the author's name (by converting it to hyphen case).
  slug: string
  // A brief, one paragraph bio of the author. Source: wiki API
  bio: string
  // A one-line description of the author. Typically it is the person's primary
  // occupation or what they are know for. For example: "Austrian Physicist"
  description: string
  // The authors full name
  name: string
  // The number of quotes by this author
  quoteCount: string
  // The array of quotes by this author (not paginated)
  quotes: Array<{
    _id: string
    // The quotation text
    content: string
    // The full name of the author
    author: string
    // The `slug` of the quote author
    authorSlug: string
    // An array of tag names for this quote
    tags: string[]
    // The length of quote (number of characters)
    length: number
  }>
}

List Tags

GET /tags

Get a list of all tags

Query parameters

param type Description
sortBy enum: ['name', 'quoteCount'] Default: "name"
The field used to sort tags.
sortOrder enum: ['asc', 'desc'] Default: depends on sortBy
The order in which results are sorted.

Response

{
  // The number of all tags by this request
  count: number
  // The array of tags
  results: Array<{
    _id: string
    name: string
  }>
}

Usage

Get a random quote (fetch)

fetch('https://api.quotable.io/random')
  .then(response => response.json())
  .then(data => {
    console.log(`${data.content}${data.author}`)
  })

Get a random quote (async/await)

async function randomQuote() {
  const response = await fetch('https://api.quotable.io/random')
  const data = await response.json()
  console.log(`${data.content}${data.author}`)
}
randomQuote()

Get a random quote (JQuery)

$.getJSON('https://api.quotable.io/random', function (data) {
  console.log(`${data.content}${data.author}`)
})

Live Examples

Basic Random Quote (CodePen)

React Random Quote (CodeSandbox)

Contributing

All contributions are welcome! For more info on how to contribute, check out the Contributors Guide

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].