# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autogon.ai/other-apis/dataset/visualize-dataset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
