Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress wp-api Get Users By Username

I have just installed this plugin into our WP site and am trying to figure out how to property use the users endpoint to find a user by their username. I have tried the filter several different ways, but it keeps returning all users. Has anyone been able to accomplish this, and if so, what parameters need to be passed to properly setup the filter?

Here is the URL I am using http://www.example.com/wp-json/users?filter[orderby]=login&filter[s]=admin

I have tried it with and without the orderby parameter, which according to the docs, is supposed to determine what field the filter applies to. I have also tried setting the value of the orderbvy user_login.

like image 396
Paul Zepernick Avatar asked Sep 19 '25 06:09

Paul Zepernick


1 Answers

You can use the search argument

https://example.com/wp-json/wp/v2/users/?search=myusername
like image 123
Brieuc Avatar answered Sep 20 '25 21:09

Brieuc