Giter Site home page Giter Site logo

quotable's Introduction

Quotable

CI Tests   

Quotable is a free, open source quotations API. It was originally built as part of a FreeCodeCamp project. If you are interested in contributing, please check out the Contributors Guide.

Rate Limit

There is a rate limit of 180 requests per minute, per IP address. If you exceed the rate limit, the API will respond with a 429 error.

API Servers

https://api.quotable.io

Postman

You can try out the API on our public Postman workspace.

Run in Postman

API Reference

Examples

Get random quote

GET /random

Returns a single random quote from the database

⛔️ This method is deprecated in favor of Get Random Quotes

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 Get a random quote with specific tag(s). This 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 any one of the provided tags. Tag names are not case-sensitive. Multi-word tags can be kebab-case ("tag-name") or space separated ("tag name")
author String Get a random quote by one or more authors. 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[]
}

Get Random Quotes

GET /quotes/random

Get one or more random quotes from the database. This method supports several filters that can be used to get random quotes with specific properties (ie tags, quote length, etc.)

By default, this methods returns a single random quote. You can specify the number of random quotes to return via the limit parameter.

⚠️ This method is equivalent to the /random endpoint. The only difference is the response format: Instead of retuning a single Quote object, this method returns an Array of Quote objects.


param type Description
limit Int default: 1   min: 1   max: 50
The number of random quotes to retrieve.
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 Get a random quote with specific tag(s). This 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 any one of the provided tags. Tag names are not case-sensitive. Multi-word tags can be kebab-case ("tag-name") or space separated ("tag name")
author String Get a random quote by one or more authors. 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

// An array containing one or more 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
  // The length of quote (number of characters)
  length: number
  // An array of tag names for this quote
  tags: string[]
}>

Examples

Get random quote try in browser

GET /quotes/random

Get 5 random quotes try in browser

GET /quotes/random?limit=3

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

GET /quotes/random?tags=technology,famous-quotes

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

GET /quotes/random?tags=history|civil-rights

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

GET /quotes/random?maxLength=50

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

GET /quotes/random?minLength=100&maxLength=140

List Quotes

GET /quotes

Get all quotes matching a given query. By default, this will return a paginated list of all quotes, sorted by _id. Quotes can also be filter by author, tag, and length.

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 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. Tag names are not case-sensitive. Multi-word tags can be kebab-case ("tag-name") or space separated ("tag name")
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
sortBy enum Default: "dateAdded"   values: "dateAdded", "dateModified", "author", "content"
The field used to sort quotes
order enum values: "asc", "desc"   default: depends on sortBy
The order in which results are sorted. The default order depends on the sortBy field. For string fields that are sorted alphabetically, the default order is ascending. For number and date fields, the default order is descending.
limit Int Min: 1   Max: 150   Default: 20
Sets the number of results per page.
page Int Min: 1   Default: 1
The page of results to return. If the value is greater than the total number of pages, request will not return any results

Response

{
  // The number of quotes returned in this response
  count: number
  // The total number of quotes matching this query
  totalCount: number
  // The current page number
  page: number
  // The total number of pages matching this request
  totalPages: number
  // The 1-based index of the last result included in the current response.
  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[]
  }>
}

Examples

Get the first page of quotes, with 20 results per page try in browser

GET /quotes?page=1

Get the second page of quotes, with 20 results per page try in browser

GET /quotes?page=2

Get all quotes with the tags love OR happiness try in browser

GET /quotes?tags=love|happiness

Get all quotes with the tags technology AND famous-quotes try in browser

GET /quotes?tags=technology,famous-quotes

Get all quotes by author, using the author's slug. try in browser

GET /quotes?author=albert-einstein

Get Quote By ID

GET /quotes/:id

Get a quote by its 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 /authors

Get all authors matching the given query. This endpoint can be used to list authors, with several options for sorting and filter. It can also be used to get author details for one or more specific authors, using the author slug or ids.

Query parameters

