Element API: List entries related by tag
The Similar plugin allows access to its find() method from PHP and your Element API configuration file.

$similarEntriesByTags = craft()-&gt;similar-&gt;find([
    element =&gt; $entry,
    context =&gt; $entry-&gt;tags,
    criteria =&gt; $limitCriteria,
]);


This is the equivalent to the Twig example code in the readme.

{% set similarEntriesByTags = craft.similar.find({ element: entry, context: entry.tags }) %}


If you’re inexperienced in quering for entries or using element criteria in PHP in general have a look a the Working with Elements article in the Craft documentation.