# Local Schema Generator (`alizarin_refrigerator-owner/local-schema-generator`) Actor

Generate Schema.org JSON-LD structured data to improve search visibility & enable rich results. Structured data helps search engines understand your business. Stars, hours & contact info in search results, improved business information display, better answers for voice assistants, enhanced local SEO

- **URL**: https://apify.com/alizarin_refrigerator-owner/local-schema-generator.md
- **Developed by:** [The Howlers](https://apify.com/alizarin_refrigerator-owner) (community)
- **Categories:** SEO tools, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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

## Local Schema Generator v1.0

Generate Schema.org JSON-LD structured data for local businesses. Boost your local SEO with proper structured data markup.

Note: Demo Mode is off by default, so runs fetch real data. Set demoMode to true to get free sample data instead.

***

### Quick Start

#### Test with Demo Mode (free, no API key needed)

```json
{
  "demoMode": true,
  "businessName": "John's Plumbing & HVAC",
  "businessType": "Plumber",
  "streetAddress": "123 Main Street",
  "city": "Dallas",
  "state": "TX",
  "zipCode": "75001",
  "phone": "(214) 555-1234",
  "hours": {
    "monday": "8am-6pm",
    "tuesday": "8am-6pm",
    "wednesday": "8am-6pm",
    "thursday": "8am-6pm",
    "friday": "8am-6pm",
    "saturday": "9am-2pm",
    "sunday": "closed"
  },
  "aggregateRating": {
    "ratingValue": 4.8,
    "reviewCount": 127
  },
  "logoUrl": "https://example.com",
  "imageUrl": "https://example.com",
  "facebookUrl": "https://example.com",
  "twitterUrl": "https://example.com",
  "instagramUrl": "https://example.com",
  "linkedinUrl": "https://example.com",
  "yelpUrl": "https://example.com"
}
```

#### Run with real data

```json
{
  "demoMode": false,
  "businessName": "John's Plumbing & HVAC",
  "businessType": "Plumber",
  "streetAddress": "123 Main Street",
  "city": "Dallas",
  "state": "TX",
  "zipCode": "75001",
  "country": "US",
  "phone": "(214) 555-1234",
  "hours": {
    "monday": "8am-6pm",
    "tuesday": "8am-6pm",
    "wednesday": "8am-6pm",
    "thursday": "8am-6pm",
    "friday": "8am-6pm",
    "saturday": "9am-2pm",
    "sunday": "closed"
  },
  "aggregateRating": {
    "ratingValue": 4.8,
    "reviewCount": 127
  },
  "logoUrl": "https://example.com",
  "imageUrl": "https://example.com",
  "facebookUrl": "https://example.com",
  "twitterUrl": "https://example.com",
  "instagramUrl": "https://example.com",
  "linkedinUrl": "https://example.com",
  "yelpUrl": "https://example.com",
  "includeOrganization": true,
  "includeLocalBusiness": true,
  "includeWebSite": true,
  "includeBreadcrumb": false,
  "includeFAQPage": false,
  "includeService": false,
  "outputFormat": "both",
  "minify": false
}
```

***

### Input Parameters

| Parameter | Type | Default | Required | Description |
|-----------|------|---------|----------|-------------|
| `businessName` | string | - | No | Your official business name |
| `businessType` | string | - | No | Type of business (e.g., 'Plumber', 'Restaurant', 'Dentist') - auto-mapped to schema.org type |
| `streetAddress` | string | - | No | Business street address |
| `city` | string | - | No | City name |
| `state` | string | - | No | State/region code |
| `zipCode` | string | - | No | ZIP or postal code |
| `country` | string | `"US"` | No | Country code (default: US) |
| `phone` | string | - | No | Primary business phone |
| `website` | string | - | No | Your business website |
| `email` | string | - | No | Business email address |
| `description` | string | - | No | Brief description of your business (recommended: 150-300 characters) |
| `latitude` | number | - | No | GPS latitude coordinate |
| `longitude` | number | - | No | GPS longitude coordinate |
| `hours` | object | - | No | Operating hours for each day (e.g., '9am-5pm' or '09:00-17:00') |
| `priceRange` | string | - | No | Price range indicator (e.g., '$', '$$', '$$$') |
| `aggregateRating` | object | - | No | Overall business rating |
| `logoUrl` | string | - | No | URL to your business logo (min 112x112px) |
| `imageUrl` | string | - | No | URL to your main business image |
| `facebookUrl` | string | - | No | Facebook business page URL |
| `twitterUrl` | string | - | No | Twitter/X profile URL |
| `instagramUrl` | string | - | No | Instagram profile URL |
| `linkedinUrl` | string | - | No | LinkedIn company page URL |
| `yelpUrl` | string | - | No | Yelp business page URL |
| `includeOrganization` | boolean | `true` | No | Generate Organization schema in addition to LocalBusiness |
| `includeLocalBusiness` | boolean | `true` | No | Generate LocalBusiness schema (recommended) |
| `includeWebSite` | boolean | `true` | No | Generate WebSite schema with search action |
| `includeBreadcrumb` | boolean | `false` | No | Generate BreadcrumbList schema |
| `includeFAQPage` | boolean | `false` | No | Generate FAQPage schema (requires FAQs) |
| `faqs` | array | - | No | Questions and answers for FAQ schema |
| `includeService` | boolean | `false` | No | Generate Service/OfferCatalog schema (requires services) |
| `services` | array | - | No | List of services for Service schema |
| `outputFormat` | string | `"both"` | No | How to format the output |
| `minify` | boolean | `false` | No | Remove whitespace from JSON output |
| `demoMode` | boolean | `false` | No | Run in demo mode without real credentials. Returns mock success response for testing. |
| `webhookUrl` | string | - | No | Optional URL to receive results via POST request when actor completes |

***

### Pricing

This actor uses **pay-per-event** billing:

| Event | When it is charged | Price |
|-------|--------------------|-------|
| Actor start | Once when the run starts, one event per GB of memory (minimum one). At the default 4 GB of memory a run starts at $0.40 | $0.10 per GB |
| Schema Generated | Per schema generated | $0.05 |
| Result | Each item written to the default dataset | $0.00001 |

**Demo mode is free** -- no charges for sample data.

***

### Troubleshooting

#### "API error 429" or "Rate limit"

Too many requests. Wait a minute and try again, or reduce the number of items per run.

#### No results or empty dataset

Check the run log for error messages. Common causes:

- Invalid input format (check the examples above)
- The target data doesn't exist or is too small to track

#### How do I test without an API key?

Enable **Demo Mode** in the input. This returns realistic sample data so you can verify the output format works for your workflow.

***

**Built by John Rippy | [Actor Arsenal](https://actorarsenal.com)**

# Actor input Schema

## `businessName` (type: `string`):

Your official business name

## `businessType` (type: `string`):

Type of business (e.g., 'Plumber', 'Restaurant', 'Dentist') - auto-mapped to schema.org type

## `streetAddress` (type: `string`):

Business street address

## `city` (type: `string`):

City name

## `state` (type: `string`):

State/region code

## `zipCode` (type: `string`):

ZIP or postal code

## `country` (type: `string`):

Country code (default: US)

## `phone` (type: `string`):

Primary business phone

## `website` (type: `string`):

Your business website

## `email` (type: `string`):

Business email address

## `description` (type: `string`):

Brief description of your business (recommended: 150-300 characters)

## `latitude` (type: `number`):

GPS latitude coordinate

## `longitude` (type: `number`):

GPS longitude coordinate

## `hours` (type: `object`):

Operating hours for each day (e.g., '9am-5pm' or '09:00-17:00')

## `priceRange` (type: `string`):

Price range indicator (e.g., '$', '$$', '$$$')

## `aggregateRating` (type: `object`):

Overall business rating

## `logoUrl` (type: `string`):

URL to your business logo (min 112x112px)

## `imageUrl` (type: `string`):

URL to your main business image

## `facebookUrl` (type: `string`):

Facebook business page URL

## `twitterUrl` (type: `string`):

Twitter/X profile URL

## `instagramUrl` (type: `string`):

Instagram profile URL

## `linkedinUrl` (type: `string`):

LinkedIn company page URL

## `yelpUrl` (type: `string`):

Yelp business page URL

## `includeOrganization` (type: `boolean`):

Generate Organization schema in addition to LocalBusiness

## `includeLocalBusiness` (type: `boolean`):

Generate LocalBusiness schema (recommended)

## `includeWebSite` (type: `boolean`):

Generate WebSite schema with search action

## `includeBreadcrumb` (type: `boolean`):

Generate BreadcrumbList schema

## `includeFAQPage` (type: `boolean`):

Generate FAQPage schema (requires FAQs)

## `faqs` (type: `array`):

Questions and answers for FAQ schema

## `includeService` (type: `boolean`):

Generate Service/OfferCatalog schema (requires services)

## `services` (type: `array`):

List of services for Service schema

## `outputFormat` (type: `string`):

How to format the output

## `minify` (type: `boolean`):

Remove whitespace from JSON output

## `demoMode` (type: `boolean`):

Run in demo mode without real credentials. Returns mock success response for testing.

## `webhookUrl` (type: `string`):

Optional URL to receive results via POST request when actor completes

## Actor input object example

```json
{
  "businessName": "John's Plumbing & HVAC",
  "businessType": "Plumber",
  "streetAddress": "123 Main Street",
  "city": "Dallas",
  "state": "TX",
  "zipCode": "75001",
  "country": "US",
  "phone": "(214) 555-1234",
  "hours": {
    "monday": "8am-6pm",
    "tuesday": "8am-6pm",
    "wednesday": "8am-6pm",
    "thursday": "8am-6pm",
    "friday": "8am-6pm",
    "saturday": "9am-2pm",
    "sunday": "closed"
  },
  "aggregateRating": {
    "ratingValue": 4.8,
    "reviewCount": 127
  },
  "includeOrganization": true,
  "includeLocalBusiness": true,
  "includeWebSite": true,
  "includeBreadcrumb": false,
  "includeFAQPage": false,
  "includeService": false,
  "outputFormat": "both",
  "minify": false,
  "demoMode": false
}
```

# Actor output Schema

## `results` (type: `string`):

Generated JSON-LD structured data schema markup for local businesses, ready to embed on a website.

# 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 = {
    "businessName": "John's Plumbing & HVAC",
    "businessType": "Plumber",
    "streetAddress": "123 Main Street",
    "city": "Dallas",
    "state": "TX",
    "zipCode": "75001",
    "phone": "(214) 555-1234",
    "hours": {
        "monday": "8am-6pm",
        "tuesday": "8am-6pm",
        "wednesday": "8am-6pm",
        "thursday": "8am-6pm",
        "friday": "8am-6pm",
        "saturday": "9am-2pm",
        "sunday": "closed"
    },
    "aggregateRating": {
        "ratingValue": 4.8,
        "reviewCount": 127
    },
    "demoMode": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("alizarin_refrigerator-owner/local-schema-generator").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 = {
    "businessName": "John's Plumbing & HVAC",
    "businessType": "Plumber",
    "streetAddress": "123 Main Street",
    "city": "Dallas",
    "state": "TX",
    "zipCode": "75001",
    "phone": "(214) 555-1234",
    "hours": {
        "monday": "8am-6pm",
        "tuesday": "8am-6pm",
        "wednesday": "8am-6pm",
        "thursday": "8am-6pm",
        "friday": "8am-6pm",
        "saturday": "9am-2pm",
        "sunday": "closed",
    },
    "aggregateRating": {
        "ratingValue": 4.8,
        "reviewCount": 127,
    },
    "demoMode": False,
}

# Run the Actor and wait for it to finish
run = client.actor("alizarin_refrigerator-owner/local-schema-generator").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 '{
  "businessName": "John'\''s Plumbing & HVAC",
  "businessType": "Plumber",
  "streetAddress": "123 Main Street",
  "city": "Dallas",
  "state": "TX",
  "zipCode": "75001",
  "phone": "(214) 555-1234",
  "hours": {
    "monday": "8am-6pm",
    "tuesday": "8am-6pm",
    "wednesday": "8am-6pm",
    "thursday": "8am-6pm",
    "friday": "8am-6pm",
    "saturday": "9am-2pm",
    "sunday": "closed"
  },
  "aggregateRating": {
    "ratingValue": 4.8,
    "reviewCount": 127
  },
  "demoMode": false
}' |
apify call alizarin_refrigerator-owner/local-schema-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alizarin_refrigerator-owner/local-schema-generator"
        }
    }
}
```

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/P0r6xaQ6JHNFE0pFl/builds/4v4O39rSKGGjYtY3S/openapi.json
