API Documentation

Welcome to the API documentation. Below is a list of all available endpoints. Click on an endpoint for detailed information.

Basic Endpoints

GET /tables

Returns a JSON object containing the names of all tables in the database.

Example:

GET /tables

GET /columns/<table_name>

Returns metadata for each column in a table, including type, nullability, and default values.

Parameters:

table_name: Name of the table (required)

Example:

GET /columns/cameras

GET /stats/<table_name>

Returns statistics for a specific table, such as row count, data size, index size, and min/max values for numeric and datetime columns.

Example:

GET /stats/cameras

GET /db

Returns aggregated statistics for the entire database, including total tables, row count, data size, and index size.

Example:

GET /db

GET /schema

Returns a JSON object containing the structure of all tables in the database.

Example:

GET /schema

GET /table/<table_name>

Allows dynamic querying of any table with optional filters, sorting, and pagination.

Query Parameters:

columns: Comma-separated list of columns to retrieve (optional, default: '*')
where: SQL WHERE clause condition (optional)
order_by: Column name to order by (optional)
odir: Sorting order, ASC or DESC (optional, default: 'DESC')
page: Page number for pagination (optional, default: 1)
limit: Number of rows per page (optional, default: 100)
        

Example:

GET /table/cameras?columns=id,camera_name&where=season_id=2&order_by=camera_name&odir=ASC&page=1&limit=5

GET /videos/file-stats

Returns per-camera video counts, total sizes, and size-per-file details.

Query Parameters:

Dynamic filtering is supported:
Example: GET /videos/file-stats?channel_id=2&camera_name=Main%20Entrance
        

Example:

GET /videos/file-stats