param type Description
slug string Filter authors by slug. The value can be one or more author slugs. To get multiple authors by slug, the value should be a pipe separated list of slugs.
sortBy enum Default: "name"   values: "dateAdded", "dateModified", "name", "quoteCount"
The field used to sort authors.
order enum values: "asc", "desc"
The order in which results are sorted. The default order depends on the sortBy field. For string fields that are sorted alphabetically (ie name), the default order is ascending. For number and date fields (ie quoteCount) the default order is descending.
limit Int Min: 1   Max: 150   Default: 20
Sets the number of results per page.
page Int Min: 1   Default: 1
The page of results to return. If the value is greater than the total number of pages, request will not return any results

Response

{
  // The number of results included in this response.
  count: number
  // The total number of results matching this request.
  totalCount: number
  // The current page number
  page: number
  // The total number of pages matching this request
  totalPages: number
  // The 1-based index of the last result included in this response. This shows the
  // current pagination offset.
  lastItemIndex: number | null
  // The array of authors
  results: Array<{
    // A unique id for this author
    _id: 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.
    description: string
    // The link to the author's wikipedia page or official website
    link: string
    // The authors full name
    name: string
    // A slug is a URL-friendly ID derived from the authors name. It can be used as
    slug: string
    // The number of quotes by this author
    quoteCount: string
  }>
}

Examples

Get all authors, sorted alphabetically by name try in browser

GET /authors?sortBy=name

Get all authors, sorted by number of quotes in descending order try in browser

GET /authors?sortBy=quoteCount&order=desc

Get a single author by slug. try in browser

GET /authors?slug=albert-einstein

Get multiple authors by slug. In this case, you provide a pipe-separated list of slugs try in browser

GET /authors?slug=albert-einstein|abraham-lincoln

Search Quotes (beta)

GET /search/quotes

This endpoint allows you to search for quotes by keywords, content, and/or author name. Unlike the List Quotes endpoint, this method is powered by Atlas Search and is designed to power a search bar UI.

  • Search results are sorted by score
  • The query can be wrapped in quotes to search for an exact phrase. In this case, results will only include quotes that match the query exactly.
  • Supports fuzzy search (optional). This allows for minor typos and misspelling in the search query. For more info on how this works, refer to the Atlas docs

Query Params

Param Type Description
query String The search string. The query can be wrapped in quotes to search for an exact phrase.
fields String Default: "content,author,tags"
Specify the fields to search by. This takes a comma separated list of field names. Supported search fields are "content", "author", "tags". By default, it will search by all fields simultaneously.
fuzzyMaxEdits Int Min: 0   Max: 2   Default: 0
The maximum number of single-character edits required to match the specified search term. Setting this to zero disables fuzzy matching.
fuzzyMaxExpansions Int Max: 150   Min: 0   Default: 50
When fuzzy search is enabled, this is the maximum number of variations to generate and search for. This limit applies on a per-token basis.
limit Int Min: 0   Max: 150   Default: 20
The maximum number of results per page
page Int Min: 1   Default: 1
Sets the page number for pagination

Response

{
  // The number of results included in this response.
  count: number
  // The total number of results matching this request.
  totalCount: number
  // The current page number
  page: number
  // The total number of pages matching this request
  totalPages: number
  // The 1-based index of the last result included in this response. This shows the
  // current pagination offset.
  lastItemIndex: number | null
  // The array of authors
  results: Array<{
    // A unique id for this author
    _id: 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.
    description: string
    // The link to the author's wikipedia page or official website
    link: string
    // The authors full name
    name: string
    // A slug is a URL-friendly ID derived from the authors name. It can be used as
    slug: string
    // The number of quotes by this author
    quoteCount: string
  }>
}

Examples

Search for "every good technology is basically magic" (try in browser)

GET /search/quotes?query=every good technology is basically magic

Results:

  • "Any sufficiently advanced technology is equivalent to magic."

Search for the phrase "divided house"

GET /search/quotes?query=divided house

Results

  • "A house divided against itself cannot stand."

Search for quotes with the keywords "life" or "happiness" (try in browser)

