To start I've been searching through several questions and documentation pieces but it seems with WordPress' `v2` many of the old questions are no longer valid. What I am trying to do is get all posts or a singular post from a category in Postman instead of the common returned 10 posts without having to modify the API in functions.php.

tldr
----

I started with referencing the [REST API Handbook](https://developer.wordpress.org/rest-api/) and reviewing the [schema](https://developer.wordpress.org/rest-api/reference/posts/#schema) I saw `categories` and I can return the 10 latest categories using:

```
http://foobar.com/wp-json/wp/v2/posts/categories_name=hello

```

referencing the [arguments](https://developer.wordpress.org/rest-api/reference/posts/#arguments) I see `per_page` so I tried:

```
http://foobar.com/wp-json/wp/v2/posts/categories_name=hello?per_page=‌​1

```

and it returns 10 posts from the category `hello` so I modified and tried:

```
http://foobar.com/wp-json/wp/v2/posts/categories_name=hello&per_page=‌​1

```

and I get an error returned:

> 
> {
>  "code": "rest\_invalid\_param",
>  "message": "Invalid parameter(s): per\_page",
>  "data": {
>  "status": 400,
>  "params": {
>  "per\_page": "per\_page is not of type integer."
>  }
>  } }
> 
> 
> 

Searching through Google I [see How to retrieve a list of categories/ tag in Wordpress REST API](https://stackoverflow.com/questions/20158417/how-to-retrieve-a-list-of-categories-tag-in-wordpress-rest-api) but the answers are based on `v1`.

Trying [Wordpress API JSON return limit](https://stackoverflow.com/questions/29171854/wordpress-api-json-return-limit) I use:

```
http://foobar.com/wp-json/wp/v2/posts/?per_page=‌​1

```

and I get a singular post so I modified my attempt to:

```
http://foobar.com/wp-json/wp/v2/posts/?per_page=‌​1$categories_name=hello

```

It ignores the category type and returns the latest post. Reading [Get more than 10 posts in a specific category with the WordPress API](https://wordpress.stackexchange.com/questions/274890/get-more-than-10-posts-in-a-specific-category-with-the-wordpress-api) I pulled the ID of a category (4) after using:

```
http://foobar.com/wp-json/wp/v2/categories

```

then coded:

```
http://foobar.com/wp-json/wp/v2/posts/?categories=4&per_page=‌​1

```

and I get:

> 
> {
>  "code": "rest\_invalid\_param",
>  "message": "Invalid parameter(s): per\_page",
>  "data": {
>  "status": 400,
>  "params": {
>  "per\_page": "per\_page is not of type integer."
>  }
>  } }
> 
> 
> 

I thought I might be able to use `-1` similar to the development of a theme but I get an error.

Other references I read are:

* [WP REST API - Retrieve content from page](https://wordpress.stackexchange.com/questions/222547/wp-rest-api-retrieve-content-from-page)
* [WP REST API Category](http://v2.wp-api.org/reference/categories/)
* Found this [Since filter has been removed, how to get posts by category slug with same schema as v2/posts?](https://github.com/WP-API/WP-API/issues/2949) after reading [Search post by categories Wordpress WP-API](https://stackoverflow.com/questions/38944843/search-post-by-categories-wordpress-wp-api)
* [How to get all posts related to particular category name?](https://wordpress.stackexchange.com/questions/40839/how-to-get-all-posts-related-to-particular-category-name)

After reviewing the documentation on [Pagination](https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/#pagination-parameters) it seems to only work with the `post` and not any `category`. I can only get more than 10 posts if I use `/wp-json/wp/v2/posts?per_page=20`, too.

Question
--------

When calling a site's WP API how can I control the `per_page` return of a category wether it be 1 post or all posts?