Apify example task · whoareyouanas/facebook-single-post-scraper
Extract image and video URLs from Facebook posts
Look up two public Facebook post IDs with media extraction enabled. Inspect available media links and post URLs for a content inventory.
- Actor
- Facebook Post Scraper by ID: Text, Comments and Reactions
- Result limit
- Set by the input
- Estimated cost
- Per result, see pricing
- Run options
- Actor defaults
Example updated 2026-11-20 · actor build 0.1.13 · runs in your own Apify account
01 / About the actor
Facebook Post Scraper by ID: Text, Comments and Reactions
Retrieve known Facebook posts by numeric ID with text, authors, engagement, media links, and optional loaded comments. Use per-post statuses to separate complete results from partial or inaccessible content.
Batch known post IDs
Submit numeric identifiers as quoted strings to preserve precision.
HTTP with optional fallback
Try the documented HTTP workflow and use browser fallback when enabled and needed.
Inspect each result
Keep extraction method, missing fields, status, and errors alongside the post.
02 / Input
The exact input this example runs.
postIds is required and accepts numeric strings of 5–40 digits. Full URLs and opaque pfbid identifiers are not accepted. Enable comments and browserFallback only when needed, and review their cost implications.
{
"maxConcurrency": 1,
"browserConcurrency": 1,
"postIds": [
"4378894958999683",
"4426680754221103"
],
"includeMedia": true,
"includeComments": false
}| Field | Value in this example | What it controls |
|---|---|---|
| maxConcurrency | 1 | Maximum posts in flight. Lower this when Facebook throttles requests. |
| browserConcurrency | 1 | Maximum fallback tabs in the shared browser. |
| postIdsChange this | 4378894958999683, 4426680754221103 | Required: numeric Facebook post IDs as quoted strings, for example ["4376904415959558"]. For a /groups/GROUP_ID/permalink/POST_ID/ URL, use POST_ID. URLs, group IDs, and pfbid identifiers are not accepted. Duplicates produce one row. |
| includeMediaChange this | true | Return image and video URLs without downloading the files. |
| includeCommentsChange this | false | Return comments present in the post response, up to maxComments. Does not paginate or promise all comments. |
Other inputs you can add (6)
| Field | Type / required | Default | Purpose |
|---|---|---|---|
| maxComments | integer | 10 | Limit per post, applied after deduplication. Minimum: 0 · Maximum: 100 |
| httpTimeoutSecs | integer | 12 | Maximum time per HTTP attempt. Minimum: 1 · Maximum: 120 |
| browserTimeoutSecs | integer | 30 | Maximum time per fallback page after browser startup and queue wait. Minimum: 1 · Maximum: 120 |
| maxRetries | integer | 1 | Retries for transient network errors, throttling, and server errors. Minimum: 0 · Maximum: 3 |
| browserFallback | boolean | true | Use a browser when HTTP does not expose complete data. Successful browser results cost $0.04 instead of $0.005 for HTTP results. Disable for HTTP-only pricing. |
| proxyConfiguration | object | {"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"],"apifyProxyCountry":"IN"} | Residential Apify Proxy is enabled by default for cloud runs, using runtime credentials. Built-in proxy usage is included in Actor event pricing. Datacenter IPs may receive Facebook login restrictions. Disable explicitly for direct requests. The tested default country is India (IN); you can select another region. |
03 / Make it yours
Change these fields for your own research.
01 · postIds
Post IDs
Required: numeric Facebook post IDs as quoted strings, for example ["4376904415959558"]. For a /groups/GROUP_ID/permalink/POST_ID/ URL, use POST_ID. URLs, group IDs, and pfbid identifiers are not accepted. Duplicates produce one row.
Example: 4378894958999683, 4426680754221103
02 · includeMedia
Include media URLs
Return image and video URLs without downloading the files.
Example: true
03 · includeComments
Include loaded comments
Return comments present in the post response, up to maxComments. Does not paginate or promise all comments.
Example: false
Run it in three steps
- Open the example on Apify and select Try for free to copy it into your Apify account.
- Replace the sample values above with your own target and keep the limit small.
- Start the run, then export the dataset as JSON, CSV or Excel.
04 / Output
What the results table shows.
- Rows wrap the post inside a result with inputPostId, status, extractionMethod, missingFields, and error.
- Null means unknown; zero means an explicitly supplied zero. An empty comment array does not prove there are no comments.
Columns in the “Posts” view
inputPostId
Requested ID
status
Status
post.postUrl
Post
post.authorName
Author
post.text
Text
post.timestamp
Published
post.totalReactions
Reactions
post.commentsCount
Comments
post.sharesCount
Shares
extractionMethod
Method
durationMs
Duration (ms)
error
Error
A view selects columns for the table. The full JSON export keeps every field, including nested arrays and objects.
05 / Cost
What this example costs to run.
Charges follow the billable events in the pricing table below and the number of records the run returns. This example has no single total result cap, so start with it as is and check the run's charges before widening it.
HTTP post result
$0.005 per event
Browser post result
$0.04 per event
Actor Start
$0.00005 per event · per GB of memory
Prices checked 2026-11-22. Set a run spending limit in Apify when you widen the input.
06 / API
Run the same input from your code.
This call starts a billable run of Facebook Post Scraper by ID: Text, Comments and Reactions with this example's input and returns the dataset items when it finishes. Synchronous calls wait up to five minutes; for longer runs, POST to /runs instead and read the run's default dataset when it succeeds. Keep the token in an environment variable.
curl --request POST \
'https://api.apify.com/v2/acts/whoareyouanas~facebook-single-post-scraper/run-sync-get-dataset-items?format=json' \
--header "Authorization: Bearer $APIFY_TOKEN" \
--header 'Content-Type: application/json' \
--data '{"maxConcurrency":1,"browserConcurrency":1,"postIds":["4378894958999683","4426680754221103"],"includeMedia":true,"includeComments":false}'Coverage & interpretation
Check the result before relying on it.
- The accepted identifier contract is narrower than every Facebook post URL format.
- Content visibility can depend on cookies, source access, and proxies. Media URLs and counts can change after capture.
Questions
About this example.
What does the "Extract image and video URLs from Facebook posts" example collect?
Look up two public Facebook post IDs with media extraction enabled. Inspect available media links and post URLs for a content inventory. It runs Facebook Post Scraper by ID: Text, Comments and Reactions, published by whoareyouanas on Apify.
Which input does this example use?
Post IDs (postIds) set to 4378894958999683, 4426680754221103; Include media URLs (includeMedia) set to true; Include loaded comments (includeComments) set to false. The full JSON input is shown on this page.
How much does it cost to run this example?
Charges follow the billable events in the pricing table below and the number of records the run returns. This example has no single total result cap, so start with it as is and check the run's charges before widening it.
How do I change it for my own research?
Open the example on Apify and select Try for free to copy it into your account, then edit Post IDs, Include media URLs, Include loaded comments. Keep the result limit small for the first run and check the output before scaling up.
Can I run it from the API or on a schedule?
Yes. Send the same JSON input to the Facebook Post Scraper by ID: Text, Comments and Reactions run endpoint with your Apify API token, or save the copied task in your Apify account and add a schedule. Results land in the run's default dataset as JSON, CSV or Excel.
More examples
Related tasks you can copy.
Look up a batch of Facebook posts by numeric ID
Supply three documented numeric IDs and compare the returned post text, timestamps and source URLs. Use the input ID to match the output back to your list.
View exampleCollect a sample of comments from a Facebook post
Look up one public Facebook post and request up to five visible comments. Review comment text with the associated post and available engagement counts.
View exampleExtract one Facebook post with text and media
Look up one public Facebook post by numeric ID. Inspect available text, timestamps, reaction counts, image and video URLs, and the source URL.
View exampleFacebook Group & Page Scraper
Collect images and video links from ESA Facebook posts
Sample public ESA Facebook posts with media extraction enabled. Review available image links, video links and source post URLs.
View exampleReddit Export
Export recent r/Python posts for community research
Collect a small sample of recent public r/Python posts, including available text, timestamps and source links. Replace the target subreddit and date window for your own research. Inspect coverage and errors; upstream archive availability can vary.
View exampleReddit Scraper
Discover Reddit communities about homelabs
Search by homelab and collect the matching subreddit records. Review available community names, descriptions and member counts.
View exampleGuides