## Fetch a list of signers provided by an FID

### cURL

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

### Python

```python
import requests

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

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

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

print(response.text)
```

### JavaScript (Fetch API)

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

fetch('https://snapchain-api.neynar.com/v1/onChainSignersByFid', 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/onChainSignersByFid",
  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

```go
package main

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

func main() {

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

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)

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

### Ruby

```ruby
require 'uri'
require 'net/http'

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

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 Structure

A successful response returns the following structure:

```json
{
  "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
  }
}
```

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

### Authorizations

- **x-api-key**  (string, required): API key to authorize requests.
  - Default: `NEYNAR_API_DOCS`

### Query Parameters

- **fid** (integer, required): The FID being requested.
- **signer** (string, optional): The optional key of signer.

### Response Codes

- **200**: A successful response.

### Additional Information
- This documentation provides the API endpoint to fetch a list of signers for a given FID.
