Skip to main content

GetAccountId

Converts a secret passphrase or public key into a numeric account ID, which can then be used with other API endpoints.

Request

GET /nxt?requestType=getAccountId

All endpoints use port 22024 by default.

Parameters

NameTypeDescriptionRequired
secretPhrasestringAccount passphraseOptional
publicKeystringAccount public key in hex formatOptional

Either secretPhrase or publicKey must be provided.

Response

{
"account": "1234567890",
"accountRS": "SHAMWARI-ABCD-EFGH-IJKL-MNOPQ",
"publicKey": "abc123...",
"errorCode": 0,
"errorDescription": ""
}

Response Fields

FieldTypeDescription
accountstringAccount ID (unsigned 64-bit integer as string)
accountRSstringAccount Reed-Solomon address in SHAMWARI format
publicKeystringThe public key used for derivation

Error Codes

CodeDescription
7Missing parameter - neither secretPhrase nor publicKey provided

Example

# From passphrase
curl "http://localhost:22024/nxt?requestType=getAccountId&secretPhrase=my_secret_passphrase"

# From public key
curl "http://localhost:22024/nxt?requestType=getAccountId&publicKey=abc123..."