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

# Data API

> Use Soria data from applications, notebooks, and automated workflows.

# Data API

The Data API base URL is:

```text theme={null}
https://api.soriaanalytics.com/v1
```

Authenticate with a Soria API key as a bearer token. Treat the key like a password: never share it, commit it, or expose it in browser code.

```bash theme={null}
curl "https://api.soriaanalytics.com/v1/catalog" \
  --header "Authorization: Bearer $SORIA_API_KEY"
```

## Endpoints

| Method | Path                                  | Purpose                                                          |
| ------ | ------------------------------------- | ---------------------------------------------------------------- |
| `GET`  | `/`                                   | Returns links to current API resources.                          |
| `GET`  | `/catalog`                            | Searches or lists datasets available to the account.             |
| `GET`  | `/catalog/{dataset}`                  | Returns schema, grain, methodology, cadence, and source lineage. |
| `GET`  | `/catalog/{dataset}/metadata`         | Returns compact dataset metadata.                                |
| `POST` | `/datasets/{dataset}/query`           | Selects, filters, sorts, and paginates rows.                     |
| `GET`  | `/datasets/{dataset}/stats`           | Counts rows and optionally profiles one column.                  |
| `GET`  | `/datasets/{dataset}/files`           | Lists source files contributing to a dataset.                    |
| `GET`  | `/datasets/{dataset}/files/{file_id}` | Returns a temporary original-file download URL.                  |
| `POST` | `/datasets/{dataset}/exports`         | Queues a CSV or Parquet export.                                  |
| `GET`  | `/exports/{export_id}`                | Returns export status.                                           |
| `GET`  | `/exports/{export_id}/download`       | Redirects to a temporary export URL.                             |
| `POST` | `/search/documents`                   | Searches public source documents.                                |

## API reference

Browse the [endpoint reference](/api-reference/index) for parameters, schemas, responses, and request examples. The [OpenAPI schema (JSON)](https://api.soriaanalytics.com/v1/openapi.json) is also available directly.

## Query a dataset

Use a dataset and columns returned by the catalog:

```bash theme={null}
curl --request POST \
  "https://api.soriaanalytics.com/v1/datasets/<dataset>/query" \
  --header "Authorization: Bearer $SORIA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "columns": ["<column_1>", "<column_2>"],
    "filters": [
      {"column": "<column_1>", "operator": "eq", "value": "<value>"}
    ],
    "order_by": [{"column": "<column_2>", "direction": "desc"}],
    "limit": 100,
    "offset": 0
  }'
```

For source files, see [Download a source file](/guides/source-files).
