{
  "openapi": "3.1.0",
  "info": {
    "title": "The Workbench Library API",
    "version": "1.0.0",
    "description": "Free, read-only Bible study data for pastors: open translations, classic commentaries, cross-references, Strong's lexicon, Bible dictionaries, four daily devotionals, and 58 Christian classics. Built by Joe Cook for The Pastor's Workbench."
  },
  "servers": [
    {
      "url": "https://library.pastorsworkbench.com/api/v1"
    }
  ],
  "paths": {
    "/study": {
      "get": {
        "operationId": "studyPassage",
        "summary": "Passage, commentary by tradition, cross-references and key words in one call",
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bible reference, e.g. John 3:16, Romans 8:28-39, Psalm 23"
          },
          {
            "name": "tradition",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "wesleyan",
                "evangelical",
                "reformed",
                "baptist",
                "early"
              ]
            },
            "description": "wesleyan, evangelical, reformed, baptist, or early"
          },
          {
            "name": "translations",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated: bsb, kjv, asv, web, ylt, gnv, dby, blb, lsv, fbv"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/passage": {
      "get": {
        "operationId": "getPassage",
        "summary": "Bible text in one or more translations",
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bible reference, e.g. John 3:16, Romans 8:28-39, Psalm 23"
          },
          {
            "name": "translations",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated: bsb, kjv, asv, web, ylt, gnv, dby, blb, lsv, fbv"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/commentary": {
      "get": {
        "operationId": "getCommentary",
        "summary": "Notes from classic commentators",
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bible reference, e.g. John 3:16, Romans 8:28-39, Psalm 23"
          },
          {
            "name": "tradition",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "wesleyan",
                "evangelical",
                "reformed",
                "baptist",
                "early"
              ]
            },
            "description": "Preset of commentators"
          },
          {
            "name": "commentators",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated commentator ids; overrides tradition"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/crossrefs": {
      "get": {
        "operationId": "getCrossReferences",
        "summary": "Treasury of Scripture Knowledge cross-references",
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bible reference, e.g. John 3:16, Romans 8:28-39, Psalm 23"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/words": {
      "get": {
        "operationId": "wordStudy",
        "summary": "Key Hebrew and Greek words with Strong's numbers",
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bible reference, e.g. John 3:16, Romans 8:28-39, Psalm 23"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Most words to return, default 25"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/strongs/{number}": {
      "get": {
        "operationId": "lookupStrongs",
        "summary": "Lexicon entry for a Strong's number such as G26 or H1254",
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Not found"
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "searchBible",
        "summary": "Search the Bible by words or exact phrase",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Words or phrase"
          },
          {
            "name": "translation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "bsb",
                "kjv",
                "asv",
                "web",
                "ylt",
                "gnv",
                "dby",
                "blb",
                "lsv",
                "fbv"
              ]
            },
            "description": "Default bsb"
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "any",
                "phrase"
              ]
            },
            "description": "all, any, or phrase"
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "all, ot, nt, or a book name"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Default 25, max 100"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/dictionary": {
      "get": {
        "operationId": "dictionaryLookup",
        "summary": "Easton, Smith, ISBE, Hitchcock, Nave and Torrey entries",
        "parameters": [
          {
            "name": "term",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Person, place or topic"
          },
          {
            "name": "sources",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated: easton, smith, isbe, hitchcock, nave, torrey"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/devotional": {
      "get": {
        "operationId": "getDevotional",
        "summary": "A daily devotional reading: Spurgeon's Morning and Evening or Faith's Checkbook, Daily Light, or Streams in the Desert",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sme",
                "checkbook",
                "daily-light",
                "streams"
              ]
            },
            "description": "Which devotional"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "MM-DD, default today"
          },
          {
            "name": "part",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "morning",
                "evening",
                "both"
              ]
            },
            "description": "morning, evening, or both"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/classics": {
      "get": {
        "operationId": "listClassics",
        "summary": "List the 58 public-domain Christian classics",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "early, devotion, mystics, reformation, puritan, wesleyan, revival, pentecostal, thought, pastoral"
          },
          {
            "name": "author",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by author"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/classics/search": {
      "get": {
        "operationId": "searchClassics",
        "summary": "Search the classics for sections containing all the words",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Words to find"
          },
          {
            "name": "work",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Limit to one work id"
          },
          {
            "name": "collection",
            "in": "query",
            "required": false,
            "description": "all (default), core, sermons, fathers, or history",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "core",
                "sermons",
                "fathers",
                "history"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Default 15, max 40"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/classics/{work}": {
      "get": {
        "operationId": "readClassic",
        "summary": "Table of contents, or one section's text",
        "parameters": [
          {
            "name": "work",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Section number from the contents"
          },
          {
            "name": "find",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Words from a section title"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/sermons": {
      "get": {
        "operationId": "findSermons",
        "summary": "Spurgeon's sermons preached on a passage",
        "parameters": [
          {
            "name": "ref",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bible reference, e.g. John 3:16, Romans 8:28-39, Psalm 23"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/questions": {
      "get": {
        "operationId": "pastoralAnswers",
        "summary": "Joe Cook's pastoral answers to common questions, with Scripture and historic quotations",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Question or key words. Leave out to list every question.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "salvation",
                "holiness",
                "spirit",
                "prayer",
                "suffering",
                "beliefs",
                "church",
                "tradition"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    },
    "/resources": {
      "get": {
        "operationId": "listResources",
        "summary": "Translations, commentators, traditions and dictionaries available",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Could not read the request"
          }
        }
      }
    }
  }
}