Use GOC Optician & Optometrist Register Scraper with Python
Search the General Optical Council's Specialist Register (str.optical.org) for UK optometrists, dispensing opticians, students and optical businesses - by name, exact GOC number, specialty, company or postcode radius, with practice addresses and FTP decision documents.
1. Choose the data you need
Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.
2. Prepare a source-based input
This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.
{
"addresses": [],
"companyNames": [],
"fetchDetails": false,
"forename": "",
"gocNumbers": [
"01-12294"
],
"maxDetailedItems": 1,
"maxItems": 1,
"mode": "byGocNumber",
"postcode": "",
"radiusMiles": 50,
"registerType": "",
"sortBy": "",
"soundsLikeSurname": false,
"speciality": "",
"surnames": []
}
Download input.example.json and save your reviewed copy as input.json.
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | Choose the task. `registrant` searches individuals by name, register type, specialty, address, postcode, or GOC number. `bodyCorporate` searches registered businesses. `byGocNumber` checks a list of exact GOC numbers and detects registrants vs businesses automatically. `allBusinesses` exports the full registered-business list (~3,000 records). |
surnames | array | optional | One or more surnames to search. Each surname runs its own search and results are merged without duplicates. Leave empty if you search by company, register type, specialty, address, postcode, or GOC number instead. Latin-script values only: the GOC search ignores non-Latin text. |
forename | string | optional | Optional first-name filter applied to every surname search in registrant mode. |
soundsLikeSurname | boolean | optional | Match surnames phonetically (e.g. 'Smyth' also finds 'Smith') instead of as a literal substring. |
registerType | string | optional | Restrict registrant searches to one registration category. |
speciality | string | optional | Restrict registrant searches to one specialty annotation. |
addresses | array | optional | One or more address, town, or postcode-area text searches for registrant mode. Each value runs its own search and results are merged. Latin-script values only. |
companyNames | array | optional | One or more optical-business names to search in bodyCorporate mode. Each value runs its own search and results are merged. Latin-script values only. |
gocNumbers | array | optional | Exact GOC registration numbers, e.g. 01-12294, D-9396, SO-44231, CO-4310. In byGocNumber mode this is the whole lookup list (registrants and businesses can be mixed). Missing hyphens, lowercase, and a missing leading zero are normalised. In search modes the numbers are combined (AND) with the other filters. |
postcode | string | optional | UK postcode or outward code (SW1A 1AA or EH1) used with radiusMiles. Works for registrant and business searches. Only real postcodes return results. |
radiusMiles | integer | optional | Distance in miles from the postcode. Only used when postcode is set. |
sortBy | string | optional | Sort registrant results by surname. The GOC register ignores this for business searches. |
fetchDetails | boolean | optional | Visit each result's detail page to capture qualifications, town, every practice address, postcodes, and FTP decision documents. Slower and dependent on the GOC's flaky detail pages; disable for a fast list-only run. Ignored in allBusinesses mode, which is always list-only. |
maxDetailedItems | integer | optional | Only used when fetchDetails is on. The first N records are enriched; the rest are emitted with list-level fields. Keep this modest for large runs. Ignored in allBusinesses mode. |
maxItems | integer | optional | Hard cap on records emitted across all searches. The registrant register is about 33,359 rows at 5 per page, so a complete registrant export cannot finish in one default run. The full business register is about 2,973 rows and allBusinesses is list-only. |
3. Start an Actor run
Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.
Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.
import json
import os
import urllib.request
# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
actor_input = json.load(stream)
token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
"https://api.apify.com/v2/acts/nM2vtMcH1bZsKtNf3/runs?timeout=120&maxTotalChargeUsd=0.50",
data=json.dumps(actor_input).encode("utf-8"),
headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.
4. Inspect the actual results
Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.
Registrants and optical businesses from the General Optical Council's public Specialist Register — GOC number, name or company, register type, status, registration date, specialties, qualifications, town, every practice address and postcode, FTP decision documents, and source URL.
Questions before you run
Which inputs are required?
The published required fields are mode
What does this guide verify?
The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.
What if the run request times out?
Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.
Generated from source build UvNLj8gOebSn7KfpY and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.