Scheduled Collection & Keyword Monitoring

Open Keyword monitoring in the customer console to subscribe to keywords and fetch new content from source platforms periodically. This is separate from a data-access subscription. Select an application, platform, keyword, interval and item ceiling (optionally a language and region) to create a monitoring subscription. Keywords can be pasted in bulk (one per line or comma-separated, up to 50 at a time); the console creates one subscription per keyword and skips keywords the platform already monitors. This screen uses your portal session without creating another API key. Organization owners and administrators may create, pause and resume; other authorized members have read-only access.

When you need new content from a platform user or channel on an ongoing basis, create a recurring collection subscription. Whale dispatches collection tasks at the interval you set, the results are written to the data center, and you read them with search, browse by user or topic, or change sync.

resource_kindWhat is synchronizedTask type
keywordSearch for new content periodically using a keyword or search expressionkeyword_search
userA platform user’s identity, public profile and public contentuser_sync
channelA channel, topic, hashtag, RSS/feed or other public streamchannel_sync

To read profiles or content that have already been collected, use Users, Topics, Tags & Categories directly; no subscription is needed.

Prerequisites

  • WHALE_BASE_URL and WHALE_API_KEY are configured as in Get & Use an API Key, and you have curl and jq.
  • Applications with no access-policy history inherit all platforms and recurring collection from the platform default. Once Whale saves an explicit policy, it must include the target platform and enable collection_subscription_enabled; otherwise creation returns 403.
  • Where collected content is stored is managed by the platform. Do not send dataset_id; a request that does gets 400 dataset_id_not_allowed.
  • The target platform needs an online collector that supports the task type; otherwise creation returns 403.

Create a Subscription

Collect a Weibo keyword hourly, at most 100 items per run:

Bash
curl -sS --fail-with-body -X POST "$WHALE_BASE_URL/v1/collection/subscriptions" \
  -H "Authorization: Bearer $WHALE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "OpenAI monitoring",
    "source_platform": "weibo",
    "resource_kind": "keyword",
    "keyword": "OpenAI",
    "interval_seconds": 3600,
    "max_items": 100
  }'

Keyword monitoring is incremental: the first run collects content from the last interval, and each later run continues from the last successful position. Time ranges are not supported. After a pause, a resumed subscription catches up at most 7 days. For older content, first run a live query with a publish-time window (at most 7 days), then create the monitor.

One subscription targets one platform and one keyword expression. Create separate subscriptions for multiple platforms or expressions. Keywords contain 1–200 characters; max_items is required, from 1 to 1000. This is an upper bound, not a promise of a full result set or an increase to a collector’s native limit. Optional language and region are collection hints and never expand access. Keyword subscriptions support only incremental mode, which is the default.

Each application has a ceiling on active keyword subscriptions, 100 by default; contact us to change it. Creation or resume at the ceiling returns 409 with code keyword_subscription_limit_reached; pause an unused subscription first. This limit is separate from API request rate limits.

The platform needs an online collector that actually implements and declares keyword_search. A collector supporting only live_query is not automatically compatible. If creation reports no capable collector, ask the collector owner to implement the task contract rather than merely changing the declaration.

Synchronize a YouTube user every hour:

Bash
subscription_response="$(curl -sS --fail-with-body -X POST "$WHALE_BASE_URL/v1/collection/subscriptions" \
  -H "Authorization: Bearer $WHALE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "youtube-creator-watch",
    "source_platform": "youtube",
    "resource_kind": "user",
    "user_id": "channel_123",
    "interval_seconds": 3600
  }')"
printf '%s' "$subscription_response" | jq .
SUBSCRIPTION_ID="$(printf '%s' "$subscription_response" | jq -er '.subscription.id')"

To synchronize a Weibo topic every 15 minutes, use this body instead:

JSON
{
  "source_platform": "weibo",
  "resource_kind": "channel",
  "topic": "ai-agent",
  "interval_seconds": 900
}
FieldRequiredDescription
source_platformYesPlatform enum; must be explicitly granted in your subscription. See Platform Coverage
resource_kindYeskeyword, user or channel
keywordConditionalRequired for keyword, 1–200 characters
user_id / user_urlConditionalFor user, at least one: platform user ID or profile URL
channel_id / channel_url / topicConditionalFor channel, at least one: channel ID, channel URL or topic/hashtag
interval_secondsYesRun interval, 60–604800 seconds (1 minute to 7 days)
nameNoA recognizable name
sync_modeNoall_content: the first run backfills all visible content, then switches to incremental after success. incremental: continue from the last successful position and fetch only new content. Defaults: all_content for user, incremental for channel
max_itemsConditionalRequired for keyword subscriptions, 1–1000; optional for user/channel subscriptions
next_run_atNoFirst run time, RFC 3339; runs as soon as possible when omitted
max_attemptsNoMaximum attempts for a failed run, default 3

