> ## Documentation Index
> Fetch the complete documentation index at: https://docs.therefrain.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Corporate Registry Lookup

> Search company registries and extract registration details — company number, address, incorporation date.

## Overview

Due-diligence, KYC, and onboarding workflows often require looking up companies on government registries — checking incorporation status, extracting registered addresses, or verifying company numbers. These portals rarely offer APIs, so teams spend hours on manual lookups.

Refrain automates the entire flow: search by company name, open the detail page, extract the required fields, and export them as CSV. With batch mode you can process hundreds of companies from a spreadsheet in a single run.

## Example runbook

```yaml theme={null}
name: corporate-registry-lookup
url: https://find-and-update.company-information.service.gov.uk
variables:
  - name: companyName
    source: prompt
    description: Company name to search
steps:
  - action: input
    selector: "#site-search-text"
    value: "{{ companyName }}"
  - action: click
    selector: "#search-submit"
  - action: click
    selector: ".govuk-link[href*='/company/']"
  - action: extract
    selector: "#company-summary"
    capture: companyDetails
  - action: export
    format: csv
    fields:
      - name: companyName
        value: "{{ companyName }}"
      - name: details
        value: "{{ companyDetails }}"
```

## Generate and execute

<Steps>
  <Step title="Generate the runbook">
    Point Refrain at the registry and describe the goal:

    ```bash theme={null}
    npx @refrainai/cli generate -- \
      --url https://find-and-update.company-information.service.gov.uk \
      --goal "Search for a company and extract its company number, registered address, incorporation date, and status" \
      --context ./context.md \
      --output ./corporate-registry.yaml
    ```
  </Step>

  <Step title="Execute the runbook">
    Run the generated runbook:

    ```bash theme={null}
    npx @refrainai/cli execute -- \
      --runbook ./corporate-registry.yaml
    ```
  </Step>

  <Step title="Batch processing">
    Provide a CSV with company names for bulk lookups:

    ```bash theme={null}
    npx @refrainai/cli execute -- \
      --runbook ./corporate-registry.yaml \
      --data ./companies.csv
    ```
  </Step>
</Steps>

## Why this works well

* **No API required** — Works directly on government portal web interfaces.
* **Self-healing** — Portal UI changes don't break the automation. Selectors are resolved through multiple fallback layers.
* **Batch mode** — Process hundreds of companies from a CSV in a single run.
* **Zero rerun cost** — After the initial AI-powered generation, every execution is deterministic and token-free.

## What's next

<CardGroup cols={2}>
  <Card title="Generate a runbook" icon="wand-magic-sparkles" href="/guides/generate-runbook">
    Learn how AI builds runbooks from a goal.
  </Card>

  <Card title="Variables and secrets" icon="key" href="/guides/variables-and-secrets">
    Securely pass credentials and data to runbooks.
  </Card>
</CardGroup>
