← Back to search

API docs

A free, open read-only HTTP API for Philippine Supreme Court decisions. No API key. No login. No monthly limit. Please cache responses where you can and don't hammer the endpoints — this runs on free-tier infrastructure and is funded out of pocket.

Base URL

https://<your-deploy-host>/api/v1

Rate limits

License

Endpoints

GET/api/v1/stats

Example

/api/v1/stats

Returns

Corpus size, source breakdown, coverage date range, citation graph stats, license.

GET/api/v1/search
ParamTypeDescription
qstring (required)Natural language query or exact terms
limitint (default 10, max 50)Results to return
yearintFilter by promulgation year
topicstringFilter by topic category
divisionstringEn Banc | First Division | Second Division | Third Division
ponentestringJustice surname

Example

/api/v1/search?q=warrantless+search&limit=5

Returns

{ q, year, topic, division, ponente, count, results: Case[] } where each Case includes id, title, gr_number, date, summary, doctrine, source_url, topics, division, ponente, authority_score, similarity.

POST/api/v1/search

Example

curl -X POST -H "content-type: application/json" -d '{"q":"plunder"}' https://YOUR-HOST/api/v1/search

Returns

Same shape as GET. Use POST if your query has awkward URL characters.

GET/api/v1/cases/:id

Example

/api/v1/cases/3

Returns

{ case: { id, title, gr_number, date, summary, doctrine, source_url, division, ponente, topics, disposition, dispositive, statutes, vote, separate_count, authority_score } }

GET/api/v1/cases/:id/citations

Example

/api/v1/cases/3/citations

Returns

{ cites: [{ label, target_gr, target }], cited_by: Case[] } — forward and reverse edges in the citation graph.

GET/api/v1/cases/:id/related

Example

/api/v1/cases/3/related

Returns

{ results: Case[] } — top 5 semantically similar cases via embedding cosine distance.

GET/api/v1/top-cases
ParamTypeDescription
limitint (default 50, max 200)Results to return
yearintFilter by year
topicstringFilter by topic category

Example

/api/v1/top-cases?topic=Constitutional+Law&limit=20

Returns

{ count, year, topic, results: Case[] } sorted by authority_score descending.

GET/api/v1/years

Example

/api/v1/years

Returns

{ years: int[] } — all years present in the corpus, newest first.

GET/api/v1/topics

Example

/api/v1/topics

Returns

{ topics: { name, count }[] } — topic taxonomy with case counts.

GET/api/v1/meta

Example

/api/v1/meta

Returns

{ divisions: { name, count }[], ponentes: { name, count }[] } — divisions by count, ponentes alphabetical.