# optimism_syncStatus

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

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

Get the synchronization status.

Reference: https://www.alchemy.com/docs/chains/world-chain/world-chain-api-endpoints/optimism-sync-status

## Result

**Sync status** (object): The synchronization status information

## Code Examples

### cURL

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

### JavaScript

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

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

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

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

### C#

```csharp
using RestSharp;


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

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

```


## OpenRPC Method Specification

```yaml
name: optimism_syncStatus
description: Get the synchronization status.
x-compute-units: 10
params: []
result:
  name: Sync status
  description: The synchronization status information
  schema:
    type: object
    properties:
      current_l1:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the current L1 synchronization status
          number:
            type: string
            description: The block number of the current L1 synchronization status
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the current L1 synchronization status
      current_l1_finalized:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the finalized state of the current L1
          number:
            type: string
            description: The block number of the finalized state of the current L1
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the finalized state of the current L1
      head_l1:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the head L1
          number:
            type: string
            description: The block number of the head L1
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the head L1
      safe_l1:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the safe L1
          number:
            type: string
            description: The block number of the safe L1
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the safe L1
      finalized_l1:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the finalized L1
          number:
            type: string
            description: The block number of the finalized L1
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the finalized L1
      unsafe_l2:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the unsafe L2
          number:
            type: string
            description: The block number of the unsafe L2
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the unsafe L2
          l1origin:
            type: object
            properties:
              hash:
                type: string
                description: The hash of the L1 origin block
              number:
                type: string
                description: The block number of the L1 origin
              sequenceNumber:
                type: string
                description: The sequence number of the unsafe L2
      safe_l2:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the safe L2
          number:
            type: string
            description: The block number of the safe L2
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the safe L2
          l1origin:
            type: object
            properties:
              hash:
                type: string
                description: The hash of the L1 origin block
              number:
                type: string
                description: The block number of the L1 origin
              sequenceNumber:
                type: string
                description: The sequence number of the safe L2
      finalized_l2:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the finalized L2
          number:
            type: string
            description: The block number of the finalized L2
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the finalized L2
          l1origin:
            type: object
            properties:
              hash:
                type: string
                description: The hash of the L1 origin block
              number:
                type: string
                description: The block number of the L1 origin
              sequenceNumber:
                type: string
                description: The sequence number of the finalized L2
      pending_safe_l2:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the pending safe L2
          number:
            type: string
            description: The block number of the pending safe L2
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the pending safe L2
          l1origin:
            type: object
            properties:
              hash:
                type: string
                description: The hash of the L1 origin block
              number:
                type: string
                description: The block number of the L1 origin
              sequenceNumber:
                type: string
                description: The sequence number of the pending safe L2
      queued_unsafe_l2:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the queued unsafe L2
          number:
            type: string
            description: The block number of the queued unsafe L2
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the queued unsafe L2
          l1origin:
            type: object
            properties:
              hash:
                type: string
                description: The hash of the L1 origin block
              number:
                type: string
                description: The block number of the L1 origin
              sequenceNumber:
                type: string
                description: The sequence number of the queued unsafe L2
      engine_sync_target:
        type: object
        properties:
          hash:
            type: string
            description: The hash of the synchronization target for the engine
          number:
            type: string
            description: The block number of the synchronization target for the engine
          parentHash:
            type: string
            description: The hash of the parent block
          timestamp:
            type: string
            description: The timestamp of the synchronization target for the engine
          sequenceNumber:
            type: string
            description: The sequence number of the synchronization target for the engine
```
