Facebook comments API and CSV export
Read available comments from one public Facebook post, reel or video. Use the browser viewer for a single batch or REST and MCP for explicit pagination.
Make a request
GET /facebook/comments accepts query parameters. POST /facebook/comments accepts the same inputs as JSON. Send your project key in the x-access-key header; keep it on your server.
Credits: 1 credit per 50 returned comments, minimum 1 including verified empty results. Your balance must cover 1 per 20 requested comments. Failed processing uses no credits.
curl request example
curl --fail-with-body --get 'https://api.fetchfox.net/facebook/comments' \
-H 'x-access-key: YOUR_KEY' \
--data-urlencode 'url=https://www.facebook.com/PAGE/posts/POST_ID' \
--data-urlencode 'limit=20'JavaScript request example
// Run on your server with FETCHFOX_API_KEY set.
const url = new URL('https://api.fetchfox.net/facebook/comments');
url.searchParams.set('url', 'https://www.facebook.com/PAGE/posts/POST_ID');
url.searchParams.set('limit', '20');
const response = await fetch(url, {
headers: { 'x-access-key': process.env.FETCHFOX_API_KEY },
signal: AbortSignal.timeout(130000)
});
if (!response.ok) throw new Error('HTTP ' + response.status);
const result = await response.json();
if (!result.success) throw new Error('Request unsuccessful');
console.log(result.data);Python request example
import json, os
from urllib.parse import urlencode
from urllib.request import Request, urlopen
query = urlencode({"url":"https://www.facebook.com/PAGE/posts/POST_ID","limit":20})
request = Request('https://api.fetchfox.net/facebook/comments?' + query,
headers={'x-access-key': os.environ['FETCHFOX_API_KEY']})
with urlopen(request, timeout=130) as response:
result = json.load(response)
if not result.get('success'):
raise RuntimeError('Request unsuccessful')
print(result['data'])Replace placeholder source IDs with real public URLs. See limits and retries before automating calls.
Read the returned comments
data.comments contains stable string IDs, text, available author fields, likes, replyCount and timestamps. Keep IDs as strings when storing or exporting. data.commentCount can be null and is not evidence that every comment was collected. The comments viewer exports selected public fields as CSV or the response as JSON.
Continue a collection
limit defaults to 10 and accepts integers from 1 through 100. If hasMore is true, send the opaque cursor with the same post URL. Facebook does not accept a sortBy input. Each request is explicit and separately billed. Do not decode, modify or reuse a cursor for another post.
Interpret collection status
collectionStatus is partial, exhausted or unknown. stopReason explains why collection stopped. Exhausted means the available source pagination ended; it does not include every hidden comment or reply. hasMore=false does not prove complete coverage. Private, removed, restricted or login-only content may fail.