You can use the bitbucket 'users' REST resource to look up information about a user.
Overview
This is a read-only resource.
Example:
$ curl https://api.bitbucket.org/1.0/users/jespern/
{
"repositories": [
{
"description": "",
"followers_count": 0,
"name": "hg-website-test",
"resource_uri": "/1.0/repositories/jespern/hg-website-test/",
"slug": "hg-website-test",
"website": null
},
# more ...
],
"user": {
"username": "jespern",
"first_name": "Jesper",
"last_name": "Noehr",
"avatar": "https://secure.gravatar.com/avatar/b658715b9635ef057daf2a22d4a8f36e?d=identicon&s=32",
"resource_uri": "/1.0/users/jespern"
}
}
If you make an authenticated request, you will be able to see more information about the user such as private repositories you have access to. Here's an example with authentication, but without any additional repositories shown:
$ curl --user username:password https://api.bitbucket.org/1.0/users/jespern/
{
"repositories": [
{
"description": "",
"followers_count": 0,
"name": "hg-website-test",
"resource_uri": "/1.0/repositories/jespern/hg-website-test/",
"slug": "hg-website-test",
"website": null
},
# more ...
],
"user": {
"username": "jespern",
"first_name": "Jesper",
"last_name": "Noehr",
"avatar": "https://secure.gravatar.com/avatar/b658715b9635ef057daf2a22d4a8f36e?d=identicon&s=32",
"resource_uri": "/1.0/users/jespern/"
}
}
Getting Basic User Information
Gets basic user information, including the public repositories.
GET /users/username/
Alternatively, you can use a validated email address in place of a username (e.g. https://api.bitbucket.org/1.0/users/evzijst@atlassian.com/).
You can use the bitbucket 'newuser' REST resource to create new users.
Creating a User
This is a POST only REST resource.
Example:
$ curl --request POST https://api.bitbucket.org/1.0/newuser/ --data "email=dummy@example.org&password=allyourbase&username=arebelongtous"
{
"username": "arebelongtous",
"email": "dummy@example.org"
}
Throttling
This resource is throttled to 100 calls every 30 minutes.
RELATED TOPICS
Getting Information about User Events
See Events.
Getting Information about Followers of a User
See Followers.






1 Comment
Hide/Show CommentsNov 24, 2011
Grace Batumbya
Please note that when an authenticate request is made, the followers_count is missing from the repositories, yet "If you make an authenticated request, you will be able to see more information about the user."
Add Comment