# SQLite Database Operations APIs

> Query bot SQLite databases remotely with parameterized queries and schema inspection.

**Category:** REST API Reference  
**URL:** https://docs.botlify.cloud/?page=api-database  
**Platform:** Botlify Cloud (https://botlify.cloud)  

---

## 1. Database Schema & Info (db_info)

      

Action: `db_info`
      Parameters: `bot_id`
      Returns database file size, SQLite version, journal mode (WAL), table names, schemas, and row counts.

      

## 2. Run SQL Query (db_query)

      

Action: `db_query`
      Parameters: `bot_id`, `query` (SQL statement), `params` (optional array of prepared statement values)

      
```php
curl -X POST https://botlify.cloud/user_api.php   -H "X-API-KEY: YOUR_KEY"   -H "Content-Type: application/json"   -d '{
    "action": "db_query",
    "bot_id": 14,
    "query": "SELECT chat_id, username, balance FROM users WHERE balance > ? ORDER BY balance DESC LIMIT 10",
    "params": [5.0]
  }'
```

      

Supports `SELECT`, `INSERT`, `UPDATE`, `DELETE`, and `CREATE TABLE` statements.
