The SearchBlox REST-API enables you to index and search custom content using simple HTTP POST and GET actions. The REST-API can add and delete documents from Custom, WEB and File Collections only.
The SearchBlox HTTP-API enables you to index and search web content using simple HTTP POST and GET actions. The HTTP-API can add and delete HTTP collections, update paths and settings, schedule indexing and stop indexing the collection. SearchBlox HTTP-API provides methods for working with HTTP collections of REST requests with JSON payloads.
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "E9047FDBA2F55DCC32A93475DA1FAB6D",
"document" : {
"colname" : "custom",
"url" : "http://www.searchblox.com",
"uid" : "http://www.searchblox.com",
"location":"http://www.searchblox.com",
"alpha" : "string",
"size" : "44244",
"title" : "Text",
"keywords" : "keywords",
"description" : "SearchBlox Content Search Software",
"content" : "content",
"lastmodified" : "07 May 2000 06:19:42 GMT",
"contenttype" : "HTML",
"meta":{
"location":"San Francisco",
"temp":"23",
"weather":"sunny"
}
}
}' "https://localhost:8443/rest/v1/api/add"
Field Description Type Example Value apikey
The API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6D
document
The main object containing document details Object { ... }
colname
The name of the collection String custom
url
The document URL String http://www.searchblox.com
uid
Unique identifier for the document String http://www.searchblox.com
location
The document's location String http://www.searchblox.com
alpha
Custom string field String string
size
The document size in bytes String 44244
title
Title of the document String Text
keywords
Keywords associated with the document String keywords
description
Short description of the document String SearchBlox Content Search Software
content
The main content of the document String content
lastmodified
Last modified date and time in GMT format String 07 May 2000 06:19:42 GMT
contenttype
Type of content (e.g., HTML, JSON, PDF) String HTML
meta
Metadata related to the document Object { "location": "San Francisco", "temp": "23", "weather": "sunny" }
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{ "apikey" : "E9047FDBA2F55DCC32A93475DA1FAB6D",
"document" : {
"colname" : "custom",
"location" : "http://www.searchblox.com"
}
}
' "https://localhost:8443/rest/v1/api/docdelete"
Field Description Type Example Value apikey
The API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6D
document
The object containing document deletion details Object { ... }
colname
The name of the collection where the document is stored String custom
location
The URL/location of the document to be deleted String http://www.searchblox.com
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "E9047FDBA2F55DCC32A93475DA1FAB6D",
"document" :
{
"colname" : "custom",
"uid" : "http://www.searchblox.com"
}
}
' "https://localhost:8443/rest/v1/api/status"
Field Description Type Example Value apikey
The API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6D
document
The object containing document status details Object { ... }
colname
The name of the collection where the document is stored String custom
uid
Unique identifier of the document to check status String http://www.searchblox.com
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"document":
{
"colname": "custom"
}
}' "https://localhost:8443/rest/v1/api/clear"
Field Description Type Example Value apikey
The API key used for authentication String 267BACD0F31A74F557426DD2A552ECDD
document
The object containing collection clear details Object { ... }
colname
The name of the collection to be cleared String custom
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "E9047FDBA2F55DCC32A93475DA1FAB6D",
"public":true,
"encrypt":false,
"document" :
{
"colname":"Custom_Collection",
"coltype":"custom",
"language":"en"
}
}' "https://localhost:8443/rest/v1/api/coladd"
Field Description Type Example Value apikey
The API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6D
public
Determines if the collection is public Boolean true
encrypt
Determines if the collection is encrypted Boolean false
document
The object containing collection details Object { ... }
colname
The name of the collection String Custom_Collection
coltype
The type of the collection String custom
language
The language used for the collection String en
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "E9047FDBA2F55DCC32A93475DA1FAB6D",
"document" :
{
"colname" : "Custom_Collection"
}
}' "https://localhost:8443/rest/v1/api/coldelete"
Field Description Type Example Value apikey
The API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6D
document
The object containing collection details Object { ... }
colname
The name of the collection to be deleted String Custom_Collection
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{ "apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"document" : {
"colname" : "test",
"location" : "http://www.searchblox.com" } }
' "https://localhost:8443/rest/v1/api/docadd"
Field Description Type Example Value apikey
The API key used for authentication String 267BACD0F31A74F557426DD2A552ECDD
document
The object containing document details Object { ... }
colname
The name of the collection String test
location
The document URL/location String http://www.searchblox.com
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{ "apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"document" : {
"colname" : "test",
"location" : "http://www.searchblox.com" } }
' "https://localhost:8443/rest/v1/api/docdelete"
Field Description Type Example Value apikey
The API key used for authentication String 267BACD0F31A74F557426DD2A552ECDD
document
The object containing document details Object { ... }
colname
The name of the collection String test
location
The document URL/location to be deleted String http://www.searchblox.com
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"publiccol":true,
"encrypted":false,
"colname":"http",
"coltype":"http",
"language":"en"
}' "https://localhost:8443/rest/collection/add"
Field Description Type Example Value apikey
The API key used for authentication String 267BACD0F31A74F557426DD2A552ECDD
publiccol
Determines if the collection is public Boolean true
encrypted
Determines if the collection is encrypted Boolean false
colname
The name of the collection String http
coltype
The type of the collection String http
language
The language used in the collection String en
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"colname":"http"
}' "https://localhost:8443/rest/collection/delete"
Field Description Type Example Value apikey
The API key used for authentication String 267BACD0F31A74F557426DD2A552ECDD
colname
The name of the collection to be deleted String http
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"colname":"http",
"rooturls": [
"http://edition.cnn.com"
],
"allowpaths": [
".*"
],
"allowformat": [
"HTML",
"text"
]
}' "https://localhost:8443/rest/collection/updatePath"
Field Description Type Example Value apikey
The API key used for authentication String 267BACD0F31A74F557426DD2A552ECDD
colname
The name of the collection to be updated String http
rooturls
List of root URLs to crawl Array ["http://edition.cnn.com"]
allowpaths
List of allowed paths (Regex patterns) Array [".*"]
allowformat
Allowed content formats Array ["HTML", "text"]
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Accept: application/json" -H "Content-Type: application/json" -H "Cache-Control: no-cache -d '{
"apikey": "267BACD0F31A74F557426DD2A552ECDD",
"colname": "http",
"keyword-in-context": "false",
"remove-duplicates": "false",
"boost": "100",
"stemming": "false",
"spelling": "true",
"logging": "true",
"html-settings":
{
"description": "meta",
"max-doc-age": "-1",
"max-doc-size": "-1",
"spider-max-depth": "10",
"spider-max-delay": "0",
"user-agent": "SearchBlox",
"referer": "",
"ignore-robots": "false",
"follow-sitemap": "false",
"follow-redirect": "true"
},
"basic-auth-settings":
{
"username": "",
"password": ""
},
"form-auth-settings":
{
"form-url": "",
"form-action": "post",
"form":
[{
"name": "",
"value": ""
}]
},
"proxy-settings":
{
"server-url": "",
"username": "",
"password": ""
}
}
' "https://localhost:8443/rest/collection/updateSettings"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"colname":"http",
"index":{
"frequency":"ONCE",
"timestamp":"21-10-2021 19:05:00"
},
"clear":{
"frequency":"MINUTELY",
"timestamp":"21-10-2021 18:05:00"
}
}
' "https://localhost:8443/rest/collection/updateScheduler"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"colname":"http",
"action":"index"
}' "https://localhost:8443/rest/collection/actions"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey" : "267BACD0F31A74F557426DD2A552ECDD",
"colname":"http",
"action":"stop"
}' "https://localhost:8443/rest/collection/actions"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey": "C6D418861BAD66A46A7CC96B70CEADF9",
"title": "featured ad",
"url": "http://www.bbc.com",
"uid": "1",
"startDate": "12-03-2021",
"expiryDate": "18-12-2021",
"expiryCount": "-1",
"priority": "1",
"active": "true",
"keywordType": "exact",
"keywords": "test is good",
"keywordsurl": "",
"keywordsFieldType": "STRING",
"type": "TEXT",
"description": "asd",
"imageUrl": "",
"useDates": "false",
"keywordsphrase": "false",
"collections": "1,2,3,4,5"
}' "https://localhost:8443/rest/v2/api/ads/create"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey": "C6D418861BAD66A46A7CC96B70CEADF9",
"title": "featured ad",
"url": "http://www.bbc.com",
"uid": "1",
"startDate": "12-03-2021",
"expiryDate": "18-11-2021",
"expiryCount": "-1",
"priority": "1",
"active": "true",
"keywordType": "exact",
"keywords": "test is good",
"keywordsurl": "",
"keywordsFieldType": "STRING",
"type": "TEXT",
"description": "asd",
"imageUrl": "",
"useDates": "false",
"keywordsphrase": "false",
"collections": "1,2,3,4,5"
}' "https://localhost:8443/rest/v2/api/ads/update"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey": "5615BEF054EB6CE7E3ECCF1DBBEC2524",
"uid": "13"
}' "https://localhost:8443/rest/v2/api/ads/delete"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey": "5615BEF054EB6CE7E3ECCF1DBBEC2524",
"uid": "13",
"active":"true"
}' "https://localhost:8443/rest/v2/api/ads/activate"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey":"C6D418861BAD66A46A7CC96B70CEADF9",
"collection":"1"
}' "https://localhost:8443/rest/v2/api/ads/list"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey":"AD22EDE4515784C4C9433C72745183BA"
}' "https://localhost:8443/rest/v2/api/ads/clear"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey":"AD22EDE4515784C4C9433C72745183BA"
}' "https://localhost:8443/rest/collection/list"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey":"C6D418861BAD66A46A7CC96B70CEADF9",
"name": "site"
}' "https://localhost:8443/rest/collection/list"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey":"ADB9E38C363A5AB7B17E34956D21543B",
"field":"content",
"col":"1,2,3",
"type":"phrase",
"operator":"or",
"limit":20,
"terms":5,
"query":"test"
}' "https://localhost:8443/rest/v2/api/related/query"
cURL
curl -X POST -H "SB-PKEY: LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cache-Control: no-cache" -d '{
"apikey":"ADB9E38C363A5AB7B17E34956D21543B",
"col":1,
"limit":12
}' "https://localhost:8443/rest/v2/api/query/top"