The filter is dynamic
, i.e. generated from rest_{$post_type}_query
.
So for the post
post type it’s rest_post_query
and for the cpt
post type it’s rest_cpt_query
Note that REST pagination is available:
https://example.com/wp-json/wp/v2/posts?per_page=100&page=1
https://example.com/wp-json/wp/v2/posts?per_page=100&page=2
...
The maximum of per_page
is to reduce the risk of fatal errors if available resources are exceeded when too many items are fetched.