Avoiding initial load for image transform I'm using the element API to get the url of an asset from angular with:

'image' =&gt; $entry-&gt;playerImage-&gt;first()-&gt;getUrl("square"), 


Problem is until i visit that image in the browser the url doesn't work, does someone know of a nice way of dealing with this?
You can tell Craft to generate new image transforms right when getUrl() is called by setting the generateTransformsBeforePageLoad config setting to true. Assuming you still want the default behavior on your main website, you can set the setting programatically from your endpoint config with ConfigService::set():

'endpoint/path' =&gt; function() {
    craft()-&gt;config-&gt;set('generateTransformsBeforePageLoad', true);

    return [
        // ...
    ];
},