Cookbooks
Get only the new comments under your posts, sent to a webhook
Get comments since your last check on an account's posts, then let a Monitor send new ones to your webhook
Send a profile link and a time, and get back the comments left under its recent posts since then. Posts with no new comment cost nothing. A Monitor then runs the same read every hour and sends only the comments it has never sent before.
Measured on 23/11/2026: a 3-hour check on the five newest posts of National Geographic on Instagram found 48 new comments for 36 credits. A 2-minute check found 1 new comment for 6 credits.
Start in five minutes
Set your key once. Every block on this page reads it.
export SOCIALCRAWL_API_KEY=YOUR_API_KEYPaste this prompt into your coding agent:
Read https://www.socialcrawl.dev/docs/recipes/new-comments-to-a-webhook.md and follow it to watch the comments under the five newest posts of https://www.instagram.com/natgeo/. Use the key in SOCIALCRAWL_API_KEY. Price the read with a dry run first and show me the hold. Then price the hourly Monitor with a dry run and show me estimated_cost_per_run. Ask me before you create it, and send max_credits_per_month with the cap I agree to.Or price the read yourself. A dry run quotes it for 0 credits:
curl -G "https://www.socialcrawl.dev/v1/prism/profile/comments" \
-H "x-api-key: $SOCIALCRAWL_API_KEY" \
--data-urlencode "url=https://www.instagram.com/natgeo/" \
--data-urlencode "posts=5" \
--data-urlencode "per_post=20" \
--data-urlencode "since=2026-11-23T20:00:00Z" \
--data-urlencode "dry_run=true"How it works
prism/profile/commentsreads the account's recent posts, then the comments under each one.sincestops each post at its first comment older than that time.- A post with no new comment reads no comment page, so it costs nothing.
postssets how many recent posts are read, andper_postcaps the comments taken from each.- The call holds its worst case up front and refunds what it did not read.
What you need
| Call | What it gives | Credits |
|---|---|---|
GET /v1/prism/profile/comments | New comments under the profile's recent posts | The post list page, plus each comment page read |
POST /v1/monitors?dry_run=1 | The price of an hourly Monitor of that read | 0 |
| An HTTPS endpoint of your own | Receives each signed delivery | Free |
On Instagram a comment page costs 5 credits. On most other platforms it costs 1. The roster lists every price.
Steps
Step 1: read the comments since a time
curl -G "https://www.socialcrawl.dev/v1/prism/profile/comments" \
-H "x-api-key: $SOCIALCRAWL_API_KEY" \
--data-urlencode "url=https://www.instagram.com/natgeo/" \
--data-urlencode "posts=5" \
--data-urlencode "per_post=20" \
--data-urlencode "since=2026-11-23T20:00:00Z"import json, os, urllib.request
url = "https://www.socialcrawl.dev/v1/prism/profile/comments?url=https%3A%2F%2Fwww.instagram.com%2Fnatgeo%2F&posts=5&per_post=20&since=2026-11-23T20:00:00Z"
req = urllib.request.Request(url, headers={"x-api-key": os.environ["SOCIALCRAWL_API_KEY"]})
page = json.load(urllib.request.urlopen(req, timeout=180))
for p in page["data"]["posts"]:
print(p["url"], p["comments_new"], p["credits"])
print(len(page["data"]["items"]), page["credits_used"])data.itemsholds the new comments, each undercommentwith its text, author and time.data.postssays, post by post, how many comments were new and what each cost.sincetakes an ISO 8601 time on a direct call.
Step 2: keep the newest time you read
Save the time of the run once it finishes, and send it as since on the next run. Keep each comment by comment.id, so a comment that comes back is not stored twice.
{
"data": {
"items": [{ "comment": { "id": "18135330661764616", "post_id": "DgCpvD5A-3U", "published_at": "2026-11-23T23:20:41.000Z" } }],
"credits": { "posts": 1, "comments": 35, "replies": 0, "charged": 36, "held": 51 }
},
"credits_used": 36
}Step 3: let a Monitor send only the new ones
The Monitor below runs the read every hour and sends new comments to your webhook. With webhook_rows: "new" it remembers every comment it has read, so none is sent twice. Its first run is the baseline: it remembers what is there and sends nothing.
Store only what is new
- Key each comment on
comment.id. - Overlap the windows. Send a
sincean hour or two earlier than your last run, so a failed run loses nothing. - In a Monitor, send
since: "now-3h". It is resolved at every run to the time three hours earlier. - Keep each run under 200 comments with
sinceandper_post. Rows past that are not stored.
What it costs
A check pays for the post list page and for each comment page it reads. A post with no new comment reads no page. A Monitor adds 1 scheduling credit a run.
What the runs measured on 23/11/2026:
| Run | Comments | Credits |
|---|---|---|
| The dry run of the read | 0 | 0 (it holds 51) |
| 3 hours, five posts | 48 | 36 |
| 2 minutes, five posts | 1 | 6 |
| A post with no new comment | 0 | 0 |
Run this every day
Price the Monitor with a dry run, which creates nothing:
curl -X POST "https://www.socialcrawl.dev/v1/monitors?dry_run=1" \
-H "x-api-key: $SOCIALCRAWL_API_KEY" \
-H "content-type: application/json" \
-d '{"recipe": "prism/profile/comments", "params": {"url": "https://www.instagram.com/natgeo/", "posts": "5", "per_post": "20", "since": "now-3h"}, "cadence": "hourly", "webhook_url": "https://example.com/hooks/socialcrawl", "track": {"metrics": ["items[].comment.engagement.likes", "total"], "max_rows": 200}, "webhook_rows": "new", "alert_rules": [{"metric": "rows_new", "op": "gt", "value": 0}], "suppress_webhook_unless_alert": true}'estimated_cost_per_runin the answer is the worst case, every post with a full page of new comments.rows_new gt 0withsuppress_webhook_unless_alert: truesends nothing in an hour with no new comment.- Send the same body without
dry_run=1to create it, withmax_credits_per_monthset to your limit. - The answer carries
would_be_refusedwhen your plan has no free Monitor slot. - Store the
webhook_secretfrom the create answer, and verify every delivery.
Tips, and what not to use
- A chat app's incoming-webhook address is refused, because it cannot check a signature. Run the short relay and register its address instead.
- Start with five posts. Older posts rarely get new comments, and each one adds to the hold.
- Read
webhook_deliveryon the Monitor's runs to see the status your endpoint returned for each delivery. - Use Read the comments under many posts for a one-off export of every comment.
- Watch one post with
instagram/post/commentsandsort=recentwhen only one post matters.
