Skip to content

Content Monitoring

Content monitoring lets you discover and index social media posts and videos into your agent’s knowledge base. Start a one-time scrape or set up ongoing monitoring across TikTok, Instagram, and YouTube. Scraped content trains the agent’s understanding of trends, engagement patterns, and creator activity.

Not all platforms support all search types:

PlatformUsernameHashtagKeyword
TikTokYesYesYes
InstagramYesYesNo
YouTubeYesYesYes
ItemCost
Per video/post scraped$0.015
Per comment (when comment monitoring is enabled)$0.002

Costs are converted to credits using the standard credit formula.


Starts a social media content scrape or monitoring job. For one-time scrapes, the job transitions to completed after processing. For ongoing monitoring, the job stays in processing and scrapes on a recurring schedule.

POST /v1/user_jobs?agent_id={agent_id}
ParameterTypeRequiredDescription
agent_idstringYesThe agent ID (query parameter).
user_job[user_job_type]stringYesMust be "train_social".
user_job[data]string (JSON)YesJSON-stringified object containing the monitoring configuration (see Data fields below).

The user_job[data] value is a JSON string containing:

FieldTypeRequiredDescription
platformstringYesTarget platform: tiktok, instagram, or youtube.
typestringYesSearch type: username, hashtag, or keyword. Must be supported by the chosen platform (see table above).
valuestringYesThe search value. Usernames must start with @ (e.g. @creator). Hashtags must start with # (e.g. #skincare). Keywords are plain text.
daysintegerNoFilter to content from the last N days. One of: 0 (no filter), 1, 7, 30, 90, 180.
countrystringNoTwo-letter country code (e.g. us, gb) to filter by region.
max_resultsintegerNoMaximum number of results to fetch per scrape (1–50).
monitoringbooleanNofalse (default) for a one-time scrape that completes after processing. true for ongoing scheduled monitoring.
comment_monitoringbooleanNotrue to also scrape comments (adds per-comment cost). Default false.
{
"user_job_id": 12345
}
StatusDescription
pendingJob created, queued for processing.
processingScraping in progress. For monitoring jobs, stays here between scrape cycles.
completedOne-time scrape finished (only when monitoring is false).
failedScrape failed. Check failed_reason on the job.

Poll status via GET /v1/user_jobs/{id}?agent_id={agent_id}.

Terminal window
curl -X POST "https://api.gen.pro/v1/user_jobs?agent_id=your-agent-id" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: multipart/form-data" \
-F 'user_job[user_job_type]=train_social' \
-F 'user_job[data]={"platform":"instagram","type":"username","value":"@fashionbrand","days":30,"max_results":50,"monitoring":true}'
Terminal window
curl -X POST "https://api.gen.pro/v1/user_jobs?agent_id=your-agent-id" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: multipart/form-data" \
-F 'user_job[user_job_type]=train_social' \
-F 'user_job[data]={"platform":"youtube","type":"hashtag","value":"#cooking","max_results":50,"monitoring":false}'

Example: TikTok keyword search with comments

Section titled “Example: TikTok keyword search with comments”
Terminal window
curl -X POST "https://api.gen.pro/v1/user_jobs?agent_id=your-agent-id" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: multipart/form-data" \
-F 'user_job[user_job_type]=train_social' \
-F 'user_job[data]={"platform":"tiktok","type":"keyword","value":"ai tools","days":7,"country":"us","monitoring":true,"comment_monitoring":true}'
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403permission_deniedYou do not have access to this agent.
422validation_errorInvalid platform, type, value format, or unsupported platform/type combination.
422no_active_credit_purchaseThe agent’s workspace has no active credit purchase.

Updates the configuration of an existing monitoring job. Only jobs with pending or processing status can be updated.

PUT /v1/user_jobs/{id}?agent_id={agent_id}
ParameterTypeRequiredDescription
idintegerYesThe user job ID (path parameter).
agent_idstringYesThe agent ID (query parameter).
platformstringNoTarget platform: tiktok, instagram, or youtube.
typestringNoSearch type: username, hashtag, or keyword.
valuestringNoThe search value.
daysintegerNoLookback window. One of: 0, 1, 7, 30, 90, 180.
countrystringNoTwo-letter country code.
max_resultsintegerNoMaximum results per scrape (1–50).
monitoringbooleanNotrue for ongoing monitoring, false for one-time.
comment_monitoringbooleanNotrue to also scrape comments.
{
"user_job_id": 12345
}
Terminal window
curl -X PUT "https://api.gen.pro/v1/user_jobs/12345?agent_id=your-agent-id" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: multipart/form-data" \
-F 'platform=instagram' \
-F 'type=username' \
-F 'value=@fashionbrand' \
-F 'days=7' \
-F 'max_results=50' \
-F 'monitoring=true'
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403permission_deniedYou do not have access to this agent.
404user_job_not_foundNo monitoring job exists with the given ID for this agent.
422job_status_invalidCan only update jobs with pending or processing status.
422validation_errorInvalid data fields.