Search
Search for verses containing specific words or phrases.
Search Verses
Find verses matching a search query.
GET /v1/searchQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search query |
version | string | No | Version ID (defaults to "rvr60") |
book | string | No | Limit search to a specific book ID |
testament | string | No | Limit to "OT" or "NT" |
limit | number | No | Max results (default: 20, max: 100) |
offset | number | No | Pagination offset (default: 0) |
Response
json
{
"success": true,
"data": {
"query": "amor",
"version": "rvr60",
"total": 245,
"limit": 20,
"offset": 0,
"results": [
{
"verse_id": "joh_3_16",
"reference": "Juan 3:16",
"book": {
"id": "joh",
"name": "Juan"
},
"chapter": 3,
"verse": 16,
"text": "Porque de tal manera amó Dios al mundo...",
"highlight": "Porque de tal manera <mark>amó</mark> Dios al mundo..."
}
]
}
}Examples
Basic Search
bash
curl "https://api.apibiblia.com/v1/search?q=amor&version=rvr60" \
-H "X-API-Key: YOUR_API_KEY"Search in Specific Book
bash
curl "https://api.apibiblia.com/v1/search?q=fe&book=rom" \
-H "X-API-Key: YOUR_API_KEY"Search New Testament Only
bash
curl "https://api.apibiblia.com/v1/search?q=gracia&testament=NT" \
-H "X-API-Key: YOUR_API_KEY"Paginated Results
bash
curl "https://api.apibiblia.com/v1/search?q=paz&limit=10&offset=20" \
-H "X-API-Key: YOUR_API_KEY"Search Tips
Phrase Search
Use quotes for exact phrase matching:
bash
curl "https://api.apibiblia.com/v1/search?q=\"vida eterna\"" \
-H "X-API-Key: YOUR_API_KEY"Multiple Words
By default, searches find verses containing all words:
bash
# Finds verses with both "fe" AND "esperanza"
curl "https://api.apibiblia.com/v1/search?q=fe esperanza" \
-H "X-API-Key: YOUR_API_KEY"Highlighted Results
The highlight field contains the verse text with matching terms wrapped in <mark> tags:
json
{
"text": "Porque de tal manera amó Dios al mundo...",
"highlight": "Porque de tal manera <mark>amó</mark> Dios al mundo..."
}Use this for displaying search results with highlighted matches.
Pagination
For large result sets, use limit and offset:
javascript
// Page 1 (results 0-19)
const page1 = await fetch('/v1/search?q=amor&limit=20&offset=0');
// Page 2 (results 20-39)
const page2 = await fetch('/v1/search?q=amor&limit=20&offset=20');
// Page 3 (results 40-59)
const page3 = await fetch('/v1/search?q=amor&limit=20&offset=40');Performance
For better performance, limit searches to specific books or testaments when possible.