OpuAs read-only API
Customer API quick reference
Use this page to inspect the current demo API surface. The API is read-only, mixes public and protected routes, has no SLA, and does not promise article coverage for every match.
Current boundary
- Match and event data come from the local football SQLite service.
- Article coverage is best-effort and depends on the current article-link snapshot.
- Many matches will return
article_count: 0. That is normal in the current demo. - The data console endpoints expose project SQLite data assets from the repository database directory and the article database. They do not accept arbitrary SQL or SQLite internal tables.
/api/articles/{article_id}returns metadata, summary, and a short preview only. It does not expose full third-party article text.
Core endpoints
| Endpoint | Purpose | Key fields |
|---|---|---|
| GET /api/health | Service and database health check. | db_exists, required_tables, available_match_count |
| GET /api/data-capabilities | What the current demo can serve. | modules, table_row_counts, notes |
| POST /api/predict | Dixon-Coles style Poisson scoreline and W-D-L prediction trained from football_master.db.matches. Requires dashboard session or API key. |
expected_goals, probabilities, most_likely_score, score_probabilities[] |
| GET /api/matches | Match list for dashboard or selector views. | match_id, status, teams, probabilities |
| GET /api/matches/{match_id} | Single match overview with feed availability. | feed_status, availability, clock |
| GET /api/matches/{match_id}/articles | Linked article list for one match. | article_count, articles[], article_source |
| GET /api/tables | Project data asset inventory for the internal console. | asset_id, database, table, row_count, recent_update |
| GET /api/tables/{table_name} | Schema, primary-key metadata, index metadata, and row count for one allowed table. | columns[], indexes[], row_count |
| GET /api/tables/{table_name}/rows?limit=&offset= | Read-only paginated sample rows. Default limit is 50 and maximum limit is 200. | limit, offset, returned_count, rows[] |
| GET /api/articles?limit=&offset=&source=&ingest_status=&translation_status=&match_id= | Article collection list with optional operational filters. | article_count, filters, articles[] |
| GET /api/articles/{article_id} | Single article metadata and safe preview. | article, match, clean_text_preview_en, summary_zh |
Data console field guide
| Endpoint | Boundary |
|---|---|
/api/tables | Includes repository databases under database/*.db plus the article source database when present. |
/api/tables/{table_name} | Use asset_id such as live_predictions.live_matches when names collide. SQLite internal tables and unknown names return errors. |
/api/tables/{table_name}/rows | Returns paginated JSON rows only. It performs no write, export, or SQL passthrough operation. |
/api/articles | Lists metadata, summaries, safe previews, and match-link metadata. It does not expose full article text. |
Article field guide
| Field | Meaning |
|---|---|
article_id | Stable internal ID generated from source metadata. |
title | Original article title. |
summary_zh | Short Chinese summary for demo use. |
clean_text_available | Whether the source DB holds cleaned English text. |
clean_text_preview_en | Short preview only, not the full source text. |
content_hash | Deduplication and cache key support. |
link | Current match/team/competition linkage snapshot. |
article_source | Article DB path and availability state. |
Example: Poisson prediction
POST /api/predict
Authorization: Bearer opuas-test-key-2026
Content-Type: application/json
{
"home_team_id": "3kq9cckrnlogidldtdie2fkbl",
"away_team_id": "agh9ifb2mw3ivjusgedj7c3fe"
}
{
"expected_goals": {
"home": 1.7532,
"away": 1.7757
},
"probabilities": {
"home_win": 0.384516,
"draw": 0.221776,
"away_win": 0.393708
},
"most_likely_score": {
"score": "1-1",
"probability": 0.091334
}
}
Example: match articles
GET /api/matches/1053ngfunkdt7v41cane05fkk/articles
{
"match": {
"match_id": "1053ngfunkdt7v41cane05fkk",
"phase": "Pre-match"
},
"article_count": 0,
"articles": [],
"article_source": {
"db_exists": true
},
"note": "Article coverage depends on current article-link matching and many matches legitimately have zero linked articles."
}
Example: article detail
GET /api/articles/art_a2b6130f4ff1f212
{
"article": {
"article_id": "art_a2b6130f4ff1f212",
"title": "England vs Uruguay Prediction: Can Tuchel Keep Perfect World Cup Preparation Going?",
"summary_zh": "文章整理世界杯相关预测内容,概括 模型给出的主要概率倾向和背景数据。",
"clean_text_available": true,
"clean_text_preview_en": "We look ahead to Friday's international friendly at Wembley Stadium...",
"content_hash": "0d3fd36542005b3f0fd9cdd29ac15eb09b8cbe911d3bbba876cc25cfe2e5a4dc",
"link": {
"link_type": "unlinked",
"competition": "World Cup"
}
},
"match": null
}
Testing with curl
curl http://127.0.0.1:8790/api/health
curl http://127.0.0.1:8790/api/data-capabilities
curl http://127.0.0.1:8790/api/matches
curl http://127.0.0.1:8790/api/matches/1053ngfunkdt7v41cane05fkk
curl http://127.0.0.1:8790/api/matches/1053ngfunkdt7v41cane05fkk/articles
curl http://127.0.0.1:8790/api/tables
curl http://127.0.0.1:8790/api/tables/live_predictions.live_matches
curl "http://127.0.0.1:8790/api/tables/live_predictions.live_matches/rows?limit=5"
curl "http://127.0.0.1:8790/api/articles?limit=5"
curl http://127.0.0.1:8790/api/articles/art_a2b6130f4ff1f212
curl -X POST http://127.0.0.1:8790/api/predict \
-H "Authorization: Bearer opuas-test-key-2026" \
-H "Content-Type: application/json" \
-d "{\"home_team_id\":\"3kq9cckrnlogidldtdie2fkbl\",\"away_team_id\":\"agh9ifb2mw3ivjusgedj7c3fe\"}"