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 apikeyThe API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6DdocumentThe main object containing document details Object { ... }colnameThe name of the collection String customurlThe document URL String http://www.searchblox.comuidUnique identifier for the document String http://www.searchblox.comlocationThe document's location String http://www.searchblox.comalphaCustom string field String stringsizeThe document size in bytes String 44244titleTitle of the document String TextkeywordsKeywords associated with the document String keywordsdescriptionShort description of the document String SearchBlox Content Search SoftwarecontentThe main content of the document String contentlastmodifiedLast modified date and time in GMT format String 07 May 2000 06:19:42 GMTcontenttypeType of content (e.g., HTML, JSON, PDF) String HTMLmetaMetadata 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 apikeyThe API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6DdocumentThe object containing document deletion details Object { ... }colnameThe name of the collection where the document is stored String customlocationThe 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 apikeyThe API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6DdocumentThe object containing document status details Object { ... }colnameThe name of the collection where the document is stored String customuidUnique 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 apikeyThe API key used for authentication String 267BACD0F31A74F557426DD2A552ECDDdocumentThe object containing collection clear details Object { ... }colnameThe 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 apikeyThe API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6DpublicDetermines if the collection is public Boolean trueencryptDetermines if the collection is encrypted Boolean falsedocumentThe object containing collection details Object { ... }colnameThe name of the collection String Custom_CollectioncoltypeThe type of the collection String customlanguageThe 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 apikeyThe API key used for authentication String E9047FDBA2F55DCC32A93475DA1FAB6DdocumentThe object containing collection details Object { ... }colnameThe 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 apikeyThe API key used for authentication String 267BACD0F31A74F557426DD2A552ECDDdocumentThe object containing document details Object { ... }colnameThe name of the collection String testlocationThe 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 apikeyThe API key used for authentication String 267BACD0F31A74F557426DD2A552ECDDdocumentThe object containing document details Object { ... }colnameThe name of the collection String testlocationThe 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 apikeyThe API key used for authentication String 267BACD0F31A74F557426DD2A552ECDDpubliccolDetermines if the collection is public Boolean trueencryptedDetermines if the collection is encrypted Boolean falsecolnameThe name of the collection String httpcoltypeThe type of the collection String httplanguageThe 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 apikeyThe API key used for authentication String 267BACD0F31A74F557426DD2A552ECDDcolnameThe 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 apikeyThe API key used for authentication String 267BACD0F31A74F557426DD2A552ECDDcolnameThe name of the collection to be updated String httprooturlsList of root URLs to crawl Array ["http://edition.cnn.com"]allowpathsList of allowed paths (Regex patterns) Array [".*"]allowformatAllowed 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"
Field Description Type Example Value apikeyThe API key used for authentication String 267BACD0F31A74F557426DD2A552ECDDcolnameThe name of the collection to be updated String httpkeyword-in-contextWhether to show keyword-in-context results Boolean falseremove-duplicatesWhether to remove duplicate documents Boolean falseboostBoost factor for ranking Integer 100stemmingWhether to apply stemming to search terms Boolean falsespellingWhether to enable spell correction Boolean trueloggingWhether to enable logging Boolean true
Field Description Type Example Value descriptionHTML meta description settings String metamax-doc-ageMaximum age of documents (-1 means unlimited) Integer -1max-doc-sizeMaximum document size (-1 means unlimited) Integer -1spider-max-depthMaximum depth for web crawling Integer 10spider-max-delayDelay between requests Integer 0user-agentUser agent string for crawling String SearchBloxrefererReferer header value String ""ignore-robotsWhether to ignore robots.txt rules Boolean falsefollow-sitemapWhether to follow sitemaps Boolean falsefollow-redirectWhether to follow redirects Boolean true
Field Description Type Example Value usernameUsername for basic authentication String ""passwordPassword for basic authentication String ""
Field Description Type Example Value form-urlURL of the form login page String ""form-actionHTTP method for form submission String "post"
Field Description Type Example Value nameForm field name String ""valueForm field value String ""
Field Description Type Example Value server-urlProxy server URL String ""usernameProxy username String ""passwordProxy password String ""
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"
Parameter Description Example Value colnameName of the collection "http"index.frequencyHow often indexing occurs (ONCE, DAILY, etc.) "ONCE"index.timestampTime when indexing should occur (dd-mm-yyyy HH:MM:SS) "21-10-2021 19:05:00"clear.frequencyHow often clearing occurs (HOURLY, DAILY, etc.) "MINUTELY"clear.timestampTime when clearing should occur (dd-mm-yyyy HH:MM:SS) "21-10-2021 18:05:00"
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"
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"