---
id: "P:cAlgo.API.OptimizationProcess.JsonReport"
kind: "property"
type: "T:cAlgo.API.OptimizationProcess"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationProcess/JsonReport/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# OptimizationProcess.JsonReport

Member of [OptimizationProcess](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationProcess/index.md).

## JsonReport

Gets the optimization result as JSON (the `.optres` content): configuration plus every pass with its statistics. Returns null if the optimization is not finished or an error occurred. The format matches the desktop optimization "Save results", so the JSON can be opened or imported by the desktop optimization UI.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
string JsonReport {get;}
```

Python:

```python
optimizationProcess.JsonReport: str
```

### Returns

`string` — 

Available since cAlgo.API 5.9.

### Examples

C#:

```csharp
Optimization.Completed += args =>
{
    var report = args.Process.JsonReport;
    if (report != null)
        LocalStorage.SetString("OptimizationResult", report);
};
```

Python:

```python
def on_start(self):
    api.Optimization.Completed += self.on_optimization_completed

def on_optimization_completed(self, args):
    report = args.Process.JsonReport
    if report is not None:
        api.LocalStorage.SetString("OptimizationResult", report)
```

