Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Blog
    • 2013
    • 2012
    • 2011
    • 2010
    • 2009
    • 2008
    • 2007
    • 2006
  • Developer Roadmap
  • Developer Events

Developer Blog

Wei Zhu

New Batch API

By Wei Zhu - Wednesday, January 23, 2008 at 10:40pm

The batch API allows you to combine multiple individual operations into a single request. This will significantly improve your application latency and reduce traffic load on Facebook servers. We have also updated our PHP5 client library to make using the batch API easier. Here is an example that calls the Facebook API in no-batched mode,

$friends = $api_client->friends_get();
$notifications = $api_client->notifications_get();

The above code can be rewritten to use the batch API as follows:

$facebook->api_client->begin_batch();
$friends = & $api_client->friends_get();
$notifications = & $api_client->notifications_get();
$facebook->api_client->end_batch();

We’d encourage developers to try it out and send us feedbacks. To learn more about the batch API check out the documentation at http://wiki.developers.facebook.com/index.php/Using_batching_API

Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy