Search a collection for related texts.
Returns a JSONArray named "related_texts" containing the result objects.

Request Parameters

collection_idint (required)
Collection id where your text is stored.
text_idint (required)
Id of the text to which you want to find other related texts.
related_byString (default: automatic)

How the texts should be related.
"automatic" - The engine automatically choose the best way.
"semantic" - Searching for texts based on the same semantic meaning.
"statistic" - Searching for texts based on statistical relations. E.g. number of words, similar words, common words etc.

collection_scopeint/array (default: Same as collection_id)
Search the given collection id(s) to find related texts. (To search in other collections than your source "collection_id" is a premium feature).
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)

limitint (default: 10)

The maximum number of related texts you want in your result. There is no guarantee that the number of results will equal the limit. Max 50.

min_thresholddecimal (default: 0.0)
If you only want related texts that are 50 % like your source text, provide 0.5 as parameter.
max_thresholddecimal (default: 1.0)
If you only want related texts that has a relevance to the source text to a max of 90 %, provide 0.9 as parameter.

The external id of the text to which you want to find other related texts. If this variable is set you can skip text_id parameter.

text_scopeArray (Int)
Define which texts you want to compare against. (can only compare against the same collection)

Response Parameters

Collection id for related text.
Id for related text.

Relevance value between 0.0-1.0.
1.0 is the exact same text.

Date when text was published. Set when text was created.
Headline of related text.
URL of related text.

External text id.

Code Examples



          "headline":"Getting started",
          "headline":"Blogging is fun",


// 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 texts that are related to the text in the same collection

// The related texts can now be retrieved by .getRelatedTexts(); 
// on the text object
// Print the result
for(SaploText related : text.getRelatedTexts())
    System.out.println("Related text 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_texts($params);
} catch(SaploException $e) {
    echo '(' . $e->getCode() . ') ' . $e->getMessage();


client = SaploJSONClient("YOUR API KEY", "YORU SECRET KEY")

related_texts = client.text.related_texts(

print "Related texts:", related_texts


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

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