Check for logged in user with the Element API plugin
Assuming you want to do this from your transformer, then something like this should work:

'transformer' =&gt; function($entry) {

    $isLoggedIn = craft()-&gt;userSession-&gt;isLoggedIn(); 

    if ($isLoggedIn) {
        // Do your custom logic.
    }

    return array(
        'title' =&gt; $entry-&gt;title,
        'url' =&gt; $entry-&gt;url,
        'description' =&gt; (string) $entry-&gt;description,
        'photos' =&gt; $photos
    );
},