5

How do I can find someone's userid if I have only their username?

For example, my real username is: Zagorulkin Dmitry

My Stack Overflow userid is: 1321404

Are there any API methods for this kind of task?

1 Answer 1

4

To find user_id(s) for a username, use the inname parameter of the /users query.
You will have to repeat this query call for every Stack Exchange site that you are interested in. For example:

If you only want the user_id, create a filter to that effect. For those two example queries, I used a filter to return just the user_id and the account_id; resulting in:

{"items":[{"user_id":1321404,"account_id":1390443}],"quota_remaining":263,"quota_max":300,"has_more":false}

and

{"items":[{"user_id":57385,"account_id":1390443}],"quota_remaining":262,"quota_max":300,"has_more":false}

respectively.


The account_id is useful, because once you know it, you can use
/users/{accountId}/associated to get all of the user's associated account info.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.