GET /search/quotes?query=life happiness

Search for quotes by an author named "kennedy" (try in browser)

GET /search/quotes?query=Kennedy&fields=author

Search Authors (beta)

GET  /search/authors

This endpoint allows you search for authors by name. It is designed to power a search bar for authors that displays autocomplete suggests as the user types.

  • Powered by Atlas Search.
  • Real autocomplete
  • Results are sorted by score
  • Parses the query into "terms". Things like initials, prefixes, suffixes, and stopwords are not considered search terms. They will still impact the score of a result, but are not required to match.
Example
query="John F. Kennedy"
terms=["john", "kennedy"]

 term      term
  |         |
John  F.  Kennedy  Jr.
      |             |
   initial        suffix

Example
query="Saint Augustine of Hippo"
terms=["Augustine", "Hippo"]

        term        term
          |          |
 Saint Augustine of Hippo
   |             |
prefix        stopword

Query Parameters

Param Type Description
query String The search query
autocomplete Boolean default: true
Enables autocomplete matching
matchThreshold Int Min: 1   Max: 3   Default: 2
Sets the minimum number of search terms (words) that must match for an author to be included in results. Basically, if this is set to 1, the results will include all authors that match at least one part of the name. So query="John F. Kennedy" the results would include all authors that match either "john" OR "kennedy".
If this is set to 2: when the search query includes two or more "terms", at least two of those terms must match. So query="John F. Kennedy" would only return authors that match "John" AND "Kennedy".
limit Int Min:   Max: 150   Default: 20
Maximum number of results per page
page Int Min: 1   Default: 1
Sets the page number for pagination

Response

{
  // The number of results included in this response.
  count: number
  // The total number of results matching this request.
  totalCount: number
  // The current page number
  page: number
  // The total number of pages matching this request
  totalPages: number
  // The 1-based index of the last result included in this response. This shows the
  // current pagination offset.
  lastItemIndex: number | null
  // The array of authors
  results: Array<{
    // A unique id for this author
    _id: 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.
    description: string
    // The link to the author's wikipedia page or official website
    link: string
    // The authors full name
    name: string
    // A slug is a URL-friendly ID derived from the authors name. It can be used as
    slug: string
    // The number of quotes by this author
    quoteCount: string
  }>
}

Examples

Search for author named "Einstein" (try in browser)

GET /search/authors?query=Einstein

Results:

  • Albert Einstein

Autocomplete search for "Einstein" (try in browser)

GET /search/authors?query=Einst

Results:

  • Albert Einstein

Search for "John Adams" (try in browser)

GET /search/authors?query=john adams

Results

  • John Adams
  • John Quincy Adams

Search for "John Quincy Adams" (try in browser)

GET /search/authors?query=john quincy adams

Results:

  • John Quincy Adams)
  • John Adams

Get Author By Slug

Get a single Author by slug. This method can be used to get author details such as bio, website link, and profile image.

If you want to get all quotes by a specific author, use the /quotes endpoint and filter by author author name/slug.

If you want to get multiple authors by slug in a single request, use the /authors endpoint and filter by slug.

GET /authors/:id

Response

{
  // A unique id for this author
  _id: string
  // A brief, one paragraph bio of the author. Source wiki API.
  bio: string
  // A one-line description of the author.
  description: string
  // The link to the author's wikipedia page or official website
  link: string
  // The authors full name
  name: string
  // A slug is a URL-friendly ID derived from the authors name. It can be used as
  slug: string
  // The number of quotes by this author
  quoteCount: string
}

List Tags

GET /tags

Get a list of all tags

Query parameters

param type Description
sortBy enum Default: "name"   values: "dateAdded", "dateModified", "name", "quoteCount"
The field used to sort tags.
order enum values: "asc", "desc"
The order in which results are sorted. The default order depends on the sortBy field. For string fields that are sorted alphabetically, the default order is ascending. For number and date fields, the default order is descending.

Response

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

quotable's People

Contributors

