Get a contextual filter for a View in Drupal 8
In D8 the settings of a view are stored in a configuration entity. You can load the entity with View::load() or get it from the view executable directly and then load a display and check the contextual filters (stored in the key arguments of the display options):

$storage = $view-&gt;storage;
$display = &amp;$storage-&gt;getDisplay('default');
$arguments = $display['display_options']['arguments'];

'contextual_filter' =&gt; !empty($arguments) ? 1 : 0