Skip to content

API Documentation

ZYROUGE edited this page Apr 13, 2022 · 6 revisions

Base URLs

  • GitHub Pages: https://zyrouge.github.io/upright-quotes/api
  • Github Raw: https://raw.githubusercontent.com/zyrouge/upright-quotes/gh-pages/api
  • JsDelivr: https://cdn.jsdelivr.net/gh/zyrouge/upright-quotes@gh-pages/api

Endpoints

Get Metadata

  • Method: GET
  • Path: /meta.json
  • Success Response: IMeta

Get Quote as JSON

  • Method: GET
  • Path: /quotes/{index}.json
  • Parameters:
    • index: number - Index of the quote.
  • Success Response: IQuote

Get Quote as Image (png)

  • Method: GET
  • Path: /quotes/{index}.png
  • Parameters:
    • index: number - Index of the quote.
  • Success Response: Image

Get All Quotes as JSON

  • Method: GET
  • Path: /quotes/all.json
  • Success Response: IQuote[]

Schemas

IMeta

{
    size: number, // Total size of quotes
    generatedAt: number, // Milliseconds from epoch
}

IQuote

{
    index: number,
    quote: string,
    author: string,
    color: {
        primary: string, // Hex code (eg. #000000)
        contrast: string // Hex code (eg. #ffffff)
    }
}