aman-maharshi avatar bryangoble avatar dependabot[bot] avatar dippas avatar gander avatar jcsawyer123 avatar lukepeavey avatar marekdano avatar nk-gears avatar raxraj avatar siddsarkar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quotable's Issues

bug(/quotes/id): response does not match documentation

Description

The method /quotes/:id does not return the expected response.

Steps to reproduce

  1. Make a request to
https://api.quotable.io/quotes/HxaMW05ghs7P

Expected result

The response should be an object with the following fields

content: string
author: string
length: number
tags: string[]

Actual result

Response does not include fields tags or length

Environment

NA

Multiple Spelling / Grammar Errors

First of all, thanks so much for this project, I'm using inside a personal project of my own and love seeing the quotes!

There are, unfortunately, a whole bunch of spelling and grammar errors in a lot of the quotes. I'd love to help with these, but they're not part of the project itself, as far as I can see. Is there a way I could get access to the data store to help, if you'd like me to pitch in?

bug(listQuotes): author param not working on staging server

Describe the bug
Documentation states that to get quotes by author, user needs to hit API endpoint /quotes?author=albert-einstein although this does not work, should be updated to use authorSlug instead of author in the payload because that works. See attached snapshot.

To Reproduce

  1. Open an API client (Postman or Chrome)
  2. Make the following API request staging.quotable.io/quotes?author=abraham-lincoln
GET staging.quotable.io/quotes?author=abraham-lincoln

Expected Response
User should either get results by author or the document should be updated to get results by authorSlug

Actual Response
No Results.
Screenshot 2021-07-24 at 4 43 07 PM

Check Snapshot for the following API

staging.quotable.io/quotes?authorSlug=abraham-lincoln

Screenshot 2021-07-24 at 4 42 03 PM

Api Down

Discussed in #127

Originally posted by khushalpatel1 June 17, 2022
Hello sir api is not woring please help...

[Feature Request] Add tag(s) to quotes

I'm just considering to extend API with a new feature - selecting quotes by a tag name. But firstly each quote object has to contain tag or tags property in it. I'm not sure how hard is to add tag/tags to each quote since my English is not my native language. What do you think?

Error: A server with the specified hostname could not be found

Luke,

Sorry for not getting back to you before you closed issue 10. Things have been a little crazy over the holidays. I feel like quotable worked when you first linked the codepen and code sandbox, but after several more attempts it is not working for me over the past couple of days.

I tried FF Dev, Chrome and Safari browsers.

[Error] Error while parsing the 'sandbox' attribute: 'allow-presentation' is an invalid sandbox flag. (RwNVeQG, line 851)
[Error] Failed to load resource: A server with the specified hostname could not be found. (random, line 0)
[Error] Unhandled Promise Rejection: TypeError: A server with the specified hostname could not be found.
	(anonymous function) (RwNVeQG:66)
	asyncFunctionResume
	(anonymous function)
	promiseReactionJob

Here are some screenshots of the errors from Safari/codepen.
https://res.cloudinary.com/jastuccio/image/upload/v1577771339/quotable%20github%20errors/Screen_Shot_2019-12-31_at_00.24.40.png

https://res.cloudinary.com/jastuccio/image/upload/v1577771338/quotable%20github%20errors/Screen_Shot_2019-12-31_at_00.25.23.png


I found this in a search about the sandbox error:

http://stackoverflow.com/a/33542435:

This error can be safely ignored, the script will continue to run fine. These are two new flags which have been implemented in Chrome 46 (the current stable release). If you're testing in a browser that doesn't support them, you'll see that error (which is really just a warning).

The allow-modals flag is required because Chrome will, by default, block modal dialogs within a sandboxed iframe. Adding this flag allows modals to work in your apps scripts

.

[Feature Request] Get a quote with a maximum length

The Request
What would be really nice is the ability to use a GET parameter to specify the maximum or minimum length of a desired quote.
like this:

Expected Behavior:
https://api.quotable.io/random?maxlen=50 => gives a random quote with a length of no more than 50 characters
https://api.quotable.io/random?minlen?=20 => gives a quote with at least 20 char length.
and so on.

