WP-API: get posts in multiple categories

Assusming you are using V1 of the WP-API, did you tried the following endpoint:


I’m looking at the code in WP_JSON_Posts class and the get_post() should be able to handle that use case.

UPDATE: It seems there is a limitation with the way the query is built.
Here is a potential workaround:

add_filter('json_query_var-category_name', function( $var ) {
   return str_replace(' ', '+', $filter[ $var ] );

Or even better (without new code)! Encode the + in the url with %2B:


This seems to work for me!
See here for clarifications: https://bugs.php.net/bug.php?id=39078

Note: In V2 this endpoint will not work.