> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Simulation Result

> Get stored results for a simulation.

Handles multiple data formats:
1. Parquet files in storage (newest format) - loaded from storage
2. JSONB in simulation_data table (legacy) - migrated to parquet

Parameters
----------
simulation_id : str
    ID of the simulation
user_org_client : tuple[str, str | None, AsyncClient]
    Current user_id, organization_id, and Supabase client
simulation_repository : SimulationRepository
    Repository for simulations table
simulation_data_repository : SimulationDataRepository
    Repository for simulation_data table (legacy)
target_rows : int | None
    If set, downsample time series to at most this many rows.
x_min : float | None
    Minimum Time [s] value to filter (for zoom).
x_max : float | None
    Maximum Time [s] value to filter (for zoom).

Returns
-------
dict
    Dictionary with time_series, steps, and metrics

Raises
------
HTTPException
    404 if no results found, 400 for other errors



## OpenAPI

````yaml https://api.ionworks.com/openapi.json get /simulations/{simulation_id}/result
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /simulations/{simulation_id}/result:
    get:
      tags:
        - Simulations
      summary: Get Simulation Result
      description: |-
        Get stored results for a simulation.

        Handles multiple data formats:
        1. Parquet files in storage (newest format) - loaded from storage
        2. JSONB in simulation_data table (legacy) - migrated to parquet

        Parameters
        ----------
        simulation_id : str
            ID of the simulation
        user_org_client : tuple[str, str | None, AsyncClient]
            Current user_id, organization_id, and Supabase client
        simulation_repository : SimulationRepository
            Repository for simulations table
        simulation_data_repository : SimulationDataRepository
            Repository for simulation_data table (legacy)
        target_rows : int | None
            If set, downsample time series to at most this many rows.
        x_min : float | None
            Minimum Time [s] value to filter (for zoom).
        x_max : float | None
            Maximum Time [s] value to filter (for zoom).

        Returns
        -------
        dict
            Dictionary with time_series, steps, and metrics

        Raises
        ------
        HTTPException
            404 if no results found, 400 for other errors
      operationId: get_simulation_result_simulations__simulation_id__result_get
      parameters:
        - name: simulation_id
          in: path
          required: true
          schema:
            type: string
            title: Simulation Id
        - name: target_rows
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Target Rows
        - name: x_min
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            title: X Min
        - name: x_max
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            title: X Max
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````