A tool to fetch and validate the quality of data from Open Referral UK APIs.
Find a file
2025-01-15 12:02:55 +00:00
.vscode feat: initial commit 2024-12-18 11:23:05 +00:00
bin feat: proper CLI cmd setup 2024-12-18 19:12:08 +00:00
data feat: proper CLI cmd setup 2024-12-18 19:12:08 +00:00
.gitignore chore: update readme 2024-12-18 19:21:25 +00:00
.nvmrc feat: initial commit 2024-12-18 11:23:05 +00:00
helpers.js feat: proper CLI cmd setup 2024-12-18 19:12:08 +00:00
package-lock.json feat: look for email and phone number for contact 2025-01-15 12:02:55 +00:00
package.json feat: proper CLI cmd setup 2024-12-18 19:12:08 +00:00
README.md chore: update readme 2024-12-18 19:24:18 +00:00
validators.js feat: look for email and phone number for contact 2025-01-15 12:02:55 +00:00

Family Hubs Open Referral UK tester

A tool to fetch and validate the quality of data from Open Referral UK APIs.

Purpose

The Family Hubs DfE delivery team use this tool to pull and quality check the data available on current (as of Dec 2024) Open Referral UK APIs.

Pre-requisites

  • node (built using v23.4.0; will probably run on nearby versions)

Usage

  1. Clone the repo
  2. Run npm install to install node dependencies
  3. Run node bin/fetch.js <url> to fetch and save a JSON file containing an array of services data.
  4. Run node bin/eval.js <path> to run the evaluation tool over a JSON file generated from step 3.

Results will be shown in the console:

...
│ 817'f92ddae3-2007-8cf8-c9eb-ec2aad962f2a'falsetruetruetruetruetrue            │
│ 818'dbb17998-b11a-45e7-ac1f-2bae60e40e0a'truetruetruetruetruefalse           │
└─────────┴────────────────────────────────────────┴────────────┴──────────────┴─────────────────────┴─────────────┴──────────────────────┴─────────────────┘
--------------------
RESULTS
--------------------
# of services with a valid ID: 0/1157 (0%)
# of services with a valid status: 1152/1157 (100%)
# of services with a valid name: 1157/1157 (100%)
# of services with a valid description: 1135/1157 (98%)
# of services with a valid URL: 979/1157 (85%)
# of services with a valid organisation: 1149/1157 (99%)
# of services with a valid contact: 0/1157 (0%)
--------------------
# of usable services: 0/1157 (0%)
--------------------

Note: use the --help CLI flag to see more options for each command.

Example usage

To fetch and evaluate the quality of data from Southampton's OR UK API (https://directory.southampton.gov.uk/api):

$ node bin/fetch.js https://directory.southampton.gov.uk/api/services
$ node bin/eval.js ./data/directorysouthamptongovuk.json

Fetching all current OR UK-compliant local authority data

The following snippet will fetch data from all current (as of Dec 2024) OR UK-compliant local authorities with APIs on the OR UK dashboard:

node bin/fetch.js https://bristol.openplace.directory/o/ServiceDirectoryService/v2/services
node bin/fetch.js https://northlincs.openplace.directory/o/ServiceDirectoryService/v2/services
node bin/fetch.js https://directory.southampton.gov.uk/api/services
node bin/fetch.js https://api.familyinfo.buckinghamshire.gov.uk/api/v1/services
node bin/fetch.js https://penninelancs.openplace.directory/o/ServiceDirectoryService/v2/services