# Business Service Extractor (`eichan/business-service-extractor`) Actor

- **URL**: https://apify.com/eichan/business-service-extractor.md
- **Developed by:** [Eichan Jolly](https://apify.com/eichan) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Business Service Extractor

Extract services that a business has **explicitly declared in JSON-LD** on one official business website page. The Actor does not infer services from visible page text.

### Who it is for

B2B list-quality teams, service-category researchers and sales operations users who need traceable, machine-readable service declarations, not marketing-text guesses. One URL per run. No accounts, logins, LinkedIn collection or personal-profile harvesting.

### Input

```json
{"url":"https://firstcapitol.co.uk/debt-collection-agency-london/"}
```

This is a real publicly reachable business page (independently accessible on 2026-11-01), **not** a fabricated/example domain. The live HTML's current JSON-LD service coverage could not be verified by the build environment. Accordingly, service results for this URL are **not guaranteed**; honest `not_found` output is part of normal operation.

### Output

One row per explicitly declared `Service` (or recognized Schema.org service subtype) from JSON-LD `@graph` declarations, `makesOffer`, `hasOfferCatalog`, nested `OfferCatalog` entries, or `itemOffered`. `@id` references to same-page entities are supported. Output keys remain stable:

- `businessName`: a published provider business name, or name of the organization declaring an offer; `null` if not present
- `serviceName`: published `Service.name`, otherwise `null`
- `serviceType`: published `serviceType`, otherwise explicit Schema.org Service `@type`
- `description`: first 300 characters of the published description with whitespace normalized; `null` when not provided, never generated
- `sourceUrl`: fetched input page URL
- `status`: `found` or `not_found`
- `error`: `null` for found rows, or readable explanation of `not_found`

An **illustrative fixture result**, not live evidence for the prefill target:

```json
{"businessName":"Northstar Trade Services","serviceName":"Business Debt Recovery","serviceType":"B2B collections","description":"Collection service for businesses.","sourceUrl":"https://firstcapitol.co.uk/debt-collection-agency-london/","status":"found","error":null}
```

If the page has no declared `Service`, one row is emitted with `businessName`, `serviceName`, `serviceType`, and `description` all `null`, `sourceUrl` set, `status:"not_found"`, and an informative `error` string.

### Honest limits

- **No service guessing** from headings, navigation, prose, product offers, page titles, or catalog names; a `Service` node must explicitly exist in embedded JSON-LD. Does not read visible text, Microdata, RDFa, externally linked JSON-LD or other pages.
- Site-authored JSON-LD is self-declared and **not proof** a service is currently offered. Data may be incomplete, outdated, duplicated, or malformed. Duplicate same-name/type/description declarations within a page are coalesced.
- `@graph` / `@id` in-page links and nested offer catalogs are supported. If no provider name is explicitly linked, `businessName` is `null` (never inferred from the domain).
- Only recognized Schema.org `Service` types are eligible; exotic unlisted service subtypes may be missed. Long descriptions are clipped to 300 characters without generating summaries.
- No cross-domain redirects, login, JS rendering, or crawling. Enforces HTTPS and public IPs, robots.txt, TLS validation, a 12-second network timeout and 2 MB HTML limit.
- Public sites may block bots or omit JSON-LD. Failures produce a plain `ERROR:` line without a traceback. The Actor never extracts contact details or personal data.

### Local and Apify use

Python 3.12+ standard library exclusively; `requirements.txt` is intentionally empty of dependencies.

```bash
ACTOR_INPUT_JSON='{"url":"https://firstcapitol.co.uk/debt-collection-agency-london/"}' python src/main.py
```

Alternatively put the same object in `storage/key_value_stores/default/INPUT.json`. Local results: `storage/datasets/default/000000001.json`, etc. For Apify, input is read using `APIFY_DEFAULT_KEY_VALUE_STORE_ID` + `APIFY_TOKEN` and `GET /v2/key-value-stores/{id}/records/INPUT`; dataset records are written to `APIFY_DEFAULT_DATASET_ID` via `POST /v2/datasets/{id}/items`. `ACTOR_INPUT_JSON` takes precedence for local tests. Live Apify platform operation was not tested; API behavior was verified with a fixture.

### Tests and actual script-mode output

```bash
python tests/run_direct_smoke.py
python -m unittest discover -s tests -v
```

The direct runner executes the actual `src/main.py` script in a subprocess, not an imported `main()` function, using a valid URL and a **simulated** offline response. Evidence in `tests/SMOKE_OUTPUT.txt`, dataset in `tests/SMOKE_DATASET.json`, full unittest output in `tests/TEST_RUN_OUTPUT.txt`. The fixture file `tests/sitecustomize.py` is test-only and activated with `ACTOR_TEST_HTTP=1` + test `PYTHONPATH`; production never uses it.

### Store category and price suggestion

Candidates: `LEAD_GENERATION`, `DATA_EXTRACTION`. Suggested pricing: **$3 per 1,000 dataset items** ($0.003 each), model `PRICE_PER_DATASET_ITEM`. This is a planning suggestion, **not** deployed billing. Before any future billing activation, decide whether not-found rows should be charged.

# Actor input Schema

## `url` (type: `string`):

One public HTTPS URL for a page on a business website. No login or scraping of other pages.

## Actor input object example

```json
{
  "url": "https://firstcapitol.co.uk/debt-collection-agency-london/"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing the Actor's result items

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "url": "https://firstcapitol.co.uk/debt-collection-agency-london/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("eichan/business-service-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "url": "https://firstcapitol.co.uk/debt-collection-agency-london/" }

# Run the Actor and wait for it to finish
run = client.actor("eichan/business-service-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://firstcapitol.co.uk/debt-collection-agency-london/"
}' |
apify call eichan/business-service-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eichan/business-service-extractor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Gb2KdxpcvASCUbMLo/builds/kZ4w5gBl2hEV0pe9V/openapi.json
