/accounts/{accountId}/convert - Polkadot
Example code for the /accounts/{accountId}/convert REST method. Complete guide on how to use /accounts/{accountId}/convert REST in GetBlock Web3 documentation.
This endpoint converts an account address between SS58 formats and its raw AccountId, using the given prefix and scheme.
Endpoint
GET /accounts/{accountId}/convertPath Parameters
accountId
string
SS58 address or public key
Query Parameters
scheme
string
No
Signature scheme (sr25519, ed25519, ecdsa)
prefix
integer
No
Target SS58 prefix (0 for Polkadot)
publicKey
boolean
No
Whether the input is a public key
Request
curl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/convert?prefix=0'const response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/convert?prefix=0');
const data = await response.json();
console.log(data);import requests
response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/accounts/15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5/convert?prefix=0')
print(response.json())Response
Response Fields
ss58Prefix
string
The SS58 prefix used
network
string
The network name for the prefix
address
string
The SS58-encoded address
accountId
string
The raw 32-byte AccountId, hex-encoded
Use Cases
Address Conversion: Convert an address between chain prefixes
Cross-Chain UX: Show the same account across networks
Key Handling: Derive the AccountId from an address
Indexing: Normalize addresses to a canonical form
Last updated
Was this helpful?