Skip to content

xhs_check_auth_status

Check if an account is currently logged in to Xiaohongshu. If logged in, syncs user profile (nickname, userId, etc.) to database.

Parameters

ParameterTypeRequiredDescription
accountstringNoAccount name or ID. If not specified and only one account exists, uses that

Response

Logged in

json
{
  "account": "my-account",
  "loggedIn": true,
  "message": "Logged in as Username",
  "userInfo": {
    "userId": "xxx",
    "redId": "xxx",
    "nickname": "Username"
  },
  "profileSynced": true,
  "accountNameUpdated": false,
  "hint": "You can now use other xhs tools."
}

Not logged in

json
{
  "account": "my-account",
  "loggedIn": false,
  "message": "Not logged in",
  "hint": "Please use xhs_add_account to login."
}

Fields

FieldDescription
loggedInWhether the account is logged in
userInfoLogged in user info (only when logged in)
profileSyncedWhether profile was synced to database
accountNameUpdatedWhether account name was updated to nickname
hintNext action hint

Examples

Check specific account

xhs_check_auth_status({ account: "my-account" })

Auto-select account

xhs_check_auth_status({})

If only one account exists, it will be used automatically.

Difference from xhs_check_login_session

ToolPurpose
xhs_check_login_sessionCheck status during QR code login flow, requires sessionId
xhs_check_auth_statusCheck if a saved account is still logged in

Notes

  • If account name is a default name (e.g., manual-import), it will be updated to nickname after login
  • Status check automatically syncs user profile to account_profiles table
  • This tool does not trigger a new login flow, only checks existing session

Released under the MIT License.