Malaysian Law Data — AGC Laws of Malaysia
Pricing
from $2.50 / 1,000 legislation records
Malaysian Law Data — AGC Laws of Malaysia
Malaysian federal legislation from the official AGC portal (lom.agc.gov.my): 19,600+ Principal, Amendment, Constitution and subsidiary legislation records with EN/BM titles, dates, status and official PDF links. Pay-per-event, no proxies, no browser.
Pricing
from $2.50 / 1,000 legislation records
Rating
0.0
(0)
Developer
dedy iskandar
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
Features
Share
Malaysian Law Data — AGC (Laws of Malaysia)
Scrape Malaysian federal legislation from the official Attorney General's Chambers portal — lom.agc.gov.my — into clean, structured JSON.
Every record is normalised to the same schema, regardless of which of the ten source collections it came from: bilingual titles (English + Malay), act numbers, status, dates, and a direct link to the official PDF issued by AGC.
No proxies, no browser, no API key. The portal serves its data through an encrypted JSON endpoint; this Actor decrypts it directly.
What you get
| What | Detail |
|---|---|
| Coverage | ~19,600 documents across 10 collections |
| Bilingual titles | titleEN and titleBM separated from the source's combined title cells |
| Official PDFs | pdfEN / pdfBM point at AGC's own download gateway — always downloadable, no extra request per record |
| Dates | Publication, royal assent and commencement, normalised to ISO-8601 |
| Status | Latest consolidated version, revised, translated, repealed, etc. |
| Repeal relations | Repealed acts carry a repealedBy object with the repealing act |
| Parent act | Subsidiary legislation carries a parentAct object linking to the parent Act in both languages |
| Deterministic ids | id = <collection>:<source identity>, stable across runs |
| No duplication | Records are de-duplicated in-flight, even when the source repeats rows |
Collections
Pick one or more with the collections input. Defaults are the three most useful for most buyers.
collections value | What it contains | ≈ Records |
|---|---|---|
principal-original | Principal Acts as originally enacted | 893 |
principal-updated | Principal Acts, latest consolidated version | 889 |
principal-revised | Principal Acts — Revision of Laws timeline | 405 |
principal-translated | Authoritative translations of principal Acts | 127 |
principal-repealed | Repealed principal Acts (with the repealing act) | 113 |
amendment | Amendment Acts (Act A…) | 414 |
federal-constitution | Federal Constitution amendments (English + Malay naskhah merged) | 60 |
ordinance | Sabah / Sarawak ordinances | 2 |
subsid-pua | Subsidiary legislation — P.U.(A) | 7,392 |
subsid-pub | Subsidiary legislation — P.U.(B) | 9,280 |
Counts are
recordsTotalreported by the source at build time (2026-11). The portal grows; treat them as a guide.
Input
| Field | Type | Default | Description |
|---|---|---|---|
collections | array | ["principal-original","principal-updated","amendment"] | Collections to scrape. |
keyword | string | "" | Server-side title filter. Empty = everything. |
maxItems | integer | 100 | Max records written this run. Hard cap 25000. |
includeRaw | boolean | false | Attach the untouched source record under raw. |
resume | boolean | true | Continue from where the previous identical run stopped. |
Example: one act family by number
{"collections": ["principal-updated", "principal-repealed"],"maxItems": 50}
Example: every subsidiary regulation mentioning a keyword
{"collections": ["subsid-pua", "subsid-pub"],"keyword": "perbekalan","maxItems": 1000}
Example: a full corpus snapshot
{"collections": ["principal-original","principal-updated","principal-revised","principal-translated","principal-repealed","amendment","federal-constitution","ordinance","subsid-pua","subsid-pub"],"maxItems": 25000,"resume": true}
Output
One dataset item per document. Empty strings and null mean the source does not provide that value for this document — they are never invented.
{"id": "principal-original:13","collection": "principal-original","collectionLabel": "Principal Acts — as originally enacted","docType": "principal","actNo": "1","titleEN": "INCOME TAX ACT 1967","titleBM": "AKTA CUKAI PENDAPATAN 1967","status": "UPDATED","year": 1967,"publicationDate": "1967-09-21","royalAssentDate": "1967-09-15","commencementDate": "1968-01-01","commencementRemark": "","language": "","sourceUrl": "https://lom.agc.gov.my/act-detail.php?act=1&lang=BI","pdfEN": "https://lom.agc.gov.my/ilims/upload/portal/akta/outputaktap/.../Income Tax Act 1967.pdf","pdfBM": "","scrapedAt": "2026-11-15T09:14:03.118Z"}
| Field | Type | Notes |
|---|---|---|
id | string | <collection>:<identity> — stable, unique per document |
collection | string | Source collection id |
collectionLabel | string | Human-readable collection name |
docType | string | principal | amendment | constitution | ordinance | subsidiary |
actNo | string | Act / P.U. number, e.g. 1, A1392, P.U. (A) 117/2003 |
titleEN | string | English title, when the source has one |
titleBM | string | Malay title, when the source has one |
status | string | Status label from the source (UPDATED, REVISED, repealed, …) |
year | integer | Derived from commencement, falling back to publication |
publicationDate | string | ISO-8601 |
royalAssentDate | string | ISO-8601 |
commencementDate | string | ISO-8601 |
commencementRemark | string | Free-text note from the source |
language | string | Language of the authoritative text, when stated (BI English, BM Malay, BI+BM when both naskhahs are merged) |
sourceUrl | string | AGC page for the document |
pdfEN / pdfBM | string | Official PDF URLs (AGC download gateway) |
repealedBy | object | {actNo, titleEN, titleBM, url} — repealed acts only |
parentAct | object | {urlEN, urlBM} — parent Act pages — subsidiary legislation only |
scrapedAt | string | ISO-8601 run timestamp |
raw | object | Untouched source record, only when includeRaw: true |
Field names are treated as a stable public contract.
Pricing
Pay-per-event: $0.0025 per legislation record written to your dataset. You pay for data, not for run time, memory or proxies.
- 100 records ≈ $0.25
- 1,000 records ≈ $2.50
- Full corpus (~19,600 records) ≈ $49
Charging rules:
- Write first, charge second. A record is only charged after it has been successfully pushed to the dataset. If storage fails, you are not charged for it.
- No charge for empty results. A keyword with no matches costs nothing.
- Budget is respected mid-page. If your run's maximum charge is reached, the Actor stops cleanly and keeps the records already delivered.
- Re-runs only pay for new records. With
resume: true, a second run continues where the first stopped instead of re-billing the same documents.
Duplicated rows from the source are collapsed before charging, so you never pay twice for the same document in a single run.
Plan discounts are automatic. Five tier events are registered alongside the base event — Bronze $0.0023, Silver $0.0021, Gold $0.0019, Platinum $0.0017, Diamond $0.0015. The Actor reads the buyer's plan at run time and charges the matching price. Because some accounts cannot read the plan, the Actor falls back to the base price in that case; it never charges a discount the customer did not qualify for.
The minimum spend floor is $0.10. Your own per-run budget is what actually limits how much a run may buy — raise it in the Apify Console if you want the whole 19,600-record corpus in one go ($49).
Running it from the API
Pass the input flat. The Apify run API silently discards a payload whose input is wrapped in an
inputkey and falls back to the schema defaults — your filter is lost and you are billed for the default corpus. Send the fields at the top level of the request body.
# WRONG - the nested "input" object is discarded, defaults are appliedcurl -X POST "https://api.apify.com/v2/acts/vMHxFcrgTiJm0ahld/runs?token=$APIFY_TOKEN" \-H 'Content-Type: application/json' \-d '{"input":{"collections":["subsid-pua"],"maxItems":50}}'# RIGHT - flat bodycurl -X POST "https://api.apify.com/v2/acts/vMHxFcrgTiJm0ahld/runs?token=$APIFY_TOKEN" \-H 'Content-Type: application/json' \-d '{"collections":["subsid-pua"],"maxItems":50}'
The Apify Console, the Apify MCP server and the apify CLI all send flat input correctly, so this only matters for hand-written API calls.
Every run writes its effective input to the default key-value store under OUTPUT, alongside the per-collection statistics. If the input you sent is not what you see there, you were charged for something else — check it before a large run.
How it works
- Loads the collection page, reads the per-session AES key and the JSON endpoint from the HTML (both rotate, so both are read fresh every run).
- Requests pages of 200 records with the collection's real field names — this is what keeps server-side pagination and ordering correct.
- Decrypts each response (AES-256-GCM), normalises every record to the public schema.
- Resolves PDF links locally by decoding the portal's base64 file tokens, avoiding one HTTP request per document.
- Pushes the page to the dataset, then charges for exactly those records.
- Saves the per-collection cursor so the next run resumes instead of restarting.
Requests are spaced out (~400 ms) to stay polite to a government portal.
Limitations
-
Legislation only. Court judgments live on a separate, JavaScript-only portal (
cms2.kehakiman.gov.my) and are not part of this Actor. -
No reprint collection. The source's reprint endpoint returns a server error (
SQLSTATE[42S02]); it is disabled rather than shipped broken. -
Keyword search is server-side and language-bound. The portal matches titles in each collection's primary language. Use Malay terms for
amendment,subsid-*andprincipal-revised(e.g.perbekalan, notsupply). -
No AI summaries in v1. Output is source-faithful data only, so nothing in the dataset is generated or inferred.
-
principal-revisedreports timeline rows.recordsTotalcounts timeline rows, which is why records are de-duplicated by act. -
Resume needs a named key-value store. The cursor is kept in a per-user store (
state-<userId>). If the platform refuses to create it for your account (some accounts restrict named storage creation from runs), the Actor logs a warning, falls back to the run's default store and continues — only resume across runs is then unavailable.OUTPUT.stateStore.persistenttells you which mode was used. -
Empty fields are honest. If AGC does not publish a commencement date or English title for a document, the field is empty rather than guessed.
-
Some documents have no PDF. A number of Federal Constitution amendments are published only as P.U. gazette references with no downloadable file. Those records keep a working
sourceUrland emptypdfEN/pdfBM. -
PDF URLs use AGC's download gateway.
pdfEN/pdfBMpoint atprocessFile.php?token=…rather than the raw file path, because the raw/ilims/upload/…path intermittently returns HTTP 500 while the gateway reliably returns the PDF. Treat these as download links, not as stable permanent URLs. -
The portal refuses non-Malaysian IP ranges.
lom.agc.gov.myserves Malaysian clients normally while resetting connections from foreign IP ranges. From an Apify container, from a home connection outside Malaysia, and through a third-party rendering proxy, the TLS connection is reset and the Actor reportsfetch failed.How to tell an outage from a block — the portal was confirmed up (serving gazettes published that day) while every subpage request was reset:
Probe Result Public DNS for lom.agc.gov.myresolves normally TCP connect to the resolved IP, port 443 connection times out Third-party renderer fetching the homepage succeeds (cached edge) Third-party renderer fetching any subpage ERR_CONNECTION_RESETA run on a blocked network now fails with an explicit message saying so, instead of silently reporting success with zero rows. Running it from a Malaysian network, or through a proxy with a Malaysian exit, is the only way to verify live collection.
Use cases
- Legal-tech and compliance teams building a Malaysian statute database.
- Law firms and in-house counsel tracking amendments and repeals.
- Fintech, insurance and healthcare companies mapping sector regulation.
- Researchers, journalists and NGOs analysing legislative output over time.
- AI/RAG pipelines that need citable, current Malaysian legal sources with official PDFs.
Data source
Public data published by the Attorney General's Chambers of Malaysia — Laws of Malaysia portal. This Actor reads only what the portal serves publicly, at a polite rate, and always links back to the official page and PDF.
The source is authoritative; this Actor is an access layer. Always verify against the official document before relying on it legally.
Project structure
src/ # Actor source (sources, lib, schemas)tests/ # vitest suites + HTML/JSON fixturesscripts/ # one-off helpers (capture-fixtures.mjs).actor/ # actor.json + dataset schemaPRICING.md # pay-per-event pricing modelREPORT.md # build & verification checklist
Support
Open an issue from the Actor's page in Apify Console with the run id and the input you used. Questions about coverage or a missing collection are welcome.