How to use multiple different instances Element API "Load More" button? Following up on a previous question of mine:
How to skip the first few entries in a &quot;load more&quot; scenario with Element API?
I have a website that utilizes the &quot;load More&quot; (button) method shown here:
http://craftsnippets.com/articles/infinite-scrolling-and-lazy-loading-with-craft-cms
On my site, I have a homepage that displays the first 6 post in a featured way, then below I have a &quot;more posts&quot; area. In my previous question, I was shown how to deal with skipping the fist 6 posts in the loop of the &quot;load more&quot; area.
However, I want to use the &quot;load more&quot; button elsewhere on the site. Such as:

Category Page – Same as the Homepage, but only showing more entries in whatever category the page is.
Individual Entry Page – In this instance I need the &quot;Load More&quot; area to not skip the first 6 entries.

I can't seem to figure out how use this method in different ways across the site, because the settings for one instance bleeds into the other instances. So, how can I accomplish this? (sorry if this is basic stuff. dealing with API is still new to me)
You could add a new param to the request called skip and use that on your homepage, and default it to zero to allow you to reuse the endpoint elsewhere.
$skipEntries = Craft::$app-&gt;request-&gt;getParam('skip') ?? 0;
$criteria = [
    'section' =&gt; $settings['section'], 
    'limit' =&gt;  $settings['limit'],
    'offset' =&gt;  ($settings['limit'] * Craft::$app-&gt;request-&gt;getParam('offset')) + $skipEntries,
    'order' =&gt; $settings['orderBy'],
];

You'll need to add the skip parameter to the data object in the jQuery $.ajax request options object for your homepage implementation:
$.ajax({
    // some params here
    data: {
        skip: 6,
        offset: lazy_offset,
        settings: lazy_settings,
    },
    // some more params here
}

Other pages would omit the skip parameter. That's one way of solving the problem.