---
title: ORIC Indigenous corporations (Australia)
url: https://documentation.cluedin.net/govern/rest-api-enricher-samples/oric-australia
content_type: reference
section: Govern & improve > REST API enricher samples
---

# ORIC Indigenous corporations (Australia)

> reference: Facts, options, APIs.

This example looks up an Indigenous Corporation Number (ICN) in the [register of Aboriginal and Torres Strait Islander corporations](https://data.gov.au/data/dataset/aboriginal-and-torres-strait-islander-corporations-oric) that the Office of the Registrar of Indigenous Corporations (ORIC) publishes on data.gov.au every month. It uses the portal's CKAN API. For each golden record it stores the corporation name, status, registration and deregistration dates, size, ABN, state or territory and postcode of the main place of business, industry sectors, whether it is registered with the ACNC, the latest income, assets and employee bands, and the link to its page on ORIC's public register. No API key is needed.

**Enricher version:** V2  
**API key:** not needed

To set up the enricher, see [Add REST API enricher](https://documentation.cluedin.net/govern/enrichment/rest-api.md#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 organizations.

- **Version** – V2 (recommended).

- **API Key** – leave empty.

- **Filters** – we recommend a rule that only accepts golden records where `organization.icn` has a value. Otherwise, every record without an ICN is listed on the enricher's **Logs** tab as having returned no results.

## Vocabulary and Properties

```
organization.icn
```

`organization.icn` holds the Indigenous Corporation Number, for example `7581`. If your data uses another vocabulary key, change this field and the `ICN_KEY` value at the top of the script.

## Request and response

**Base URL:** `https://data.gov.au/data/api/3/action`  
**Endpoints:** `GET /package_show?id=aboriginal-and-torres-strait-islander-corporations-oric`, then `GET /datastore_search?resource_id=<newest resource>&limit=5&filters={"ICN":"<icn>"}`  
**Authentication:** none  
**Rate limits:** none published. Requests usually take well under a second.

ORIC adds a new resource (a new file with its own ID) to the dataset every month and keeps the old ones. The script first asks for the dataset's list of resources, picks the newest one that can be searched (`datastore_active` is `true`), and caches its ID. Shortened response:

```http
GET https://data.gov.au/data/api/3/action/package_show?id=aboriginal-and-torres-strait-islander-corporations-oric
Accept: application/json
```

```json
{
  "success": true,
  "result": {
    "name": "aboriginal-and-torres-strait-islander-corporations-oric",
    "resources": [
      {
        "id": "6b892e8b-0e92-49d7-8178-7e5fd8faf546",
        "name": "8 November 2026 dataset",
        "format": "CSV",
        "datastore_active": true,
        "created": "2026-11-08T22:30:10.675559"
      },
      {
        "id": "b68d4b36-92f5-4d35-bf20-556e618263a1",
        "name": "13 October 2026 dataset",
        "format": "CSV",
        "datastore_active": true,
        "created": "2026-10-14T00:58:40.386816"
      }
    ]
  }
}
```

Then it asks for an exact match on the `ICN` column of that resource. The `filters` value is URL-encoded:

```http
GET https://data.gov.au/data/api/3/action/datastore_search?resource_id=6b892e8b-0e92-49d7-8178-7e5fd8faf546&limit=5&filters=%7B%22ICN%22%3A%222%22%7D
Accept: application/json
```

Response:

```json
{
  "success": true,
  "result": {
    "filters": { "ICN": "2" },
    "resource_id": "6b892e8b-0e92-49d7-8178-7e5fd8faf546",
    "records": [
      {
        "_id": 1,
        "ICN": "2",
        "Corporation Name": "Urapuntja Health Service Aboriginal Corporation",
        "Status Reason": "Registered",
        "Registered On": "1/02/1979",
        "Deregistered On": null,
        "Corporation Size": "Large",
        "ABN": "45449518275",
        "State/Territory (Main place of business) (Address)": "NT",
        "Postcode (Main place of business) (Address)": "0871",
        "Industry Sector(s)": "Health care and health promotion > Medical clinic or services, Health care and health promotion, Health care and health promotion > Community and social wellbeing",
        "Corporation registered with ACNC?": "Yes",
        "2023 Total Income": ">=$5m",
        "2023 Total Assets": "<$100k",
        "2023 Number of Employees": ">24",
        "2024 Total Income": ">=$5m",
        "2024 Total Assets": "<$100k",
        "2024 Number of Employees": ">24",
        "2025 Total Income": ">=$5m",
        "2025 Total Assets": ">=$2.5m",
        "2025 Number of Employees": ">24",
        "URL": "https://mycorp.oric.gov.au/public-register/public-register-details/?id=da6025c6-b605-f011-bae2-6045bde55d79"
      }
    ],
    "total": 1
  }
}
```

## Properties added by the enricher

| Property | Response field | Example |
| -------- | -------------- | ------- |
| `oric.icn` | `ICN` | `2` |
| `oric.name` | `Corporation Name` | `Urapuntja Health Service Aboriginal Corporation` |
| `oric.status` | `Status Reason` | `Registered` |
| `oric.registrationDate` | `Registered On` | `1979-02-01` |
| `oric.deregistrationDate` | `Deregistered On` | `2004-06-02` |
| `oric.size` | `Corporation Size` | `Large` |
| `oric.abn` | `ABN` | `45449518275` |
| `oric.state` | `State/Territory (Main place of business) (Address)` | `NT` |
| `oric.postcode` | `Postcode (Main place of business) (Address)` | `0871` |
| `oric.industrySectors` | `Industry Sector(s)` | `Health care and health promotion > Medical clinic or services, ...` |
| `oric.acncRegistered` | `Corporation registered with ACNC?` | `Yes` |
| `oric.financialYear` | the latest year in the `<year> Total Income` column names | `2025` |
| `oric.totalIncome` | `<year> Total Income` | `>=$5m` |
| `oric.totalAssets` | `<year> Total Assets` | `>=$2.5m` |
| `oric.employees` | `<year> Number of Employees` | `>24` |
| `oric.registerUrl` | `URL` | `https://mycorp.oric.gov.au/public-register/public-register-details/?id=...` |

The extract has financial columns for the last three years, named after the year. The script uses the latest year, so it keeps working when ORIC adds a new year. A property is added only when the register 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 `ORIC Corporation` with the key prefix `oric`, 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, a leading `ICN` and leading zeros are removed, so `ICN 07581` is looked up as `7581`. Golden records without an ICN of 1 to 7 digits are skipped without calling the API. ICNs have no check digit.

- If the newest resource can't be found, the extract has no corporation with the ICN, 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 ICN, and the ID of the newest resource is cached for 24 hours too. To change this, edit `CACHE_MILLISECONDS` in 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.icn` set to `2` (Urapuntja Health Service Aboriginal Corporation) or `7581` (Kyburra Munda Yalga Aboriginal Corporation RNTBC). `3124` returns a deregistered corporation.

## Limitations

- The data is a monthly extract, not the live register. The live register on [ORIC's website](https://www.oric.gov.au/) is not available as an API.

- Income, assets and employees are bands, such as `>=$5m`, not exact figures. Deregistered corporations have no size, ABN, location or financial data.

- After ORIC publishes a new month's extract, the script can take up to 24 hours (the cache time) to start using it.

- There are no directors, members or addresses beyond the state and postcode.

## Process script

```javascript
// REST API enricher (V2) - Aboriginal and Torres Strait Islander corporation lookup with ORIC's
// register data
//
// Looks up a golden record's Indigenous Corporation Number (ICN) in the monthly extract of the
// register of Aboriginal and Torres Strait Islander corporations that the Office of the Registrar
// of Indigenous Corporations (ORIC) publishes on data.gov.au
// (https://data.gov.au/data/dataset/aboriginal-and-torres-strait-islander-corporations-oric),
// using the portal's CKAN API, and adds the result to the golden record as oric.* properties:
//
//   oric.icn                 Indigenous Corporation Number that was looked up
//   oric.name                corporation name
//   oric.status              Registered or Deregistered
//   oric.registrationDate    date of registration (YYYY-MM-DD)
//   oric.deregistrationDate  date of deregistration (YYYY-MM-DD)
//   oric.size                corporation size: Small, Medium or Large
//   oric.abn                 Australian Business Number
//   oric.state               state or territory of the main place of business, for example NT
//   oric.postcode            postcode of the main place of business
//   oric.industrySectors     industry sectors the corporation works in
//   oric.acncRegistered      Yes when the corporation is also registered with the ACNC
//   oric.financialYear       year of the latest financial figures below, for example 2025
//   oric.totalIncome         total income band for that year, for example >=$5m
//   oric.totalAssets         total assets band for that year
//   oric.employees           number of employees band for that year, for example >24
//   oric.registerUrl         the corporation's page on ORIC's public register
//
// ORIC adds a new resource (file) to the dataset every month, so the script first asks the
// portal which resource is the newest (package_show) and remembers the answer for
// CACHE_MILLISECONDS, then searches that resource (datastore_search).
//
// 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 ICN, when the ICN isn't in
// the newest extract, or when the API can't answer.

// ---- Settings -------------------------------------------------------------------------

// Vocabulary key to read. Add the same key to the Vocabulary and Properties field.
const ICN_KEY = "organization.icn";

const API_URL = "https://data.gov.au/data/api/3/action/";
// Name of ORIC's dataset on data.gov.au
const DATASET_ID = "aboriginal-and-torres-strait-islander-corporations-oric";

// How long to reuse an answer for the same ICN, and the newest resource id. 0 turns caching off.
const CACHE_MILLISECONDS = 24 * 60 * 60 * 1000;

// ---- Script ---------------------------------------------------------------------------

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 "7581", "ICN 7581" and "07581". Returns the number without leading zeros, as ORIC
// writes it, or null when the value isn't an ICN.
function parseIcn(raw) {
  const text = raw.toUpperCase().replace(/^ICN/, "").replace(/[\s.\-]/g, "");
  if (!/^\d{1,7}$/.test(text)) {
    return null;
  }
  const icn = text.replace(/^0+/, "");
  return icn === "" ? null : icn;
}

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 register writes dates as D/MM/YYYY. "1/02/1979" -> "1979-02-01"
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 CKAN API. Returns the parsed result, or null when there's no answer.
function callApi(action, query, what) {
  const apiResponse = http.send({
    url: `${API_URL}${action}?${query}`,
    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`);
  }

  if (status !== "OK" || !body || body.success !== true || !body.result) {
    log(`data.gov.au could not ${what}. HTTP ${status}. ${String(apiResponse.Content || "").substring(0, 200)}`);
    return null;
  }
  return body.result;
}

