curl --location --request GET 'https://nostrapi.com/api/v1/utils/hex-npub?v=c79763bf83a0b3f5ecb81777d799bd36164328a70a9ac7d9aedb0e7116b4d1e0' \
--header 'Content-Type: application/json' \
--header 'apikey: <YOUR_KEY_HERE>'
{
"success": true,
"message": "Successfully fetched NPUB for c79763bf83a0b3f5ecb81777d799bd36164328a70a9ac7d9aedb0e7116b4d1e0 key.",
"data": {
"npub": "npub1c7tk80ur5zeltm9czama0xdaxctyx298p2dv0kdwmv88z94568squh6xp4"
}
}
Utility APIs
HEX to NPUB
Convert a HEX public key address to an NPUB format
GET
/
api
/
v1
/
utils
/
hex-npub
curl --location --request GET 'https://nostrapi.com/api/v1/utils/hex-npub?v=c79763bf83a0b3f5ecb81777d799bd36164328a70a9ac7d9aedb0e7116b4d1e0' \
--header 'Content-Type: application/json' \
--header 'apikey: <YOUR_KEY_HERE>'
{
"success": true,
"message": "Successfully fetched NPUB for c79763bf83a0b3f5ecb81777d799bd36164328a70a9ac7d9aedb0e7116b4d1e0 key.",
"data": {
"npub": "npub1c7tk80ur5zeltm9czama0xdaxctyx298p2dv0kdwmv88z94568squh6xp4"
}
}
Query
string
This is the HEX public key that you wish to convert.
Response
boolean
Indicates whether the call was successful.
true if successful, false if not.string
Message detailing the results of the operation.
object
The contents of the data response object.
Show Toggle
Show Toggle
string
This is the converted public key in NPUB format.
curl --location --request GET 'https://nostrapi.com/api/v1/utils/hex-npub?v=c79763bf83a0b3f5ecb81777d799bd36164328a70a9ac7d9aedb0e7116b4d1e0' \
--header 'Content-Type: application/json' \
--header 'apikey: <YOUR_KEY_HERE>'
{
"success": true,
"message": "Successfully fetched NPUB for c79763bf83a0b3f5ecb81777d799bd36164328a70a9ac7d9aedb0e7116b4d1e0 key.",
"data": {
"npub": "npub1c7tk80ur5zeltm9czama0xdaxctyx298p2dv0kdwmv88z94568squh6xp4"
}
}