# bor_getAuthor

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://polygon-mainnet.g.alchemy.com/v2/{apiKey}

Returns the author address of a given block.

Reference: https://www.alchemy.com/docs/chains/polygon-pos/polygon-po-s-api-endpoints/bor-get-author

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Block number or tag | string or enum | Yes | The block number or special tags like 'latest', 'earliest', or 'pending', encoded in hexadecimal format. |

## Result

**Author address** (string): The address of the author of the specified block.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "bor_getAuthor",
  "params": [
    "latest"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": "0xabc1234567890abcdef1234567890abcdef1234",
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://polygon-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "bor_getAuthor",
  "params": [
    "string"
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'bor_getAuthor', params: ['string']})
};

fetch('https://polygon-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://polygon-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "bor_getAuthor",
    "params": ["string"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

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

func main() {

	url := "https://polygon-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"bor_getAuthor\",\n  \"params\": [\n    \"string\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://polygon-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"bor_getAuthor\",\n  \"params\": [\n    \"string\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://polygon-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"bor_getAuthor\",\n  \"params\": [\n    \"string\"\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: bor_getAuthor
description: Returns the author address of a given block.
params:
  - name: Block number or tag
    required: true
    description: The block number or special tags like 'latest', 'earliest', or 'pending', encoded in hexadecimal format.
    schema:
      title: Block number or tag
      oneOf:
        - title: Block number
          type: string
          pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        - title: Block tag
          type: string
          enum:
            - earliest
            - latest
            - pending
          description: |
            - `earliest`: The lowest numbered block the client has available;
            - `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions;
            - `pending`: A sample next block built by the client on top of `latest` and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for `finalized` or `safe` block MUST be responded to with `-39001: Unknown block` error
result:
  name: Author address
  description: The address of the author of the specified block.
  schema:
    title: hex encoded address
    type: string
    pattern: ^0x[0-9a-fA-F]{40}$
examples:
  - name: bor_getAuthor example
    params:
      - name: Block number or tag
        value: latest
    result:
      name: Author address
      value: '0xabc1234567890abcdef1234567890abcdef1234'
```
