# Visualize Dataset

The Visualize Dataset endpoint allows users to visualize a dataset by providing a URL to the dataset in CSV format. Users can choose to receive the visualization in either JSON format (dataframe representation) or HTML format (plots).

### Pricing Information

* When the response is in HTML format (plots), it costs 2 units.
* When the response is in JSON format, it costs 1 unit.

## Visualize a CSV dataset.

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/engine/visualize/`

#### Headers

| Name                                           | Type   | Description          |
| ---------------------------------------------- | ------ | -------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json     |
| X-AUG-KEY<mark style="color:red;">\*</mark>    | String | Your Autogon API Key |

#### Request Body

| Name                                   | Type   | Description                                                                                                                                                                 |
| -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data<mark style="color:red;">\*</mark> | String | The URL of the dataset to be visualized in CSV format.                                                                                                                      |
| return\_json                           | String | If true, the response will be the dataframe representation of the dataset in JSON format. If false or omitted, the response will be the visualization plots in HTML format. |

{% tabs %}
{% tab title="200: OK return\_json: true" %}

```json
{
    "status": "true",
    "plots": {
        "column1: 0": {
            "0": 1,
            "1": 2,
            "2": 3,
            "3": 4,
            "4": 5,
            "5": 6,
        }
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "status": "false",
    "error": "Error in Visualizing the data"
}
```

{% endtab %}

{% tab title="200: OK return\_json:false" %}

```json
{
    "status": "true",
    "plots": []
}
```

{% endtab %}
{% endtabs %}
