Site icon Hip-Hop Website Design and Development

Does something like is_rest() exist

I am starting a bit with the REST API. If I am not completly mislead, the init action hook is also executed when its a REST API request. Now, I want to execute some code only, when it is not a REST API request.

So I was looking for a command like is_rest() in order to do something like

<?php
if( ! is_rest() ) echo 'no-rest-request';
?>

But I couldn’t find something like this. Is there a is_rest() out there?