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
| Name | Type | Description | Required |
|---|---|---|---|
secretPhrase | string | Account passphrase | Optional |
publicKey | string | Account public key in hex format | Optional |
Either secretPhrase or publicKey must be provided.
Response
{
"account": "1234567890",
"accountRS": "SHAMWARI-ABCD-EFGH-IJKL-MNOPQ",
"publicKey": "abc123...",
"errorCode": 0,
"errorDescription": ""
}
Response Fields
| Field | Type | Description |
|---|---|---|
account | string | Account ID (unsigned 64-bit integer as string) |
accountRS | string | Account Reed-Solomon address in SHAMWARI format |
publicKey | string | The public key used for derivation |
Error Codes
| Code | Description |
|---|---|
| 7 | Missing 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..."