> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.athenaintel.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.athenaintel.com/_mcp/server.

# Read rows from database table

GET https://api.athenaintel.com/api/v0/databases/{asset_id}/data/{table_name}

Query rows from a table in the database. Supports filtering, ordering, and pagination using PostgREST-style query parameters.

**Filter Syntax:**
- `?column=eq.value` - Equal
- `?column=neq.value` - Not equal
- `?column=gt.value` - Greater than
- `?column=gte.value` - Greater than or equal
- `?column=lt.value` - Less than
- `?column=lte.value` - Less than or equal
- `?column=like.*pattern*` - LIKE (case-sensitive)
- `?column=ilike.*pattern*` - ILIKE (case-insensitive)
- `?column=in.(a,b,c)` - IN list
- `?column=is.null` - IS NULL

Reference: https://docs.athenaintel.com/api-reference/databases/select

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `asset_id` (string, required)
- `table_name` (string, required)

### Query parameters

- `select` (string, optional, nullable) — Columns to return (comma-separated, e.g., 'id,name,email')
- `order` (string, optional, nullable) — Order by clause (e.g., 'created_at.desc', 'name.asc')
- `limit` (integer, optional, default: 100) — Maximum number of rows to return
- `offset` (integer, optional, default: 0) — Number of rows to skip

## Response

### 200

Successful Response

- `data` (list of map from string to any, required) — Array of row objects

## Errors

### 400 Bad Request Error

Invalid request (not a database asset)

- `any`

### 403 Forbidden Error

Access denied to database

- `any`

### 404 Not Found Error

Database asset not found

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 501 Not Implemented Error

Provider not supported

- `any`

### 503 Service Unavailable Error

Database unavailable: starting or suspended, saturated (new statements are refused while running ones finish), or its control plane busy or not answering. `Retry-After` says when to retry; a refused statement did not run.

- `any`

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "data": [
    {
      "email": "alice@example.com",
      "id": 1,
      "name": "Alice"
    },
    {
      "email": "bob@example.com",
      "id": 2,
      "name": "Bob"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.athenaintel.com/api/v0/databases/asset_id/data/table_name"

headers = {"X-API-KEY": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.athenaintel.com/api/v0/databases/asset_id/data/table_name';
const options = {method: 'GET', headers: {'X-API-KEY': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.athenaintel.com/api/v0/databases/asset_id/data/table_name"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-KEY", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/databases/asset_id/data/table_name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.athenaintel.com/api/v0/databases/asset_id/data/table_name")
  .header("X-API-KEY", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.athenaintel.com/api/v0/databases/asset_id/data/table_name', [
  'headers' => [
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/databases/asset_id/data/table_name");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/databases/asset_id/data/table_name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```