# starknet_syncing

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

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

Returns an object about the sync status, or false if the node is not syncing

Reference: https://www.alchemy.com/docs/chains/starknet/starknet-api-endpoints/starknet-syncing

## Result

**syncing** (boolean or object): The status of the node, if it is currently synchronizing state. FALSE otherwise 

## Code Examples

### cURL

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

### JavaScript

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

fetch('https://starknet-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://starknet-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "starknet_syncing"
}
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://starknet-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"starknet_syncing\"\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://starknet-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"starknet_syncing\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://starknet-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\": \"starknet_syncing\"\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: starknet_syncing
description: Returns an object about the sync status, or false if the node is not syncing
params: []
result:
  name: syncing
  summary: |
    The state of the synchronization, or false if the node is not synchronizing
  description: |
    The status of the node, if it is currently synchronizing state. FALSE otherwise
  schema:
    title: SyncingStatus
    oneOf:
      - type: boolean
        title: 'False'
        description: Only legal value is FALSE here
      - title: Sync status
        type: object
        description: An object describing the node synchronization status
        required:
          - starting_block_hash
          - starting_block_num
          - current_block_hash
          - current_block_num
          - highest_block_hash
          - highest_block_num
        properties:
          starting_block_hash:
            title: Starting block hash
            description: The hash of the block from which the sync started
            type: string
            pattern: ^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$
          starting_block_num:
            title: Starting block number
            description: The number (height) of the block from which the sync started
            type: integer
            minimum: 0
          current_block_hash:
            title: Current block hash
            description: The hash of the current block being synchronized
            type: string
            pattern: ^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$
          current_block_num:
            title: Current block number
            description: The number (height) of the current block being synchronized
            type: integer
            minimum: 0
          highest_block_hash:
            title: Highest block hash
            description: The hash of the estimated highest block to be synchronized
            type: string
            pattern: ^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$
          highest_block_num:
            title: Highest block number
            description: The number (height) of the estimated highest block to be synchronized
            type: integer
            minimum: 0
```
