cd .. / projects
<ph-local-data-api/>

PH Local Data API

CONCEPT
Public Data API•2026•API Developer•Personal Project
PH Local Data API primary preview
<about-project/>

A planned public API that turns scattered Philippine local-government datasets into one consistent, queryable endpoint. The core engineering problem is normalization: cleaning and reconciling the source datasets into a hierarchical schema — regions → provinces → cities/municipalities → barangays — served through versioned REST endpoints from a Node.js/Express service, with Redis caching the stable, read-heavy reference data. A Next.js documentation site adds an interactive explorer for testing queries in the browser. Concept phase only; not yet deployed.

<tech-stack/>
<key-features/>
Versioned REST endpoints for Philippine local data
Hierarchical geography: regions → provinces → cities/municipalities → barangays
Filtering and lookup by code, name, or parent region
Redis response caching for read-heavy reference data
Interactive API explorer and documentation site
<technical-decisions/>

Why a normalized geographic schema?

Modeling the Philippine hierarchy as parent-child records with stable codes keeps queries flexible and makes the API straightforward to extend as more datasets are added.

Why Redis caching on top of PostgreSQL?

Reference data such as municipality lists is read far more often than it changes, so caching responses in Redis cuts database load with little added complexity.

<what-i-learned/>
01

Public API design starts with the data model

Cleaning and reconciling inconsistent source datasets into one schema is the hardest and most valuable part of the design work.

02

Even static data needs cache invalidation

A short TTL plus an explicit revalidation endpoint prevents corrected records from lingering stale after the underlying dataset is fixed.