A successful request returns 201:

JSON
{
  "subscription": {
    "id": "cspec_01K...",
    "source_platform": "youtube",
    "resource_kind": "user",
    "task_type": "user_sync",
    "payload": {"resource_kind": "user", "sync_mode": "all_content", "user_id": "channel_123"},
    "interval_seconds": 3600,
    "status": "active",
    "next_run_at": "2026-10-14T09:00:00Z",
    "created_at": "2026-10-14T08:00:00Z"
  }
}

Use subscription.id with every later call.

List Subscriptions and Runs

List your application’s subscriptions (limit 1–200, default 50):

Bash
curl -sS --fail-with-body "$WHALE_BASE_URL/v1/collection/subscriptions?limit=50" \
  -H "Authorization: Bearer $WHALE_API_KEY" | jq '.subscriptions[] | {id, status, next_run_at, last_run_at}'

When due and eligible for dispatch, a subscription creates an independent collection task. View its run history, optionally filtered by status:

Bash
curl -sS --fail-with-body "$WHALE_BASE_URL/v1/collection/subscriptions/$SUBSCRIPTION_ID/tasks?limit=20" \
  -H "Authorization: Bearer $WHALE_API_KEY" | jq '.tasks[] | {id, status, attempt_count, last_error, result, updated_at}'
Task statusMeaning
pendingDispatched, waiting for a collector
leased / runningA collector has claimed and is running it
succeededThe run finished; result holds collection statistics
failed / timeoutThe run failed or timed out; last_error explains why. It is retried until max_attempts
paused / canceledPaused or cancelled

Only checkpoints from succeeded tasks advance the sync position. Failed or timed-out runs do not commit a new position; subsequent runs reuse the last successful checkpoint.

New runs are deferred while a subscription has a pending, leased, running or paused task. Missed intervals are coalesced instead of replayed one by one. Offline collectors do not block other subscriptions. Access is checked again before dispatch; explicit loss of authorization pauses the subscription. Restore access and resume manually.

Keyword collection starts one interval before creation, with since and until on each task. A successful checkpoint restores the cursor; a high_watermark advances the lower bound with a 60-second overlap. Without a watermark, the initial lower bound is retained and repeated scanning may occur. Collectors must fully scan the window before committing a safe watermark; reaching max_items does not imply the window is complete. Source availability, upstream limits and collector implementation affect coverage, so zero source-content loss is not guaranteed.

This version supports creation, listing, run history, pause and resume. To change a keyword or interval, pause the old subscription and create another. It does not allow customers to delete ingested historical data.

A successful task means collection finished; content is then ingested and indexed asynchronously and may appear slightly later. Use Synchronize Data Changes to read by change instead of reconciling task by task.

Pause and Resume

Pausing only stops future dispatches; it does not interrupt a running task:

Bash
curl -sS --fail-with-body -X POST "$WHALE_BASE_URL/v1/collection/subscriptions/$SUBSCRIPTION_ID/pause" \
  -H "Authorization: Bearer $WHALE_API_KEY" | jq '.subscription.status'
 
curl -sS --fail-with-body -X POST "$WHALE_BASE_URL/v1/collection/subscriptions/$SUBSCRIPTION_ID/resume" \
  -H "Authorization: Bearer $WHALE_API_KEY" | jq '.subscription.status'

Subscription status is active, paused or disabled. disabled means Whale has deactivated the subscription; you cannot resume it yourself, so contact your organization administrator.

Billing, Rate Limits and Errors

Each call to the subscription API is metered as one request and charged at your organization’s pricing; failed requests are refunded. Requests share your application’s rate limit.

HTTPcodeMeaning and action
400invalid_jsonThe body is not valid JSON
400collection_request_failedValidation failed, such as a missing user or channel identifier or interval_seconds out of range; fix per message
400dataset_id_not_allowedThe request sent dataset_id; remove it
401unauthorizedThe API key is invalid
402credit_insufficientYour organization’s credit balance is insufficient
403collection_request_failedRecurring collection is not enabled, the platform is not explicitly granted, or no collector is available for the platform
404collection_request_failedThe subscription does not exist or belongs to another application
409collection_request_failedActive keyword subscription ceiling reached; pause another subscription first
409platform_dataset_route_missingMonitoring is not yet available for the platform; contact the platform administrator
429rate_limit_exceededRate limited; back off per Retry-After
503collection_request_failedTemporarily unavailable; retry later

See the public API reference for every field.