Search for groups that are related to the text.
Returns a JSONArray named "related_groups" with result objects.

Request Parameters

collection_idint (required)
Id for the collection where the text is stored.
text_idint (required)
Id for text to find get related contexts to.
group_scopeint (default: all your groups)

The group ids you want the text to be compared against. Can either be a single integer or an array containing many groups e.g. "group_scope":[1,32,54]

waitint (default: 5)
Maximum time you want to wait for a result to be calculated. Maximum wait time is 60 sec. If wait time is zero (0) you will only start the process and disconnect and can check out the result later. An exception will be thrown saying processing request. (See Error Codes)
min_thresholddecimal (default: 0.0)
If you only want results that have higher than 50 % relevance to the source text, provide 0.5 as parameter.
max_thresholddecimal (default: 1.0)
Maximum relevance value you want to have in your result set.

Get related groups based on external text id.

limitint (default: 10)

Set max number of results.

Response Parameters

The result group id.
The relevance value between 0-1.
Name of the group

Code Examples



          "name": "Technology",
          "name": "Sport",
          "name": "My personal Interests",


// You need to have a ready-to-use client to use the other methods
SaploClient client = new SaploClient("YOUR_API_KEY", "YOUR_SECRET_KEY");

// Create a SaploTextManager to work with texts
SaploTextManager textMgr = new SaploTextManager(client);

// Assuming you already have collection the text belongs to and the text ID 
SaploText text = new SaploText();

// Find groups that are related to the given text, among your groups

// The related groups can now be retrieved by .getRelatedGroups(); 
// on the text object
// Print the result
for(SaploGroup related : text.getRelatedGroups())
    System.out.println("Related group Id: " + related.getId() 
        + " relevance: " + related.getRelatedRelevance());


$client = new SaploAPI("YOUR API KEY", "YOUR SECRET KEY");

$params = array(
    "collection_id" => 15,
    "text_id" => 1

try {
    $result = $client->text->related_groups($params);
} catch(SaploException $e) {
    echo '(' . $e->getCode() . ') ' . $e->getMessage();


params.text_id = 1;
params.collection_id = 2131;
params.wait = 15;

response = saploRequest('text.relatedGroups', params)