Scout · Endpoints

Templates

Save extract field presets and reuse them with template_id (or slug) on POST /v1/extract. Template management costs 0 credits.

Templates are per API key ownership in Scout’s template store. Use them when the same selectors run across many URLs (product pages, blog posts). They are not a marketplace of site-specific scrapers — just your saved field lists.

hostname is organizational only
Optional hostname is a label for your own list (so you can remember “this template is for shop.example.com”). It is purely cosmetic — it does not trigger, require, or interact with domain verify. Sensitive ops still need a separately verified domain.

CRUD

GET/v1/templatesAPI key

List templates for this key. 0 credits.

POST/v1/templatesAPI key

Create a template. 0 credits.

NameTypeRequiredDescription
namestringrequiredDisplay name (max 120).
slugstringoptionalOptional stable slug for template_id.
descriptionstringoptionalShort note (max 500).
hostnamestringoptionalOptional label for organization only — not domain verify.
fieldsarrayrequired1–50 extract field definitions.
bash
curl -X POST https://scout.macrocontent.dev/v1/templates \
  -H "Authorization: Bearer sk_scout_…" \
  -H "Content-Type: application/json" \
  -d @template.json
json
{
  "name": "Product page",
  "slug": "product-page",
  "hostname": "shop.example.com",
  "fields": [
    { "name": "title", "selector": "h1", "type": "text" },
    { "name": "price", "selector": "[data-price]", "type": "text" }
  ]
}
GET/v1/templates/:idOrSlugAPI key

Fetch one template by id or slug. 0 credits.

PATCH/v1/templates/:idAPI key

Update fields / metadata. 0 credits.

DELETE/v1/templates/:idAPI key

Delete template. 0 credits.

Use in extract

json
{
  "url": "https://shop.example.com/product/1",
  "template_id": "product-page"
}

Field schema matches extract (exists, text, html, attribute, count, list).