Suggestions
Adding a length entry and then sorting the database by length. Now get the section that has 0 to n characters and select a random one.

api slow down

Now api working but very slow some time working or some time not working...

My Quote can run locally but not in Vercel

I'm using react axios to call this api, here is the code

import React, { useState, useEffect } from 'react'
import axios from "axios"

export default function Quote() {
    const [quote, setQuote] = useState("");
    const [author, setAuthor] = useState("")
    const quoteAPI = async () => {
        let arrayOfQuotes = [];
        try{
            const data = await axios.get("http://api.quotable.io/random")
            arrayOfQuotes = data.data;
        } catch(error){
            console.log(error)
        }

        try{
            setQuote(arrayOfQuotes.content)
            setAuthor(arrayOfQuotes.author)
        } catch(error){
            console.log(error)
        }
    }

    useEffect(() => {
        quoteAPI();
    }, [])

    
  return (
    <div className="quotes">
        <div className="word">
            {quote}
        </div>
        <div className="author">
            {author}
        </div>
        <div class="d-flex justify-content-center">
            <a class="btn btn-secondary btn-xl text-center " onClick={quoteAPI}><i class="fas fa-redo-alt"></i></a>
        </div>
    </div>
  )
}

it ran perfectly when i ran it locally, but when i deployed it to vercel and visited the site, the quote wasn't showing, any clue?

