AccountAddressByID
curl --request GET \
--url https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}import requests
url = "https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"account_address": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}auth
AccountAddressByID
gRPC: cosmos.auth.v1beta1.Query/AccountAddressByID (reference)
AccountAddressByID returns account address based on account number.
GET
/
cosmos
/
auth
/
v1beta1
/
address_by_id
/
{accountId}
AccountAddressByID
curl --request GET \
--url https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}import requests
url = "https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cosmos-rest.publicnode.com/cosmos/auth/v1beta1/address_by_id/{accountId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"account_address": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Path Parameters
account_id is the account number of the address to be queried.
Query Parameters
Deprecated, use account_id instead
id is the account number of the address to be queried. This field should have been an uint64 (like all account numbers), and will be updated to uint64 in a future version of the auth query.
Response
A successful response.
Was this page helpful?