Neynar Documentation

Fetch an on-chain ID Registry Event for a given Address

cURL

curl --request GET \
  --url https://snapchain-api.neynar.com/v1/onChainIdRegistryEventByAddress \
  --header 'x-api-key: NEYNAR_API_DOCS'

Python

import requests

url = "https://snapchain-api.neynar.com/v1/onChainIdRegistryEventByAddress"

headers = {"x-api-key": "NEYNAR_API_DOCS"}

response = requests.get(url, headers=headers)

print(response.text)

JavaScript (Fetch)

const options = {method: 'GET', headers: {'x-api-key': 'NEYNAR_API_DOCS'}};

fetch('https://snapchain-api.neynar.com/v1/onChainIdRegistryEventByAddress', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, [\
  CURLOPT_URL => "https://snapchain-api.neynar.com/v1/onChainIdRegistryEventByAddress",\
  CURLOPT_RETURNTRANSFER => true,\
  CURLOPT_ENCODING => "",\
  CURLOPT_MAXREDIRS => 10,\
  CURLOPT_TIMEOUT => 30,\
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\
  CURLOPT_CUSTOMREQUEST => "GET",\
  CURLOPT_HTTPHEADER => [\
    "x-api-key: NEYNAR_API_DOCS"\
  ],\
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Go

package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {

url := "https://snapchain-api.neynar.com/v1/onChainIdRegistryEventByAddress"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "NEYNAR_API_DOCS")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}

Unirest (Java)

HttpResponse<String> response = Unirest.get("https://snapchain-api.neynar.com/v1/onChainIdRegistryEventByAddress")
  .header("x-api-key", "NEYNAR_API_DOCS")
  .asString();

Ruby

require 'uri'
require 'net/http'

url = URI("https://snapchain-api.neynar.com/v1/onChainIdRegistryEventByAddress")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = 'NEYNAR_API_DOCS'

response = http.request(request)
puts response.read_body

Response

200

{
  "type": "EVENT_TYPE_SIGNER",
  "chainId": 123,
  "blockNumber": 123,
  "blockHash": "0x75fbbb8b2a4ede67ac350e1b0503c6a152c0091bd8e3ef4a6927d58e088eae28",
  "blockTimestamp": 123,
  "transactionHash": "0x36ef79e6c460e6ae251908be13116ff0065960adb1ae032b4cc65a8352f28952",
  "logIndex": 123,
  "txIndex": 123,
  "fid": 123,
  "idRegisterEventBody": {
    "to": "0x00000000fcd5a8e45785c8a4b9a718c9348e4f18",
    "eventType": "ID_REGISTER_EVENT_TYPE_REGISTER",
    "from": "0x00000000fcd5a8e45785c8a4b9a718c9348e4f18",
    "recoveryAddress": "0x00000000fcd5a8e45785c8a4b9a718c9348e4f18"
  }
}

Error Response

{
  "errCode": "<string>",
  "presentable": true,
  "name": "<string>",
  "code": 123,
  "details": "<string>",
  "metadata": {
    "errcode": [
      "<string>"
    ]
  }
}