ASIC company dataset (Australia)
reference Facts, options, APIs
On this page
- Settings
- Vocabulary and Properties
- Request and response
- Properties added by the enricher
- How the script handles input and errors
- Testing the enricher
- Limitations
- Process script
This example looks up an Australian Company Number (ACN) in the company dataset that the Australian Securities and Investments Commission (ASIC) publishes on data.gov.au every week. It uses the portal’s datastore search API. For each golden record it stores the current company name, former names, ABN, company type, class and sub-class, status, registration and deregistration dates, and the state registration the company had before national registration. No API key is needed.
It complements the ABN Lookup sample: ABN Lookup starts from an ABN and needs a GUID, and this sample starts from an ACN and adds ASIC’s own company classification and name history.
Enricher version: V2
API key: not needed
To set up the enricher, see Add REST API enricher, then use the settings and script on this page.
Settings
-
Accepted Business Domain –
/Organization, or the business domain that holds your companies. -
Version – V2 (recommended).
-
API Key – leave empty.
-
Filters – we recommend a rule that only accepts golden records where
organization.acnhas a value. Otherwise, every record without an ACN is listed on the enricher’s Logs tab as having returned no results.
Vocabulary and Properties
organization.acn
organization.acn holds the 9-digit ACN, for example 004028077. For a registered Australian body (company type RACN), the dataset keeps its Australian Registered Body Number (ARBN) in the same column, so an ARBN works too. If your data uses another vocabulary key, change this field and the ACN_KEY value at the top of the script.
Request and response
Base URL: https://data.gov.au/data/api/3/action
Endpoint: GET /datastore_search?resource_id=5c3914e6-413e-4a2c-b890-bf8efe3eabf2&limit=100&filters={"ACN":"<acn>"}
Authentication: none
Rate limits: none published. Most requests take under a second, but some took over 10 seconds in our tests.
The resource is the dataset’s Company Dataset - Current file, which ASIC replaces every week. The script asks for an exact match on the ACN column. The filters value is URL-encoded:
GET https://data.gov.au/data/api/3/action/datastore_search?resource_id=5c3914e6-413e-4a2c-b890-bf8efe3eabf2&limit=100&filters=%7B%22ACN%22%3A%22004028077%22%7D
Accept: application/json
The dataset has one row for each name the company has had. The row whose Current Name Indicator is Y has the current name; the other rows are former names and carry the current name and its start date. Shortened response:
{
"success": true,
"result": {
"filters": { "ACN": "004028077" },
"resource_id": "5c3914e6-413e-4a2c-b890-bf8efe3eabf2",
"records": [
{
"_id": 104641,
"Company Name": "BHP BILLITON LIMITED",
"ACN": "004028077",
"Type": "APUB",
"Class": "LMSH",
"Sub Class": "LIST",
"Status": "REGD",
"Date of Registration": "13/08/1885",
"Date of Deregistration": null,
"Previous State of Registration": "VIC",
"State Registration number": "C0000948S",
"Modified since last report": null,
"Current Name Indicator": null,
"ABN": "49004028077",
"Current Name": "BHP GROUP LIMITED",
"Current Name Start Date": "19/11/2018"
},
{
"_id": 104642,
"Company Name": "BHP GROUP LIMITED",
"ACN": "004028077",
"Type": "APUB",
"Class": "LMSH",
"Sub Class": "LIST",
"Status": "REGD",
"Date of Registration": "13/08/1885",
"Date of Deregistration": null,
"Previous State of Registration": "VIC",
"State Registration number": "C0000948S",
"Modified since last report": null,
"Current Name Indicator": "Y",
"ABN": "49004028077",
"Current Name": null,
"Current Name Start Date": null
}
],
"total": 4
}
}
Properties added by the enricher
| Property | Response field | Example |
|---|---|---|
asic.acn | ACN | 004028077 |
asic.name | Company Name of the current-name row | BHP GROUP LIMITED |
asic.formerNames | Company Name of the other rows, separated by ; | BHP BILLITON LIMITED; BHP LIMITED; THE BROKEN HILL PROPRIETARY COMPANY LIMITED |
asic.currentNameStartDate | Current Name Start Date of a former-name row | 2018-11-19 |
asic.abn | ABN (left out when the dataset has 0, meaning no ABN) | 49004028077 |
asic.type | Type, described | Australian public company |
asic.typeCode | Type | APUB |
asic.class | Class, described | Limited by shares |
asic.classCode | Class | LMSH |
asic.subClass | Sub Class, described | Listed public company |
asic.subClassCode | Sub Class | LIST |
asic.status | Status, described | Registered |
asic.statusCode | Status | REGD |
asic.registrationDate | Date of Registration | 1885-08-13 |
asic.deregistrationDate | Date of Deregistration | 2026-03-13 |
asic.previousState | Previous State of Registration | VIC |
asic.stateRegistrationNumber | State Registration number | C0000948S |
The descriptions of the codes come from the data dictionary in ASIC’s Company Dataset help file. A code that isn’t in the data dictionary is stored only as the code. A property is added only when the dataset has a value for it.
If the enricher has a Preview tab, the results appear there first. To add them to golden records, go to the Map tab, select Map Data, and choose Auto Mapping. Select the business domain, enter a new vocabulary named ASIC Company with the key prefix asic, and then create the mapping. Auto mapping also uses name as the golden record name, so remove that from the mapping if you want to keep your existing names. Then process the data on the Process tab. If the enricher has no Preview tab, the properties are added to the golden record as soon as it is enriched.
How the script handles input and errors
-
Spaces, dots, dashes, and a leading
ACNare removed, soACN 004 028 077is looked up as004028077. A 7- or 8-digit number that lost its leading zeros is padded to 9 digits. The check digit is verified. Golden records without a valid ACN are skipped without calling the API. -
If the dataset has no company with the ACN, or the API returns an error, the script logs the reason and adds nothing.
-
If the portal reports that it is too busy (HTTP 429 or 503), the script throws an error that makes the enricher try the golden record again later.
-
Successful results are cached for 24 hours per ACN. To change this, edit
CACHE_MILLISECONDSin the script.
Testing the enricher
-
Test connection checks only that the script runs. It doesn’t call the API.
-
To try the setup, create a golden record with
organization.acnset to004028077(BHP Group Limited, with three former names).123123124returns Commonwealth Bank of Australia, and000000260returns a deregistered company without an ABN.
Limitations
-
The dataset is a weekly snapshot, not the live register. ASIC says the information might not be accurate when you check it, and points to ASIC Connect (a website, not an API) for real-time information.
-
The dataset has all currently registered companies, but deregistered companies only for the past year. An older deregistered company returns nothing.
-
There are no addresses, officers or shareholders. ASIC sells those as register extracts.
-
ASIC replaces the file behind the resource every week and the resource ID has stayed the same. If ASIC ever publishes the data under a new resource, change
RESOURCE_IDin the script.
Process script
// REST API enricher (V2) - Australian company lookup with ASIC's company dataset
//
// Looks up a golden record's Australian Company Number (ACN) in the company dataset that the
// Australian Securities and Investments Commission (ASIC) publishes every week on data.gov.au
// (https://data.gov.au/data/dataset/asic-companies), using the portal's CKAN datastore search
// API, and adds the result to the golden record as asic.* properties:
//
// asic.acn 9-digit ACN that was looked up (the ARBN for type RACN)
// asic.name current company name
// asic.formerNames former company names, separated by "; "
// asic.currentNameStartDate date the current name took effect (YYYY-MM-DD)
// asic.abn Australian Business Number
// asic.type company type, for example Australian public company
// asic.typeCode company type code, for example APUB
// asic.class company class, for example Limited by shares
// asic.classCode company class code, for example LMSH
// asic.subClass company sub-class, for example Listed public company
// asic.subClassCode company sub-class code, for example LIST
// asic.status company status, for example Registered
// asic.statusCode company status code, for example REGD
// asic.registrationDate date of registration (YYYY-MM-DD)
// asic.deregistrationDate date of deregistration (YYYY-MM-DD)
// asic.previousState state the company was first registered in, for example VIC
// asic.stateRegistrationNumber number the company had in that state's register
//
// No API key is needed. See README.md next to this file for the enricher settings.
//
// A record gets no result (nothing is stored) when it has no valid ACN, when the ACN isn't in
// the dataset, or when the API can't answer.
// ---- Settings -------------------------------------------------------------------------
// Vocabulary key to read. Add the same key to the Vocabulary and Properties field.
const ACN_KEY = "organization.acn";
const DATASTORE_URL = "https://data.gov.au/data/api/3/action/datastore_search";
// "Company Dataset - Current" resource of ASIC's company dataset on data.gov.au
const RESOURCE_ID = "5c3914e6-413e-4a2c-b890-bf8efe3eabf2";
// How long to reuse an answer for the same ACN. 0 turns caching off.
const CACHE_MILLISECONDS = 24 * 60 * 60 * 1000;
// ---- Script ---------------------------------------------------------------------------
// Code descriptions from the data dictionary in ASIC's Company Dataset help file.
const TYPES = {
APTY: "Australian proprietary company",
APUB: "Australian public company",
FNOS: "Foreign company",
RACN: "Registered Australian body",
};
const CLASSES = {
LMSH: "Limited by shares",
LMGT: "Limited by guarantee",
LMSG: "Limited by both shares and guarantee",
NLIA: "No liability company",
UNLM: "Unlimited company",
NONE: "No equivalent Australian liability",
};
const SUB_CLASSES = {
EXPT: "Exempt proprietary company",
HUNT: "Proprietary home unit company",
LISN: "Company licensed to omit Limited from its name",
LISS: "Company licensed to omit Limited from its name - superannuation trustee company",
LIST: "Listed public company",
NEXT: "Non-exempt proprietary company",
NLTD: "Non-profit public company licensed to omit Limited from its name",
PNPC: "Proprietary non-profit company",
PROP: "Proprietary other",
PSTC: "Proprietary superannuation trustee company",
PUBF: "Foreign company required to lodge a balance sheet",
RACA: "Registrable Australian corporation - association",
RACO: "Registrable Australian corporation - non association",
STFI: "Public company - small transferring financial institution",
ULSN: "Unlisted public - non-profit company",
ULSS: "Unlisted public - superannuation trustee company",
ULST: "Unlisted public company",
};
const STATUSES = {
REGD: "Registered",
DRGD: "Deregistered",
EXAD: "External administration",
NOAC: "Not active",
NRGD: "Not registered",
PROV: "Provisional",
SOFF: "Strike-off action in progress",
DISS: "Dissolved by Special Act of Parliament",
DIV3: "Transferred registration via Division 3",
PEND: "Pending - schemes",
CNCL: "Cancelled",
};
function getValue(key) {
// A plain loop rather than vocabularies.find(...): vocabularies is a .NET list, and when
// .find is called from inside a function, later calls return the first call's match.
const items = vocabularies || [];
for (let i = 0; i < items.length; i++) {
if (items[i].Key === key) {
const value = items[i].Value;
return value === null || value === undefined ? "" : String(value).trim();
}
}
return "";
}
// Accepts "004 028 077", "004-028-077", "ACN 004028077", and numbers that lost their leading
// zeros (for example 4028077). Returns the 9 digits, or null when the value isn't a valid ACN
// (ASIC's check digit: weights 8 to 1, modulus 10).
function parseAcn(raw) {
const text = raw.toUpperCase().replace(/^A\.?C\.?N\.?/, "").replace(/^ARBN/, "");
if (/[A-Z]/.test(text)) {
return null;
}
let digits = text.replace(/[\s.\-]/g, "");
if (!/^\d{7,9}$/.test(digits)) {
return null;
}
while (digits.length < 9) {
digits = "0" + digits;
}
let sum = 0;
for (let i = 0; i < 8; i++) {
sum += Number(digits.charAt(i)) * (8 - i);
}
return (10 - (sum % 10)) % 10 === Number(digits.charAt(8)) ? digits : null;
}
function clean(value) {
if (value === null || value === undefined) {
return null;
}
const text = String(value).replace(/\s+/g, " ").trim();
return text === "" ? null : text;
}
function parseJson(text) {
try {
return JSON.parse(text);
} catch (e) {
return null;
}
}
// The dataset writes dates as DD/MM/YYYY. "13/08/1885" -> "1885-08-13"
function toDate(value) {
const text = clean(value);
const match = text ? /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(text) : null;
if (!match) {
return null;
}
return `${match[3]}-${match[2].length === 1 ? "0" + match[2] : match[2]}-${match[1].length === 1 ? "0" + match[1] : match[1]}`;
}
// Calls the datastore API. Returns the company's rows (one per name it has had), or null when
// there's no answer to store.
function lookUp(acn) {
const filters = { ACN: acn };
const apiResponse = http.send({
url: `${DATASTORE_URL}?resource_id=${RESOURCE_ID}&limit=100&filters=${encodeURIComponent(JSON.stringify(filters))}`,
method: "GET",
headers: [{ Key: "Accept", Value: "application/json" }],
});
const status = String(apiResponse.HttpStatus || "");
const body = parseJson(apiResponse.Content);
if (status === "TooManyRequests" || status === "ServiceUnavailable") {
throw new Error(`TooManyRequests - data.gov.au is busy (HTTP ${status}), the record will be retried`);
}
const records = body && body.success === true && body.result && Array.isArray(body.result.records)
? body.result.records
: null;
if (status !== "OK" || !records) {
log(`data.gov.au could not look up ACN ${acn}. HTTP ${status}. ${String(apiResponse.Content || "").substring(0, 200)}`);
return null;
}
const rows = [];
for (let i = 0; i < records.length; i++) {
if (records[i] && String(records[i].ACN) === acn) {
rows.push(records[i]);
}
}
if (rows.length === 0) {
log(`ASIC's company dataset has no company with ACN ${acn}.`);
return null;
}
return rows;
}
function run() {
const acn = parseAcn(getValue(ACN_KEY));
if (!acn) {
// No valid ACN on this record (this is also what Test connection hits, because it passes
// placeholder values instead of real ones).
return [];
}
const cacheKey = `asic:${acn}`;
const cached = CACHE_MILLISECONDS > 0 ? cache.get(cacheKey) : null;
let rows = cached ? parseJson(String(cached)) : null;
if (!rows) {
rows = lookUp(acn);
if (!rows) {
return [];
}
if (CACHE_MILLISECONDS > 0) {
cache.set(cacheKey, JSON.stringify(rows), CACHE_MILLISECONDS);
}
}
// The dataset has one row for each name the company has had. The row with Current Name
// Indicator Y has the current name; the others carry the current name and its start date in
// Current Name and Current Name Start Date.
let current = null;
let history = null;
for (let i = 0; i < rows.length; i++) {
if (clean(rows[i]["Current Name Indicator"]) === "Y") {
current = current || rows[i];
} else if (!history && clean(rows[i]["Current Name"])) {
history = rows[i];
}
}
const row = current || rows[0];
const name = current ? clean(current["Company Name"]) : clean(row["Current Name"]) || clean(row["Company Name"]);
const formerNames = [];
for (let i = 0; i < rows.length; i++) {
const formerName = clean(rows[i]["Company Name"]);
if (rows[i] !== current && formerName && formerName !== name && formerNames.indexOf(formerName) < 0) {
formerNames.push(formerName);
}
}
const typeCode = clean(row.Type);
const classCode = clean(row.Class);
const subClassCode = clean(row["Sub Class"]);
const statusCode = clean(row.Status);
const abn = clean(row.ABN);
const data = {
"asic.acn": acn,
"asic.name": name,
"asic.formerNames": formerNames.length > 0 ? formerNames.join("; ") : null,
"asic.currentNameStartDate": history ? toDate(history["Current Name Start Date"]) : null,
// The dataset writes 0 when a company has no ABN.
"asic.abn": abn && abn !== "0" ? abn : null,
"asic.type": typeCode ? TYPES[typeCode] || null : null,
"asic.typeCode": typeCode,
"asic.class": classCode ? CLASSES[classCode] || null : null,
"asic.classCode": classCode,
"asic.subClass": subClassCode ? SUB_CLASSES[subClassCode] || null : null,
"asic.subClassCode": subClassCode,
"asic.status": statusCode ? STATUSES[statusCode] || null : null,
"asic.statusCode": statusCode,
"asic.registrationDate": toDate(row["Date of Registration"]),
"asic.deregistrationDate": toDate(row["Date of Deregistration"]),
"asic.previousState": clean(row["Previous State of Registration"]),
"asic.stateRegistrationNumber": clean(row["State Registration number"]),
};
// Leave out values the dataset didn't return, so they don't overwrite existing data with blanks.
Object.keys(data).forEach((key) => {
if (data[key] === null) {
delete data[key];
}
});
return [{ Data: data, Score: 100 }];
}
response = JSON.stringify(run());