// Returns the id of the newest resource in ORIC's dataset that can be searched, or null.
function getResourceId() {
  const cacheKey = "oric:resource";
  const cached = CACHE_MILLISECONDS > 0 ? cache.get(cacheKey) : null;
  if (cached) {
    return String(cached);
  }

  const dataset = callApi("package_show", `id=${DATASET_ID}`, "find ORIC's newest register extract");
  const resources = dataset && Array.isArray(dataset.resources) ? dataset.resources : [];
  let newest = null;
  for (let i = 0; i < resources.length; i++) {
    const resource = resources[i];
    if (resource && resource.datastore_active === true && resource.id &&
        (!newest || String(resource.created || "") > String(newest.created || ""))) {
      newest = resource;
    }
  }

  if (!newest) {
    if (dataset) {
      log("ORIC's dataset on data.gov.au has no searchable resource.");
    }
    return null;
  }
  if (CACHE_MILLISECONDS > 0) {
    cache.set(cacheKey, String(newest.id), CACHE_MILLISECONDS);
  }
  return String(newest.id);
}

// Returns the corporation's row, or null when there's no answer to store.
function lookUp(icn) {
  const resourceId = getResourceId();
  if (!resourceId) {
    return null;
  }

  const filters = { ICN: icn };
  const result = callApi(
    "datastore_search",
    `resource_id=${encodeURIComponent(resourceId)}&limit=5&filters=${encodeURIComponent(JSON.stringify(filters))}`,
    `look up ICN ${icn}`);
  const records = result && Array.isArray(result.records) ? result.records : [];

  for (let i = 0; i < records.length; i++) {
    if (records[i] && String(records[i].ICN) === icn) {
      return records[i];
    }
  }

  if (result) {
    log(`ORIC's register has no corporation with ICN ${icn}.`);
  }
  return null;
}

