Neynar Documentation

Fetch a list of on-chain events provided by an FID

cURL

curl --request GET \
  --url 'https://snapchain-api.neynar.com/v1/onChainEventsByFid?event_type=EVENT_TYPE_SIGNER' \
  --header 'x-api-key: NEYNAR_API_DOCS'

Python

import requests

url = "https://snapchain-api.neynar.com/v1/onChainEventsByFid?event_type=EVENT_TYPE_SIGNER"

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

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

print(response.text)

JavaScript (Fetch API)

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

fetch('https://snapchain-api.neynar.com/v1/onChainEventsByFid?event_type=EVENT_TYPE_SIGNER', 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://snapchain-api.neynar.com/v1/onChainEventsByFid?event_type=EVENT_TYPE_SIGNER",\
  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/onChainEventsByFid?event_type=EVENT_TYPE_SIGNER"

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/onChainEventsByFid?event_type=EVENT_TYPE_SIGNER")
  .header("x-api-key", "NEYNAR_API_DOCS")
  .asString();

Ruby

require 'uri'
require 'net/http'

url = URI("https://snapchain-api.neynar.com/v1/onChainEventsByFid?event_type=EVENT_TYPE_SIGNER")

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

Expected Response

200

{
  "events": [
    {
      "type": "EVENT_TYPE_SIGNER",
      "chainId": 123,
      "blockNumber": 123,
      "blockHash": "0x75fbbb8b2a4ede67ac350e1b0503c6a152c0091bd8e3ef4a6927d58e088eae28",
      "blockTimestamp": 123,
      "transactionHash": "0x36ef79e6c460e6ae251908be13116ff0065960adb1ae032b4cc65a8352f28952",
      "logIndex": 123,
      "txIndex": 123,
      "fid": 123,
      "signerEventBody": {
        "key": "<string>",
        "keyType": 123,
        "eventType": "SIGNER_EVENT_TYPE_ADD",
        "metadata": "aSDinaTvuI8gbWludGxpZnk=",
        "metadataType": 123
      }
    }
  ]
}
{
  "errCode": "<string>",
  "presentable": true,
  "name": "<string>",
  "code": 123,
  "details": "<string>",
  "metadata": {
    "errcode": [
      "<string>"
    ]
  }
}

Authorizations

Query Parameters

Response