---
updatedAt: 2025-09-18T22:42:33.000Z
agentTools:
  projectIndex: https://docs.nodereal.io/llms.txt
---

# pm_getPolicySpendData

Get a policy's spending data by  policy UUID.

> 📘 Supported on both Mainnet and Testnet.

Endpoint

* **Mainnet**: `https://open-platform-ap.nodereal.io/{$apikey}/megafuel`
* **Testnet**: `https://open-platform-ap.nodereal.io/{$apikey}/megafuel-testnet`

The \{$apikey} should be created via Nodereal Meganode. Please refer to [Sponsor Guidelines](https://docs.nodereal.io/docs/megafuel-sponsor-guidelines)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "MEGAFUEL API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://open-platform-ap.nodereal.io"
    }
  ],
  "paths": {
    "/{apiKey}/megafuel": {
      "summary": "pm_getPolicySpendData",
      "post": {
        "summary": "pm_getPolicySpendData",
        "description": "Get a policy's spending data by  policy UUID.",
        "tags": [
          "pm_getPolicySpendData"
        ],
        "parameters": [
          {
            "name": "apiKey",
            "in": "path",
            "schema": {
              "type": "string",
              "default": "<your-nodereal-apikey>"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "default": 1
                      },
                      "jsonrpc": {
                        "type": "string",
                        "default": "2.0"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "method": {
                        "type": "string",
                        "default": "pm_getPolicySpendData",
                        "enum": [
                          "pm_getPolicySpendData"
                        ]
                      },
                      "params": {
                        "type": "array",
                        "description": "1. String - policy uuid\n",
                        "minItems": 1,
                        "maxItems": 1,
                        "items": {
                          "type": "string"
                        },
                        "default": [
                          "22a1e2e5-1234-11fd-9223-bc9ee5f5abc0"
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "jsonrpc": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "object",
                          "description": "Record of total spending under a specific policy, detailing accumulated costs and other relevant data.",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "format": "int64",
                              "description": "Unique identifier of the policy spending data record."
                            },
                            "cost": {
                              "type": "string",
                              "description": "Hexadecimal string representing the total cost accumulated under the policy."
                            },
                            "updateAt": {
                              "type": "integer",
                              "format": "int64",
                              "description": "Timestamp indicating the last update to this spending record."
                            },
                            "chainId": {
                              "type": "integer",
                              "description": "Identifier of the blockchain network associated with these spending records."
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "pm-getPolicySpendData"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```