Craft CMS combining element-api and Simple Map plugin
It should work the same way because the modifyElementsQuery should be fired no matter where the ElementQuery object is build so you could insert the same array in your element-api endpoint as you insert in your CraftVariables entries function to  build the EntryQuery since they both use Yiis configure function to build the 

'endpoints' =&gt; [
    'api/customer-search.json' =&gt; [
        'criteria' =&gt; [
            'map' =&gt; [
                'location' =&gt; 'M2 5ND',
                'country' =&gt; 'GB',
                'radius' =&gt;  100,
                'unit' =&gt; 'mi'
            ],
            'orderBy' =&gt; 'distance'
        ],
    ],
]


should theoretically build the same object like 

{% set entries = craft.entries.map({
    location: 'M2 5ND',
    country: 'GB',
    radius: 100,
    unit: 'mi'
}).orderBy('distance') %}