# Get Policy Stats

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

GET https://manage.g.alchemy.com/api/gasManager/policy/{id}/stats/details

Returns stats about a policy specified by ID.

<Note title="Header Access Token">
  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. 
</Note>


Reference: https://www.alchemy.com/docs/wallets/api-reference/gas-manager-admin-api/admin-api-endpoints/get-policy-stats

## Headers

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Authorization | string | Yes | Bearer authentication token |

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| id | string | Yes | ID of the policy to be fetched |

## Code Examples

### cURL

```bash
curl --request GET \
  --url https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5/stats/details \
  --header 'Authorization: Bearer <token>'
```

### JavaScript

```javascript
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5/stats/details', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5/stats/details"

headers = {"Authorization": "Bearer <token>"}

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

print(response.text)
```

### Go

```go
package main

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

func main() {

	url := "https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5/stats/details"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.get("https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5/stats/details")
  .header("Authorization", "Bearer <token>")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://manage.g.alchemy.com/api/gasManager/policy/a844e221-3c13-40c6-95db-d2db390e14b5/stats/details");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);

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

```


## Operation Specification

```yaml
path: /api/gasManager/policy/{id}/stats/details
method: GET
operation:
  summary: Get Policy Stats
  description: |
    Returns stats about a policy specified by ID.

    <Note title="Header Access Token">
      To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. 
    </Note>
  operationId: get-policy-stats
  security:
    - BearerAuth: []
  parameters:
    - name: id
      description: ID of the policy to be fetched
      in: path
      required: true
      schema:
        type: string
        default: a844e221-3c13-40c6-95db-d2db390e14b5
  responses:
    '200':
      description: Policy stats fetched successfully
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                properties:
                  policyStats:
                    type: object
                    properties:
                      signaturesMined:
                        type: integer
                        default: 0
                      signaturesExpired:
                        type: integer
                        default: 0
                      signaturesPending:
                        type: integer
                        default: 0
                      usdPending:
                        type: string
                        default: '0.0'
                      usdMined:
                        type: string
                        default: '0.0'
                  policyNetworkStats:
                    type: array
                    items:
                      type: object
                      properties:
                        network:
                          type: string
                          default: MATIC_MAINNET
                        signaturesMined:
                          type: integer
                          default: 0
                        signaturesExpired:
                          type: integer
                          default: 0
                        signaturesPending:
                          type: integer
                          default: 0
                        usdPending:
                          type: string
                          default: '0.0'
                        usdMined:
                          type: string
                          default: '0.0'
                        pendingNativeToken:
                          type: number
                          default: 0
                        minedNativeToken:
                          type: number
                          default: 0
                        currency:
                          type: string
                          default: ETH
              error:
                type: object
                properties:
                  msg:
                    type: string
```
