How to get a user by username from WordPress with Rest API?

31 Views Asked by At

I'm attempting to retrieve a user from my WordPress website using its username via the REST API. I've used the endpoint https://my-website.com/wp-json/wp/v2/users?search=my-username, but I'm consistently receiving an empty array as a response.

I've double-checked the username, and I'm certain it exists on the WordPress website. Despite this, I'm not sure why I'm not getting the expected response.

0

There are 0 best solutions below