What criteria can the Element API plugin accept?
The $entry variable that is passed to your endpoint’s transformer function will be an EntryModel object - the same type of object you use when interacting with entries in your templates. So everything you can do in your templates you can also do from this function.

The easiest way to get a Structure section entry’s children is with the getChildren() function, which will actually give you a new ElementCriteriaModel object with the descendantOf and descendantDist params pre-set for you. So here’s what your transformer function might look like:

'transformer' =&gt; function(EntryModel $state) {
  $locations = $state-&gt;getChildren()-&gt;type('location')-&gt;find();
  $locationsInfo = [];

  foreach ($locations as $location) {
    $locationsInfo[] = [
      'title' =&gt; $location-&gt;title,
      'url' =&gt; $location-&gt;url,
      // ...
    ];
  }

  return [
    'title' =&gt; $state-&gt;title,
    'url' =&gt; $state-&gt;url,
    'latitude' =&gt; $state-&gt;latitude,
    'longitude' =&gt; $state-&gt;longitude,
    'jsonUrl' =&gt; UrlHelper::getUrl("locations/{$state-&gt;id}.json"),
    'locations' =&gt; $locationsInfo
  ];
},


(Since you’re dealing with multiple entries within your transformer function, I also went ahead and renamed $entry to $state, just so it didn’t get confusing.)