# URL Parameters

```
https://api.csvgetter.com/abc123?param1=value1&param2=value2
```

***

### Quick Reference

| Parameter               | Values                                    | Description                                     |
| ----------------------- | ----------------------------------------- | ----------------------------------------------- |
| `type`                  | `json_records`, `xml`, `html_table`, etc. | Override output format                          |
| `sql`                   | SQL query string                          | Filter and transform data with SQL              |
| `nest_json`             | Key name string                           | Wrap JSON output in a named key                 |
| `filename_timestamp`    | `true`, `end`, `start`                    | Add timestamp to download filename              |
| `extract_json_property` | Property name string                      | Extract a specific property from linked records |
| `all_fields`            | `true`                                    | Include all fields from the source              |
| `show_wait_page`        | `true`                                    | Show a loading page before delivering data      |
| `save_to_gdrive`        | `true`                                    | Save export to Google Drive                     |
| `save_to_gsheets`       | `true`                                    | Save export to Google Sheets                    |

***

### Detailed Reference

#### `type`

Override the output format for this request.

**Values:** `json_records`, `json_split`, `json_index`, `json_columns`, `json_values`, `json_table`, `xml`, `html_table`, `dynamic_table`, `excel_web_query`

**Example:**

```
?type=json_records
```

Returns your data as a JSON array of objects instead of CSV.

```
?type=xml
```

Returns your data as an XML document.

See The Type Parameter for sample output for every format.

***

#### `sql`

Run a SQL query against your data to filter, sort, aggregate, or transform it.

**Value:** A SQL `SELECT` statement. The table name is always `csvgetter`.

**Example — filter rows:**

```
?sql=SELECT * FROM csvgetter WHERE status = 'Active'
```

**Example — select specific columns and sort:**

```
?sql=SELECT name, email FROM csvgetter ORDER BY name ASC
```

**Example — aggregate:**

```
?sql=SELECT department, COUNT(*) as count FROM csvgetter GROUP BY department
```

**Example — limit results:**

```
?sql=SELECT * FROM csvgetter LIMIT 10
```

Remember to URL-encode the query if building URLs manually. Spaces become `%20`, `=` becomes `%3D`, etc.

See The SQL Parameter for 19+ examples.

***

#### `nest_json`

Wrap JSON output in a top-level key. Only applies when the output is a JSON format.

**Value:** The key name to wrap the data in.

**Example:**

```
?type=json_records&nest_json=items
```

**Without `nest_json`:**

```json
[{"name": "Alice"}, {"name": "Bob"}]
```

**With `nest_json=items`:**

```json
{"items": [{"name": "Alice"}, {"name": "Bob"}]}
```

Useful when your consuming application expects data nested under a specific key.

***

#### `filename_timestamp`

Add a UTC timestamp to the downloaded filename.

**Values:**

* `true` or `end` — Append timestamp to the end: `My_Export_2025-03-15T143022.csv`
* `start` — Prepend timestamp to the beginning: `2025-03-15T143022_My_Export.csv`

**Example:**

```
?filename_timestamp=true
```

The timestamp format is `YYYY-MM-DDTHHMMSS` in UTC.

***

#### `extract_json_property`

When your Airtable data contains linked records (which come as JSON arrays), extract a specific property from each linked record.

**Value:** The property name to extract.

**Example:**

```
?extract_json_property=name
```

Without this parameter, a linked record field might show:

```
[{"id": "rec123", "name": "Alice"}, {"id": "rec456", "name": "Bob"}]
```

With `?extract_json_property=name`, it becomes:

```
Alice, Bob
```

***

#### `all_fields`

Include all fields from the source table, overriding the field selection you configured in the endpoint.

**Value:** `true`

**Example:**

```
?all_fields=true
```

> **Note:** This parameter must be enabled for your endpoint. It requires a custom parameter configuration. Contact support or check your endpoint settings if you receive a 400 error.

***

#### `show_wait_page`

Display a loading page in the browser while the data is being fetched, then redirect to the data.

**Value:** `true`

**Example:**

```
?show_wait_page=true
```

This is useful for large datasets where the export takes several seconds. Instead of the browser appearing to hang, users see a "Please wait" page.

***

#### `save_to_gdrive`

Save the export output as a file to your connected Google Drive.

**Value:** `true`

**Example:**

```
?save_to_gdrive=true
```

Requires a connected Google account. The file is saved to your Google Drive root folder.

Combine with `filename_timestamp` to avoid overwriting previous exports:

```
?save_to_gdrive=true&filename_timestamp=true
```

***

#### `save_to_gsheets`

Save the export output directly to a Google Sheets spreadsheet.

**Value:** `true`

**Example:**

```
?save_to_gsheets=true&spreadsheet=SPREADSHEET_ID&sheet=SHEET_NAME
```

Requires a connected Google account and the spreadsheet/sheet parameters.

***

### Combining Parameters

All parameters can be combined freely:

```
?type=json_records&sql=SELECT name, email FROM csvgetter WHERE status='Active'&nest_json=data
```
