Skip to content

Get the profile of the authorized user

GET /api/v5/user

Retrieves the authorized user's profile, returning the details of the currently logged-in user.

Supported access tokens

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
access_token query string Yes User authorization code

Response parameters

Field Type Always returned Nullable Description
avatar_url string Yes — User avatar URL
followers_url string Yes — Followers list endpoint URL
html_url string Yes — User profile URL
id string Yes — User ID
login string Yes — Login name
name string Yes — User nickname
type string Yes — User type, for example User
url string Yes — User API URL
bio string Yes — Personal bio
blog string Yes — Personal blog URL
company string Yes — Company
email string Yes — Email address
followers integer Yes — Number of followers
following integer Yes — Number of users being followed
top_languages string[] Yes — List of frequently used languages

Error response

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

Note: The error response body structure above is an example only; the actual field names follow what the backend returns.

HTTP status codes

Status code Description
200 Success (OK)
401 Requires authentication
403 Forbidden
404 Request path does not exist
500 Internal server error

Request example

Parameter notes

  • <token> replace with your AtomGit user access token, passed as the access_token query parameter.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/user?access_token=<token>'   -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/user?access_token=<token>", {
  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/user",
    params={"access_token": "<token>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "avatar_url": "https://api.atomgit.com/avatar.png",
  "followers_url": "https://api.atomgit.com/api/v5/users/gitcode-xxm/followers",
  "html_url": "https://api.atomgit.com/gitcode-xxm",
  "id": "64e5ed8f7e20aa73efcbc302",
  "login": "gitcode-xxm",
  "name": "xxm",
  "type": "User",
  "url": "https://api.atomgit.com/api/v5/gitcode-xxm",
  "bio": "a PM ",
  "blog": "https://api.atomgit.com",
  "company": "",
  "email": "xiongjiamu@163.com",
  "followers": 8,
  "following": 35,
  "top_languages": ["Python", "Markdown", "C++", "C", "HTML"]
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access token)
403 Forbidden
404 Request path does not exist
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc