Collect Facebook Ads Data with graphAPI

Hi everyone!

One year ago, I’ve used a python script to collect Facebook Ads Data. Since the Graph’s API new version, this script doesn’t work anymore.

I prefer to use scripts to collect Facebook Ads Data for performance reasons.

Does anyone do the same thing and have some project on git.hub to share with me?

Thanks!

1 Like

Hello @pierogranja ,

That is a great question! I’ll first take a moment to welcome you to our community. I am here to help get you the information and insights you need.

I understand your preference for using scripts to collect data. It can help save time and focus. I believe we may have community experts who can help share their experience with Graph’s API and using scripts for collecting data.

@nina_pang @matthew_brandt @Irina_Tudorache Would you or anyone you know have experience using scripts with Graph API v14.0 for FB ads? Let’s see if we can figure this out.

In case we can’t get you a clear answer, your post will still show others who use Graph API this is an issue and hopefully find a proper solution.

Thank you, and will check back soon!
Tania

1 Like

Thanks for mentioning me, I don’t have these skills, I asked a friend to join if he has time to answer.

1 Like

Hi Irina,

Thank you for your reply. Look forward to your friend’s answer, should he have the time. Appreciate reaching out to them.

Were you able to look into it further, @pierogranja? I will make sure to ask our Facebook group as well.

Thank you so much,
Tania

1 Like

Hi guys, I’ve using this script below to collect facebook ads data and import it to a database:
https://colab.research.google.com/drive/1HmgLgHvr15-8wy-N2SysVgAvjBs1dsRS?usp=sharing

In this case, the script will get the data from the current month, but you can change the period here:

params = {
‘date_preset’: ‘this_month’,

For more information, check the documentation:
https://developers.facebook.com/docs/marketing-api/insights/parameters/v15.0

I used the official facebook SDK lib:
https://github.com/facebook/facebook-python-business-sdk

Regards,

Wagner

2 Likes

Thank you for this, @waboratto! @pierogranja - take a look at this info. Hope it helps. :slight_smile: