How to skip the first X entries using ElementAPI I'm looking how to use the .offset(x) parameters of craft.entries inside the ElementAPI.

I tried to add 'offset' =&gt; 1 before, after and inside the criteria array, but the x first entries are still added to the JSON.

How can I skip the first X entries of ElementAPI?
It seems that offset doesn't work when pagination is set to true (which is its default value). 

If you don't need pagination for your results, you can add your offset in criteria and set pagination to false.

If you do need pagination and the desired offset is the same as elementsPerPage, you can get your results starting from page 2. You'll have to make sure you're actually getting page 2 because it will return page 1 if there aren't enough results for a second page.

If you do need pagination and the desired offset is different from elementsPerPage, you can try what I've done here.

'stories.json' =&gt; function() {
    // Get get IDs of the "offset" entries. Set `limit` to the offset amount you want.
    $excludedIds = Entry::find()
        -&gt;section('stories')
        -&gt;limit(4)
        -&gt;ids();

    // Form value for id in criteria to exclude the above entries.
    $criteriaId = count($excludedIds) ? ('and, not ' . implode(', not ', $excludedIds)) : null;

    return [
        'elementType' =&gt; Entry::class,
        'criteria' =&gt; [
            'section' =&gt; 'stories',
            'id' =&gt; $criteriaId,
        ],
        'pretty' =&gt; true,
        'elementsPerPage' =&gt; 6,
        'transformer' =&gt; function(Entry $entry) {
            return [
                'title' =&gt; $entry-&gt;title,
                'url' =&gt; $entry-&gt;url,
                'id' =&gt; $entry-&gt;id,
            ];
        },
    ];
},


I found that you can still paginate results with a value for id set in criteria. So, I've excluded the IDs of the offset entries and paginated the results with those entries removed.

I've also made an issue on the Element API Github repo to see if there's a better solution:
https://github.com/craftcms/element-api/issues/99