References Finder

The references finder endpoint scans a free-form block of text and returns every scripture reference found in it. For each match it reports the character start and end index in the original text, the raw matched string, a standardized pretty-string, and the full parsed reference data.

Note: For all API url examples the url given is appended to the base url. The base url will include information like the desired API version, denomination, and language of the resource that you are requesting. If you simply append the endpoint to "openscriptureapi.org" you will get a 404 error.


POST/referencesFinder

Find references in text

Submit a JSON body with a text field. The endpoint will scan the text and return all detected scripture references.

Required body attributes

  • Name
    text
    Type
    string
    Description

    The block of text to scan for scripture references.

Response

  • Name
    text
    Type
    string
    Description

    The original input text.

  • Name
    count
    Type
    number
    Description

    The total number of references detected.

  • Name
    references
    Type
    array
    Description

    An array of detected reference objects.

  • Name
    references[].start
    Type
    number
    Description

    The character index in text where this reference begins (inclusive).

  • Name
    references[].end
    Type
    number
    Description

    The character index in text where this reference ends (exclusive).

  • Name
    references[].raw
    Type
    string
    Description

    The raw substring from text that was matched.

  • Name
    references[].prettyString
    Type
    string
    Description

    A standardized, human-readable version of the reference.

  • Name
    references[].reference
    Type
    array
    Description

    The fully parsed reference structure — same shape as the references array returned by the Plain Text Reference Parser.

Request body

{
  "text": "In the Book of Mormon we read Alma 32:21 and also Moroni 10:4-5 for context."
}

Response

{
  "text": "In the Book of Mormon we read Alma 32:21 and also Moroni 10:4-5 for context.",
  "count": 2,
  "references": [
    {
      "start": 29,
      "end": 39,
      "raw": "Alma 32:21",
      "prettyString": "Alma 32:21",
      "reference": [
        {
          "book": "alma",
          "chapters": [
            {
              "start": 32,
              "end": 32,
              "verses": [
                { "start": 21, "end": 21 }
              ]
            }
          ]
        }
      ]
    },
    {
      "start": 50,
      "end": 63,
      "raw": "Moroni 10:4-5",
      "prettyString": "Moroni 10:4-5",
      "reference": [
        {
          "book": "moroni",
          "chapters": [
            {
              "start": 10,
              "end": 10,
              "verses": [
                { "start": 4, "end": 5 }
              ]
            }
          ]
        }
      ]
    }
  ]
}

GET/referencesFinder

Find references in text

For quick testing you can also pass the text as a query parameter. The response shape is identical to the POST variant.

Required query parameters

  • Name
    text
    Type
    string
    Description

    The block of text to scan for scripture references, URL-encoded.

cURL

curl "https://openscriptureapi.org/api/scriptures/v1/lds/en/referencesFinder?text=See+Alma+32:21+and+Moroni+10:4"
Note: the Open Scripture API is still in beta, and these resources/endpoints can change at any time