function run() {
  const icn = parseIcn(getValue(ICN_KEY));
  if (!icn) {
    // No valid ICN on this record (this is also what Test connection hits, because it passes
    // placeholder values instead of real ones).
    return [];
  }

  const cacheKey = `oric:${icn}`;
  const cached = CACHE_MILLISECONDS > 0 ? cache.get(cacheKey) : null;
  let row = cached ? parseJson(String(cached)) : null;

  if (!row) {
    row = lookUp(icn);
    if (!row) {
      return [];
    }
    if (CACHE_MILLISECONDS > 0) {
      cache.set(cacheKey, JSON.stringify(row), CACHE_MILLISECONDS);
    }
  }

  // The financial columns are named after the year, for example "2025 Total Income", and the
  // extract has the last three years. Use the latest year.
  let year = 0;
  const columns = Object.keys(row);
  for (let i = 0; i < columns.length; i++) {
    const match = /^(\d{4}) Total Income$/.exec(columns[i]);
    if (match && Number(match[1]) > year) {
      year = Number(match[1]);
    }
  }
  const totalIncome = year ? clean(row[`${year} Total Income`]) : null;
  const totalAssets = year ? clean(row[`${year} Total Assets`]) : null;
  const employees = year ? clean(row[`${year} Number of Employees`]) : null;

  const data = {
    "oric.icn": icn,
    "oric.name": clean(row["Corporation Name"]),
    "oric.status": clean(row["Status Reason"]),
    "oric.registrationDate": toDate(row["Registered On"]),
    "oric.deregistrationDate": toDate(row["Deregistered On"]),
    "oric.size": clean(row["Corporation Size"]),
    "oric.abn": clean(row.ABN),
    "oric.state": clean(row["State/Territory (Main place of business) (Address)"]),
    "oric.postcode": clean(row["Postcode (Main place of business) (Address)"]),
    "oric.industrySectors": clean(row["Industry Sector(s)"]),
    "oric.acncRegistered": clean(row["Corporation registered with ACNC?"]),
    "oric.financialYear": totalIncome || totalAssets || employees ? String(year) : null,
    "oric.totalIncome": totalIncome,
    "oric.totalAssets": totalAssets,
    "oric.employees": employees,
    "oric.registerUrl": clean(row.URL),
  };

  // Leave out values the register 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());
```

Up: [REST API enricher samples](https://documentation.cluedin.net/govern/rest-api-enricher-samples.md)
