According to this: http://developers.facebook.com/docs/reference/api/batch, there’s a way to use results of first query to populate second query.
curl \
-F 'access_token=...' \
-F 'batch=[{ "method": "GET", \
"name" : "get-friends", \
"relative_url": "me/friends?limit=5", \
}, \
{ "method": "GET", \
"relative_url": "?ids={result=get-friends:$.data.*.id}" \
}]' \
https://graph.facebook.com
However I want to get a page posts in first query and then get the individual posts’ comments. Not sure if this is possible, any help is appreciated.
curl \
-F 'access_token=...' \
-F 'batch=[{ "method": "GET", \
"name" : "get-posts", \
"relative_url": "cocacola/posts?limit=5", \
}, \
{ "method": "GET", \
"relative_url": "?????" \
}]' \
https://graph.facebook.com
Luckily Facebook allows for multiple objects in a single query if you use
/comments?idsUnfortunately this is slower than doing 5 individual queries in parallel.