Jedrik if your forum user slugger is "username", which is the default (profile pages at /u/<username>
), then you can use /api/users/<username>?bySlug=1
For example https://discuss.flarum.org/api/users/clarkwinkelmann?bySlug=1
But if your user slugger isn't username (profile pages at /u/<id>
or other) then bySlug=
won't work for usernames anymore. In this case you would have to use the search at /api/users?filter[q]=
For example https://discuss.flarum.org/api/users?filter[q]=clarkwinkelmann
Unfortunately there's no way to search users by just the username or by the full username (partial matches will also be returned) so you might get multiple results. You can filter the list returned by the API by looking for the username
in the data. If there are more than 20 results that API will be paginated. You can request up to 50 results by using /api/users?page[limit]=50&filter[q]=
You could also use the Flarum extension PHP API to register a new filter on the /api/users
endpoint to allow filtering by exact username, which would mean there would always be 0 or 1 results and never more.