Skip to main content
TLI.

Developers

Build with TLI data

TLI's province scores and indicator-level data are available as a JSON API and an embeddable widget. Free for non-commercial use under CC BY-NC 4.0; commercial use requires a commercial license.

API

Status: in development · target ship Q3 2026

The TLI API serves province-level and indicator-level livability data as JSON. Free tier: 1,000 calls/day per API key. Higher tiers via commercial license.

Planned endpoints

  • GET /api/v1/province/{id} — composite + 7 categories + indicators for one province
  • GET /api/v1/indicator/{id} — distribution across all 77 provinces for one indicator
  • GET /api/v1/composite — all 77 provinces with composite + category scores (compact)

Sample response shape (preview)

{
  "id": "bangkok",
  "name_en": "Bangkok",
  "name_th": "กรุงเทพมหานคร",
  "composite": 64.9,
  "rank": 35,
  "categories": {
    "climate": { "score": 40, "indicator_count": 9, ... },
    "healthcare": { "score": 78, ... },
    ...
  },
  "as_of": "2026-07-25",
  "license": "CC-BY-NC-4.0"
}

Get an API key

API key signup ships when the API does. Until then, register interest at development@thailand-livability-index.com — academic, journalist, civic, and commercial inquiries all welcome (commercial gets routed to licensing).

Embed widget

Status: in development · target ship Q3 2026

Drop a TLI province card on any page. Web Component, Shadow DOM, no React/framework dependency. Free embedding for non-commercial use; white-label for commercial license-holders.

Live preview

These are real <tli-widget> Custom Elements, not mockups — the same code that ships to partner sites. Each loads data from /api/v1/widget-data/<id>.json and re-renders on province change. View source to see the actual embed.

Embed snippet
<script src="https://embed.thailand-livability-index.com/v1/tli.js" defer></script>
<tli-widget province="phuket" size="480" lang="en"></tli-widget>

Three attributes cover the common case: province (slug, required), size (auto · 320 · 480 · 800 · 1024; defaults to auto), lang (en · th; inherits from <html lang>). Brand color, typography, footer attribution, and the methodology link are locked at v1. White-label customization is gated by commercial license.

Bulk data

For research, journalism, and civic use, the full TLI dataset (77 provinces × 30 scored indicators with scoring and provenance) is available as parquet + CSV via an email-gate form.

Form ships pre-MVP. Until then, request access at research@thailand-livability-index.com with: your name, affiliation, intended use, and acknowledgment of CC BY-NC 4.0 attribution.

Status

Last data refresh
Pipeline cadence
Tier A daily (PM2.5, heat, rainfall, conflict, transit) · Tier B monthly (TAT events, MOTS arrivals, hospital data) · Tier C annual (population, GPP, CPI)
API uptime
n/a (API not yet shipped)
Embed widget uptime
n/a (widget not yet shipped)

Changelog

TLI methodology changes are versioned and DOI-stamped. See the full CHANGELOG on GitHub for site changes; the methodology page tracks scoring changes.

API + widget version history will appear here once they ship.

Versioning & deprecation policy

API and widget releases follow semantic versioning. Breaking changes land in a new major version (/api/v2/, /v2/tli.js); the prior major version continues serving for 12 months after the new major reaches GA before deprecation. CORS posture: Access-Control-Allow-Origin: * on all read endpoints.