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

# Introduction

> Query your data using SQL through our Data API.

<Info>The Data API is available on all **paid plans**.</Info>

## Overview

The Data API provides a simplified way to query your data using SQL. Simply submit your query and download the results.

## Output Formats

Data API supports two output formats:

### Parquet Mode

Parquet is a columnar storage format that offers better compression and performance for analytical queries. This is the recommended format for most use cases.

**Advantages:**

* Better compression and smaller file sizes
* Faster query performance
* Preserves data types and schema information
* Ideal for large datasets

**Considerations:**

* May have limitations with certain data types (see [Known Limitations](./known-limitations))

### CSV Mode

CSV (Comma-Separated Values) is a simple text format that's widely supported by most tools and applications.

**Advantages:**

* Universal compatibility
* Easy to read and inspect
* Simple to import into spreadsheet applications

**Considerations:**

* Larger file sizes compared to Parquet
* No schema information preserved
* All values are represented as strings

## How It Works

<Steps>
  <Step title="Create an API Key">
    Go to your Workspace settings and [create an API Key](https://app.nekt.ai/settings/api-keys), it will be necessary to use all Data API endpoints.
  </Step>

  <Step title="Create your query">
    Nekt Data API is powered by **AWS Athena** (for AWS organizations) or **GCP BigQuery** (for GCP organizations), using standard SQL syntax.

    The most common use case is to query the data of a specific table:

    ```sql query.sql theme={null}
    SELECT
        *
    FROM
        "nekt_raw"."table_name"
    LIMIT
        200
    ```

    You can also specify the output format (parquet or csv) in your request. If not specified, parquet is used by default.

    <Note>Use SQL filters, joins, where clauses and many more SQL statements to refine your query.</Note>
  </Step>

  <Step title="Download the results">
    After submitting your query, the API will automatically process it and provide you with a download link to get the results in your chosen format.
    <Warning>The download link is only valid for 1 hour.</Warning>
  </Step>
</Steps>

## Pseudo code implementation

```mermaid theme={null}
flowchart TD
    A[Start: SQL Query Execution] --> B[Create an API Key]
    B --> C[Submit query with SQL statement and format]
    C --> D[API processes query automatically]
    D --> E[Receive download link for results]
    E --> F[Download results file - Parquet or CSV]
    F --> G[End: SQL Query Execution]
```

## Next Steps

* Review the [Known Limitations](./known-limitations) for your cloud provider and output format
* Check the [SQL Query endpoint documentation](./sql-query) for detailed API reference
