Get Identity
curl --request GET \
--url https://api-mainnet.onzks.com/v1/identity/:identity \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-mainnet.onzks.com/v1/identity/:identity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-mainnet.onzks.com/v1/identity/:identity', 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://api-mainnet.onzks.com/v1/identity/:identity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api-mainnet.onzks.com/v1/identity/:identity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-mainnet.onzks.com/v1/identity/:identity")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-mainnet.onzks.com/v1/identity/:identity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": false,
"error": "Identity 'alice.zks' not found or not activated"
}
{
"success": false,
"error": "Invalid identity format. Must be a wallet address or a ZKS ID (e.g., 'alice.zks')"
}
Identity
Get Identity
Retrieve identity information by ZKS ID or wallet address
GET
/
v1
/
identity
/
:identity
Get Identity
curl --request GET \
--url https://api-mainnet.onzks.com/v1/identity/:identity \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-mainnet.onzks.com/v1/identity/:identity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-mainnet.onzks.com/v1/identity/:identity', 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://api-mainnet.onzks.com/v1/identity/:identity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api-mainnet.onzks.com/v1/identity/:identity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-mainnet.onzks.com/v1/identity/:identity")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-mainnet.onzks.com/v1/identity/:identity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": false,
"error": "Identity 'alice.zks' not found or not activated"
}
{
"success": false,
"error": "Invalid identity format. Must be a wallet address or a ZKS ID (e.g., 'alice.zks')"
}
Overview
Get detailed information about a ZKScore identity, including their ZKS ID, wallet address, activation status, and metadata.Parameters
string
required
ZKS ID (e.g.,
alice.zks) or wallet address (e.g., 0x742d35Cc...)ZKS ID Requirements: If using a ZKS ID, it must be activated (soulbound). The API will return the primary wallet address and aggregated data across all linked wallets.
Response
boolean
Indicates if the request was successful
string | null
The ZKS ID (without .zks suffix), or null if not set
string
The primary wallet address
object
Show properties
Show properties
number
The NFT token ID of the identity
string
The ZKS ID name (without .zks suffix)
string
The wallet address that owns this identity
boolean
Whether the identity is activated (soulbound)
string
ISO 8601 timestamp of when the identity was minted
string | null
ISO 8601 timestamp of when the identity was activated
Examples
curl https://api.onzks.com/v1/identity/alice.zks \
-H "Authorization: Bearer YOUR_API_KEY"
curl https://api.onzks.com/v1/identity/0x742d35Cc6635C0532925a3b844D1FF4e1321 \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.onzks.com/v1/identity/alice.zks', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data.identity);
import requests
response = requests.get(
'https://api.onzks.com/v1/identity/alice.zks',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
print(data['identity'])
Response Example
{
"success": true,
"zksId": "alice",
"address": "0x742d35cc6635c0532925a3b844d1ff4e1321",
"identity": {
"tokenId": 12345,
"name": "alice",
"ownerAddress": "0x742d35cc6635c0532925a3b844d1ff4e1321",
"isActivated": true,
"createdAt": "2024-01-15T10:30:00Z",
"activatedAt": "2024-01-15T11:00:00Z"
}
}
Error Responses
{
"success": false,
"error": "Identity 'alice.zks' not found or not activated"
}
{
"success": false,
"error": "Invalid identity format. Must be a wallet address or a ZKS ID (e.g., 'alice.zks')"
}
Use Cases
1. Profile Lookup
Use ZKS ID for a cleaner user experience:// User enters their ZKS ID
const identity = await getIdentity('alice.zks');
displayProfile(identity);
2. Identity Verification
Check if an identity exists and is activated:const identity = await getIdentity('alice.zks');
if (identity.identity.isActivated) {
console.log('Identity is verified and soulbound');
}
3. Address Resolution
Resolve a ZKS ID to a wallet address:const identity = await getIdentity('alice.zks');
const walletAddress = identity.address;
Related Endpoints
- Mint Identity - Create a new identity
- Activate Identity - Make an identity soulbound
- Check Availability - Check if a name is available