Skip to main content

Strategy Groups

A strategy group is an organizational layer above individual strategies. It lets you manage many strategies as a single unit — applying schedules, output schemas, and webhooks to all members at once.

When to use strategy groups

Use strategy groups when:
  • You monitor many URLs with similar extraction needs (e.g., 50 product pages)
  • You want a single schedule and webhook for all strategies in a batch
  • You need to apply or change an output schema across many strategies at once
  • You create strategies via Bulk Upload and want to keep them organized
Use individual strategies when:
  • You have a handful of unrelated strategies
  • Each strategy needs its own schedule or webhook configuration

How they work

A strategy group provides:
  • Group-level scheduling — Apply a single schedule configuration (interval or cron, webhook URL, webhook type) to every strategy in the group. Each strategy gets its own schedule instance, but they share the same configuration.
  • Group-level output schemas — Apply an output schema to all strategies at once. Meter regenerates each strategy asynchronously to match the new schema.
  • Bulk management — Enable/disable all schedules, delete all schedules, or test webhooks for the whole group in one call.

Creating and managing groups

Create a group

from meter_sdk import MeterClient

client = MeterClient(api_key="sk_live_...")

group = client.create_strategy_group(
    name="E-commerce Monitors",
    description="Product price tracking across 50 stores"
)

print(f"Group ID: {group['id']}")

Add strategies to a group

client.add_strategies_to_group(
    group_id=group["id"],
    strategy_ids=[
        "550e8400-e29b-41d4-a716-446655440000",
        "660e8400-e29b-41d4-a716-446655440000"
    ]
)

Remove a strategy from a group

Removing a strategy from a group does not delete the strategy — it just becomes ungrouped.
client.remove_strategy_from_group(
    group_id=group["id"],
    strategy_id="550e8400-e29b-41d4-a716-446655440000"
)

List and inspect groups

# List all groups
groups = client.list_strategy_groups()
for g in groups:
    print(f"{g['name']}: {g['strategy_count']} strategies")

# Get group details with member strategies
detail = client.get_strategy_group(group["id"])
for strategy in detail["strategies"]:
    print(f"  - {strategy['name']}")

Group scheduling

Apply a schedule to every strategy in the group with a single call. Each strategy gets its own schedule instance with the same configuration.
# Schedule all strategies to run every hour with a webhook
client.apply_group_schedule(
    group_id=group["id"],
    interval_seconds=3600,
    webhook_url="https://your-app.com/webhooks/meter"
)

# Or use a cron expression
client.apply_group_schedule(
    group_id=group["id"],
    cron_expression="0 */6 * * *",  # Every 6 hours
    webhook_url="https://hooks.slack.com/services/T.../B.../xxx"
    # webhook_type auto-detected as "slack"
)

Manage group schedules

# Pause all schedules in the group
client.toggle_group_schedules(group["id"], enabled=False)

# Resume all schedules
client.toggle_group_schedules(group["id"], enabled=True)

# Delete all schedules in the group
client.delete_group_schedules(group["id"])
Provide either interval_seconds or cron_expression, not both. The minimum interval is 60 seconds.

Group output schemas

Apply an output schema to every strategy in a group. Meter regenerates each strategy asynchronously to match the schema structure.
# Apply a product schema to all strategies in the group
client.apply_group_schema(
    group_id=group["id"],
    output_schema={
        "product_name": "string",
        "price": "number",
        "in_stock": "boolean",
        "image_url": "string"
    }
)

# Poll for regeneration progress
progress = client.get_schema_progress(group["id"])
print(progress)
See Output Schemas for details on schema definition and type support.

Deleting a group

Deleting a group does not delete the strategies inside it. They become ungrouped.
client.delete_strategy_group(group["id"])

Next steps

Output Schemas

Define the exact JSON structure for extraction results

Bulk Upload

Create many strategies at once with bulk upload

Strategy Group API

Full REST API reference for strategy groups

Python SDK

Strategy group methods in the Python SDK

Need help?

Email me at mckinnon@meter.sh