<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.0.0",
    "iPadOS: 13.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.15.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MetricKit",
  "identifier" : "/documentation/MetricKit/MXMetricPayload/jsonRepresentation()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MetricKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MXMetricPayload(im)JSONRepresentation"
  },
  "title" : "jsonRepresentation()"
}
-->

# jsonRepresentation()

Returns the contents of the payload in JSON format.

```
func jsonRepresentation() -> Data
```

## Return Value

A <doc://com.apple.documentation/documentation/Foundation/Data> (Swift) or <doc://com.apple.documentation/documentation/Foundation/NSData> (Objective-C) object containing the JSON representation of the metrics in the payload.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)