Get user information¶
GET /api/v5/users/{username}
Get the specified user's information by username.
Supported access tokens¶
- AtomGit user access token (AtomGit user access tokens)
Anonymous access¶
This endpoint allows anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
username |
path | string | Yes | Username (username) |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
avatar_url |
string | Yes | No | Avatar URL |
followers_url |
string | Yes | Yes | Followers list URL |
html_url |
string | Yes | No | User profile URL |
id |
string | Yes | No | User ID |
login |
string | Yes | No | Login name |
name |
string | Yes | No | Username |
type |
string | Yes | No | User type, for example User |
url |
string | Yes | No | User API URL |
bio |
string | Yes | Yes | Personal bio |
blog |
string | Yes | Yes | Personal blog URL |
company |
string | Yes | Yes | Company |
email |
string | Yes | Yes | Email address |
followers |
integer | Yes | Yes | Number of followers |
following |
integer | Yes | Yes | Number of users being followed |
top_languages |
string[] | Yes | Yes | List of frequently used languages |
Error response¶
This endpoint has no business-level error response.
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Requires authentication |
403 |
Forbidden |
404 |
User not found |
Request example¶
Parameter notes¶
This endpoint allows anonymous access, and an AtomGit user access token may also be sent. username is a path parameter: replace it with the target user's username.
replace
<username>with the target username (username).
cURL¶
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/users/<username>", {
headers: {
"Accept": "application/json",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v5/users/<username>",
headers={
"Accept": "application/json",
},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
{
"avatar_url": "https://api.atomgit.com/avatars/octocat.png",
"followers_url": "https://api.atomgit.com/api/v5/users/octocat/followers",
"html_url": "https://api.atomgit.com/octocat",
"id": "650d67fbae6d795139b49b41",
"login": "octocat",
"name": "Octocat",
"type": "User",
"url": "https://api.atomgit.com/api/v5/octocat",
"bio": "A passionate developer.",
"blog": "https://api.atomgit.com/blog/octocat",
"company": "AtomGit",
"email": "octocat@atomgit.com",
"followers": 20,
"following": 6,
"top_languages": ["Java", "Python"]
}
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access token) |
400 |
Invalid parameters or unparseable request |
404 |
Request path does not exist |
405 |
Request method not supported |
429 |
Too many requests; rate limit triggered |
500 |
Internal system error |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc