Search
The search endpoint provides advanced full-text search across all scripture verses. It supports a rich query syntax including exact phrases, wildcards, boolean operators, proximity search, and more. Results are returned as a paginated list of matching verses.
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.
Query syntax
The q parameter supports a rich query syntax for precise searches.
Simple terms
Space-separated words match verses containing all terms (AND logic). The search is case-insensitive by default.
faith hope
Exact phrase
Wrap a phrase in double quotes to match the exact sequence of words.
"plan of salvation"
Ordered proximity
Wrap words in single quotes to match them in order, but allow intervening words between them.
'faith to works'
This matches "faith leads to good works" but not "works lead to faith."
Wildcards
Use * to match one or more characters, or ? to match exactly one character.
house* → household, housekeeping, housetop
gr?y → grey, gray
pro?h* → prophet, prophesy, prophesied
Boolean OR
Use + to match verses containing either term.
faith + belief
Boolean NOT
Use # to exclude verses containing a term.
faith # doubt
Proximity search
Use & with ~N to require both terms within N words of each other (in either order).
faith & works ~5
This matches verses where "faith" and "works" appear within 5 words of each other.
Combining syntax
You can combine all of the above:
"plan of salvation" # death
faith* + believ*
Regex mode
Set regex=true to pass the q parameter as a raw regular expression pattern, bypassing the query parser entirely. This is useful for complex patterns that the query syntax cannot express.
?q=faith|belief®ex=true
Search results model
Each item in the results array represents a single matching verse.
Properties
- Name
query- Type
- string
- Description
The search term that was used for this request
- Name
total- Type
- integer
- Description
The total number of verses that match the query (across all pages)
- Name
limit- Type
- integer
- Description
The maximum number of results returned in this response
- Name
offset- Type
- integer
- Description
The number of results skipped before this page of results
- Name
results- Type
- array
- Description
An array of matching verse objects
- Name
results[].reference- Type
- string
- Description
The human-readable scripture reference, e.g.
Alma 32:21
- Name
results[].book- Type
- string
- Description
The title of the book containing this verse
- Name
results[].chapter- Type
- integer
- Description
The chapter number containing this verse
- Name
results[].verse- Type
- integer
- Description
The verse number within its chapter
- Name
results[].text- Type
- string
- Description
The full plaintext of the matching verse
- Name
results[].highlight- Type
- string
- Description
A KWIC (Key Word in Context) snippet showing the matched term with surrounding words. Only present when
highlight=true.
- Name
wordFrequency- Type
- array
- Description
Top 20 co-occurring words across the result set (excluding common stop words), each with
wordandcount. Only present whenword_frequency=true.
Search scripture text
This endpoint searches all scripture verses for the given query and returns a paginated list of matching verses.
Required query parameters
- Name
q- Type
- string
- Description
The search query. Supports simple terms, exact phrases, wildcards, boolean operators, and proximity search (see Query Syntax above). Set
regex=trueto use a raw regex pattern.
Optional query parameters
- Name
limit- Type
- integer
- Description
The maximum number of results to return. Default is
20, maximum is100.
- Name
offset- Type
- integer
- Description
The number of results to skip for pagination. Default is
0.
- Name
volume- Type
- string
- Description
Filter results to a specific volume by its id. For example,
bookofmormon,oldtestament,newtestament,doctrineandcovenants, orpearlofgreatprice.
- Name
book- Type
- string
- Description
Filter results to a specific book by its id. For example,
alma,john,1nephi.
- Name
case_sensitive- Type
- boolean
- Description
Enable case-sensitive matching. Default is
false.
- Name
regex- Type
- boolean
- Description
Treat the
qparameter as a raw regular expression pattern, bypassing query syntax parsing. Default isfalse.
- Name
highlight- Type
- boolean
- Description
Include a KWIC (Key Word in Context) highlight snippet for each result, showing the matched term with surrounding context words. Default is
false.
- Name
highlight_window- Type
- integer
- Description
Number of words to include before and after the matched term in the highlight snippet. Default is
5. Only applies whenhighlight=true.
- Name
word_frequency- Type
- boolean
- Description
Include a
wordFrequencyarray in the response with the top 20 most frequently co-occurring words across all results (excluding stop words). Default isfalse.
Simple search
curl "https://openscriptureapi.org/api/scriptures/v1/lds/en/search?q=faith&limit=3"
Response
{
"query": "faith",
"total": 336,
"limit": 3,
"offset": 0,
"results": [
{
"reference": "Alma 32:21",
"book": "Alma",
"chapter": 32,
"verse": 21,
"text": "And now as I said concerning faith—faith is not to have a perfect knowledge of things; therefore if ye have faith ye hope for things which are not seen, which are true."
}
]
}
Exact phrase
curl "https://openscriptureapi.org/api/scriptures/v1/lds/en/search?q=%22plan+of+salvation%22"
Wildcard + NOT
curl "https://openscriptureapi.org/api/scriptures/v1/lds/en/search?q=bapti*+%23+water"
Proximity search
curl "https://openscriptureapi.org/api/scriptures/v1/lds/en/search?q=faith+%26+works+~5&volume=newtestament"
With highlights and word frequency
curl "https://openscriptureapi.org/api/scriptures/v1/lds/en/search?q=faith&highlight=true&word_frequency=true&limit=3"
Highlight + frequency response
{
"query": "faith",
"total": 336,
"limit": 3,
"offset": 0,
"results": [
{
"reference": "Alma 32:21",
"book": "Alma",
"chapter": 32,
"verse": 21,
"text": "And now as I said concerning faith—faith is not to have a perfect knowledge...",
"highlight": "… said concerning faith—faith is not to have …"
}
],
"wordFrequency": [
{ "word": "faith", "count": 12 },
{ "word": "things", "count": 5 },
{ "word": "hope", "count": 4 }
]
}
