3 Ways to Access Hong Kong Data: SQL, Downloads, and AI Agents

· 4 min read

Renavon datasets can be accessed in three different ways, depending on how you work. You don't need to choose one — all three are included with every subscription. Here's how each one works.

1. SQL queries via DuckDB / MotherDuck

This is the most powerful access method. Every Renavon dataset lives in a MotherDuck database. You connect using DuckDB — the fast, in-process analytical database — and write standard SQL.

Each dataset has its own database following the naming pattern renavon_{dataset_name}. The table lives in the main schema with the same name as the dataset.

-- Connect with your session token
-- (get one from renavon.com/connect)

-- Example: count all race results
SELECT count(*)
FROM renavon_hkjc_race_results.main.hkjc_race_results;

-- Example: recent races at Happy Valley
SELECT race_date, race_number, horse_name, finishing_position, odds
FROM renavon_hkjc_race_results.main.hkjc_race_results
WHERE venue = 'Happy Valley'
  AND race_date >= '2025-01-01'
ORDER BY race_date DESC, race_number, finishing_position
LIMIT 20;

Python

import duckdb

# Connect with your token
conn = duckdb.connect("md:?motherduck_token=YOUR_TOKEN")

# Query into a pandas DataFrame
df = conn.sql("""
    SELECT race_date, horse_name, odds, finishing_position
    FROM renavon_hkjc_race_results.main.hkjc_race_results
    WHERE race_date >= '2025-01-01'
      AND is_winner = true
    ORDER BY race_date DESC
""").fetchdf()

print(df.head(10))

SQL clients (DBeaver, DataGrip)

Any client that supports DuckDB works:

  1. Install the DuckDB driver for your client
  2. Create a new DuckDB connection
  3. Set the database path to your connection string from renavon.com/connect
  4. Browse schemas and tables in the explorer

2. Download CSV or Excel

If you don't want to write SQL, you can download data directly from any dataset page on renavon.com.

Each dataset page has a Download section where you can:

  • Download the full dataset as CSV or Excel
  • Download a filtered subset by applying filters first
  • Download sample data (first 100 rows) without a subscription

This is useful for one-off analysis in Excel, Google Sheets, or any spreadsheet tool. The files are generated on demand and reflect the latest data.

For larger datasets (millions of rows), the SQL method is faster because you can filter server-side before downloading. But for datasets under a few hundred thousand rows, the direct download works well.

3. AI agents (Claude, Cursor, ChatGPT)

This is the newest access method. You can connect AI assistants directly to your Renavon data using the Model Context Protocol (MCP).

Claude Desktop / Cursor / VS Code

Install the MotherDuck MCP server and add it to your config:

# Install
uvx mcp-server-motherduck

Add this to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "renavon": {
      "command": "uvx",
      "args": ["mcp-server-motherduck"],
      "env": {
        "motherduck_token": "YOUR_TOKEN_FROM_RENAVON"
      }
    }
  }
}

Once connected, you can ask your AI assistant questions in plain English:

  • "Show me the top 10 jockeys by win rate this season"
  • "Find all companies registered in Hong Kong in the last 30 days"
  • "Chart the odds movement for the favourite in the most recent race"

The AI writes the SQL, runs it against your data, and presents the results.

Autonomous agents (Manus, Devin, ChatGPT)

Autonomous AI agents like Manus can work with your Renavon data too. Give the agent your API key and database names, describe what you want in plain language, and it handles the rest: authenticating, connecting, writing SQL, and returning results.

This works with any agent that can execute Python and install packages.

Which method should I use?

I want to... Use
Run complex queries and joins SQL (DuckDB)
Explore data interactively SQL (DuckDB) or AI agent
Download data for Excel/Sheets CSV/Excel download
Build a dashboard or report SQL (DuckDB) with Python
Ask questions in plain English AI agent (MCP)
Automate data extraction SQL (DuckDB) with Python

All three methods access the same underlying data, updated at the same frequency. Pick whichever fits your workflow — or use all three for different tasks.

Get started at renavon.com/connect.

Get data insights in your inbox

New datasets, analysis, and Hong Kong market updates. No spam.

Explore our Hong Kong datasets

Racing, corporate, and financial datasets — query via SQL, download CSV/Excel, or use the API.

Browse Datasets
← Back to blog