Downloading Reports from the Facebook API

in Facebook Ads API

As Facebook PPC is starting to gain popularity people have begun to request ads data from it to be integrated into the reporting tools I build. Facebook introduced an API for Ads last year, but they have been very slow to give out access, so it's currently difficult for small advertisers and developers to use it. Even if you spend over $30K a month and have an account rep, there's still no guarantee of being given credentials in the short term. I guess this has something to do with their current policy of manually reviewing ads; they don't want to give too many people the ability to bulk upload and flood them with a mass of ads to approve.

This means that currently most people will need to get this data via another mechanism. Manually downloading reports then uploading them into a reporting system is a possibility but won't scale well. However, there is a better option that I've used for other ad providers that don't have an API key: There's been an option in the reporting interface to schedule reports and email them out for a while now; this can be used to retrieve data from an email account. You just need to set up the reports you need then they will get emailed daily to a location where your system can download them using standard mail tools.

Another option if you need access to data that is more up-to-date would be to auto-login and grab the reports using something like cURL. However, any form of automated access to Facebook is currently prohibited under their TOS, so that needs to be taken into consideration.

Hopefully access to the API will be opened up in the future, but I'm not holding my breath at the moment given how long it took for the adCenter API to become public. They kept saying “soon” for many years, but eventually only ended up opening it when they had to for existing Yahoo API users who would have lost functionality after the merger otherwise.


I'm keen to get feedback on my posts, so if you have any questions or comments, then please send me a message and I'll be happy to help.

Hi Ewan,

I'm starting into this exercise of getting access to the Facebook Ad api. I'm hoping that since the aggregate spend of all our customers is $100K/mo that they'll let us in. I had been wondering why FB didn't open this up more quickly but after reading your comment about them "manually reviewing ads" it makes some sense. They could easily solve that by having two different APIs or user permissions. We only want reports and not the ability to place ads.



Hi Chris,

Yes, I've been thinking the same thing about having two API's, as--besides freelance work--I personally only need to be able to download reports. The same issue now exists with the AdWords API as well: They spend five to six weeks reviewing token applications, but having a separate reporting token would probably make the review process much easier and faster because they would only need to focus on a smaller set of issues.