Api down :(

Describe the bug
Error message :- Failed host lookup: 'api.quotable.io' (OS Error: No address associated with hostname,
image

To Reproduce

  1. Open an API client (Postman or Chrome)
  2. Make any API request
GET https://api.quotable.io/tags

feature: author profile images

Author Image Feature

Feature Request

  • To add author_image field or author_image_link field.

This update will look to add another feature in feature-rich Quote API.
It would be amazing to have the author's image along with the quote and bio.

Api Down

Api is again down please fix....

API is down

Check the current status of the API servers. Does this show that the servers are down for everyone?

yes or no

Provide any additional information that might be helpful

enhancement: improve pagination API

Summary

Add support for page number based pagination. This approach is simpler and more intuitive. It also requires less code on the client side to implement common pagination patterns.

This feature can be added on top of the current API without any breaking changes.

Example

Get the second page of results, with 50 results per page.

GET /quotes?page=2&limit=50

New Parameters

Add a page parameter to all paginated endpoints. This parameter can be used to specify the page of results to return. The limit param determines the number of results per page.

Paginated Response

We can add the following properties to all paginated responses. We do not need to remove or modify any existing properties on the response.

  • page the current page of results
  • totalPages total number of pages based on results per page

Implementation

When the skip parameter is provided to a paginated endpoint, the page param will be ignored. Otherwise, the value of skip will calculated from page and limit (results per page). This way the current pagination API will still be supported.

const skip = skipParam || (page - 1) * limit

Two lines short poetry

Description

Hi can you please add two lines poetry in database.. I didn't find two lines short poetry api on internet.. I am working on project that require Short poetry

API down again.

Describe the bug
Some error occurred that made the api unusable.
To Reproduce

  1. I Made the following API request
GET https://api.quotable.io/random?maxLength=50

Expected Response
The api request result is as follows:
image
Please check the situation,Thank you.

[Feature] Search quotes

Description

An API method to search quotes. It should allow people to search for quotes by content, author, and possibly tags. Ideally, search results should be sorted by relevance.

API

GET /search/quotes

Query Params

param type Description
query String The string to search for
limit Int The number of authors to return per request. (for pagination)
skip Int The number of items to skip (for pagination)

Use Cases

1. Search for a specific quote or phrase

Ideally, this should work even if the query does not exactly match the quote

GET /search/quotes/?query=a divided house wont stand
GET /search/quotes/?query=divided house

Should both return the following quote

"A house divided against itself will not stand"

2. Search for quotes containing a keyword

GET /search/quotes/?query=love

Should return all quotes containing the word "love"

3. Search for quotes by author name

GET /search/quotes/?query=Lincoln

[Docs] Update documentation for tags endpoint

1. Update documentation for tags endpoint

README#get-tags should include a section with the following query parameters

  • param: sortBy
    type: enum: ["name", "quoteCount"]
    description: The field used to sort tags. Default is name.

  • param: sortOrder
    type: enum: ["asc", "desc"]
    description: The order in which results are sorted. Default order depends on the sortBy field.

2. Add the tags endpoint to the table of contents

[Feature Request] Web Links For Authors

A lot of the authors in the quotes have bios that would be interesting to read, especially those on, say, Wikipedia. My feature request is to add these somehow (I guess in the Authors collection, if not into the quotes themselves (de-normalised, effectively, for ease of consumption).

Would you consider adding a "link" field (and possible even a photo url field) to the authors collection? I'd be happy with both pieces of work (A: adding the fields, and B: populating some of the authors themselves) if you'd like? Similar to my other request, I'd of course need access to the backend for 'B'.

Typo in README

Hi, I discovered Quota today and it helped me with my project :)
But I found one typo in README.md. Under "usage", you have:
jQuery Example

  $.getJSON('https://quota.glitch.me/random'), function(data) {
    console.log(`${data.quoteText} -${data.quoteAuthor}`)
  }

There is one extra right parenthesis after 'https://quota.glitch.me/random'
It should be: $.getJSON('https://quota.glitch.me/random', function(data) {...

Add guide for new contributors.

I'm a new contributor. It'll be really great if a brief contributing guide exists in this project. Having a CONTRIBUTING.md file or something else with the contributing instructions.

So far I found that I need to do following steps before doing any changes in the codebase.

  1. Making sure that Node and MongoDB are installed on my local machine
  2. Create database of "quotable" on MongoDB
  3. Pass environment variable of MONGODB_URI when seeding database or starting the app and integration tests, e.g. "MONGODB_URI=mongodb://localhost:27017/quotable"

seeding database with

MONGODB_URI=mongodb://localhost:27017/quotable npm run database:seed data/sample

starting tests

MONGODB_URI=mongodb://localhost:27017/quotable npm test

starting the app

MONGODB_URI=mongodb://localhost:27017/quotable npm run start

Quotes in Urdu language

Description

I am working on a project that requires a English quotes in Urdu(ur) language. Can you please 🥺 add this language, if you can I will be very happy 😊

bug(/authors/:id) does not return expected response

Description

The method /authors/:id does not return the correct response.

Steps to reproduce

GET https://api.quotable.io/authors/N5lVXx7ZOkGV

Expected result

According to the documentation, the response should be an object with the following fields.

{
  _id: string
  name: string
  quoteCount: number
  quotes: Array<{
    _id: string
    content: string
    author: string
    length: number
    tags: string[]
  }>
}

Actual result

The items in the quotes array do not have the correct properties

{
  "_id": "N5lVXx7ZOkGV",
  "name": "Alexander Chalmers",
  "quoteCount": 1,
  "quotes": [
    {
      "_id": "zTK-zsh2HysH",
      "__v": 0
    }
  ]
}

Environment

API Client: Postman

Search Author by name or keyword.

Description

There is no feature to search authors by their names, something like this.
https://quotable.io/authors?searchKeyword=einstein

If we hit the same endpoint with slug param it returns 0 (zero) results.
https://api.quotable.io/authors?slug=einstein

Typos

There are a considerable amount of typos in the quotes.

API is currently down

api.quotable.io is currently not working. Tried from multiple pc and IP address to verify. As well as checked isitdownrightnow.com to verify.

docs(listQuotes): Add author param

In the /quotes, we have a query parameter to fetch quotes by using the author name Screenshot attached.
image

But It is not documented.
It is required to be updated.

Get Quotes by topic / genre

Feature

For Each Quotes, add genre as parameter and we can filter based on it. I can see that tag is also used for same purpose but not exactly the same.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.