apiParam API Parameter

The apiParam API parameter allows you to pass custom values to the API template. You can use the values for custom logic or to display a value that it's part of the API data.


{{ _api.blog.recentPosts.template('template-key').apiParam({customVar1: 'My custom value', customVar2: 'Another custom value') }}

You can then access the values under the apiParam variable.

In the above example, we can access the apiParam values like this:

{{ apiParam.customVar1 }}

{{ apiParam.customVar2 }}

{% if apiParam.customVar1 == 'My custom value' %}
    <p>Do something here</p>
{% endif %}

You can use whatever you want as the variable name, as long as it's only letters and numbers.

The value for each variable can be a boolean, string, number, array, or object.