Create a monitor
Beta POST /v1/monitors
POST /v1/monitors
Watch a list endpoint (a profile's posts, a search) and receive new items at a webhook.
- Cost: Free
- Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
- Cache: Not cached.
Parameters#
| Name | Type | Required | Description | In |
|---|---|---|---|---|
endpoint | string | yes | Path of a list endpoint, "/v1/tiktok/profile/videos". | body |
params | object | yes | That endpoint's params. | body |
interval_minutes | integer | no | How often to check. Default 60. Range 15 to 1440. | body |
webhook_url | string | yes | HTTPS URL that receives events. | body |
Example request#
Set your key in the environment first (see Authentication).
curl
curl -X POST "https://api.socialscrape.io/v1/monitors" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
-H "content-type: application/json" \
-d '{"endpoint":"/v1/github/user/repositories","params":{"handle":"torvalds"},"interval_minutes":60,"webhook_url":"https://example.com/hook"}'Python
import os
import requests
payload = {
"endpoint": "/v1/github/user/repositories",
"params": {
"handle": "torvalds",
},
"interval_minutes": 60,
"webhook_url": "https://example.com/hook",
}
res = requests.post(
"https://api.socialscrape.io/v1/monitors",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
json=payload,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])TypeScript
const res = await fetch("https://api.socialscrape.io/v1/monitors", {
method: "POST",
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY!, "content-type": "application/json" },
body: JSON.stringify({"endpoint": "/v1/github/user/repositories", "params": {"handle": "torvalds"}, "interval_minutes": 60, "webhook_url": "https://example.com/hook"}),
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}Example response#
This is a sample with illustrative values. Status 200.
{
"ok": true,
"credits_charged": 0,
"credits_remaining": 5000,
"cached": false,
"cached_at": null,
"request_id": "req_2aebbb49c25ee0daa5da5dd5",
"data": {
"object": "monitor",
"id": "mon_0123456789abcdef",
"endpoint": "/v1/github/user/repositories",
"params": {
"handle": "torvalds"
},
"interval_minutes": 60,
"webhook_url": "https://example.com/hook",
"active": true,
"created_at": "2026-10-29T14:00:00Z",
"webhook_secret": "whsec_sample_secret_shown_once",
"last_run_at": null,
"next_run_at": "2026-10-29T14:00:00Z",
"last_error": null
},
"cursor": null,
"has_more": null
}Response#
A Monitor object in data.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
Every request can also fail with the account and platform errors listed on the Errors page.
Related endpoints#
- List monitors (
GET /v1/monitors) - Delete a monitor (
DELETE /v1/monitors/{monitor_id}) - Send a test event (
POST /v1/monitors/{monitor_id}/test) - Webhook delivery log (
GET /v1/monitors/{monitor_id}/deliveries) - Send an event again (
POST /v1/monitors/events/{event_id}/redeliver) - Monitor events (
GET /v1/monitors/events)