Facebook API Tutorial: Graph API, Access Token and Developer Documentation Explained
Вставка
- Опубліковано 5 лип 2024
- Want to optimize your paid social processes with Facebook ads automation? Then learn how to build on top of Facebook API with a simple tutorial from Kitchn.io! In this follow-along tutorial, you will learn how to get an access token, do your first Graph API call with Graph API Explorer, and export the campaign data of your ad accounts.
If you want to work with the Facebook API but do NOT want to go through technical documentation or handle authentication yourself, check out Kitchn.io.
kitchn.io/start
Timecodes:
00:00 - Intro
05:15 - Webinar starts
06:48 - Agenda
07:43 - Create a Facebook App
10:00 - Get an Access Token
15:00 - Developer Documentation: objects, edges, and params explained
17:45 - Graph API Explorer: First API Call
19:40 - Get ad accounts data
22:40 - Access one specific ad account
26:00 - Retrieve "insights", i.e. campaign data of your ad accounts
31:10 - Retrieve campaigns of ad account & play around with it
32:20 - Retrieve adsets of the campaign
32:48 - Retrieve and then change daily_budget
36:30 - Retrieve ads of adset
39:20 - Get ad creative and more insights about an ad
43:45 - Move out of Graph API Explorer and retrieve information with just a browser
48:30 - End
Link to slides: docs.google.com/presentation/...
Some links and references:
- developers.facebook.com
- Documentation: / reference
#facebookads #facebookadsapi #facebookmarketingapi #performancemarketing #scripting
This tutorial is AWESOME!!!! Been searching everywhere for just what you demonstrated. Thanks for taking the time to do this.
Watching this 3 years on - thanks so much Simon. This has saved me a lot of money having to outsource this to someone.
Amazing walkthrough, answered all my questions and taught me some new tricks
Insanely valuable. Thank you!
Thanks brother for share your knowledge with others.
Awesome tutorial. Thanks!!
This is actually gold. Now I just need to creat every single freaking request I need and move it to postman for our actual developer
Postman is prob very overkill. Your developer may simply use the facebook SDK.
Many thanks, exactly what I was looking for!
Glad I could help!
thanks man, its so helpful!
Thanks much for the video. Very helpful!.
Glad it was helpful!
Thanks! I hope you keep doing new tutorials.
Great Job! Would be great if you can give tutorials of the API's of other sites too like Google Analytics, Google Ads etc. Waiting for further great content from you :)
Noted! Just the authentication part is much harder on Google products IMO, but will definitely get to it eventually! :)
@@kitchnio preferably native (taboola and Outbrain) cause their dashboards suck! They always have a delay and this wouldn't be the case if I could pull the data via API.
This solved all the mystery about Marketing API. Thank you very much for uploading the video.
This is amazingly helpful. Thank you!
Glad it was helpful!
perfect! great job!
Appreciate it!
love your content so much
Thank you i am marketer who do not know coding... thank you very much agenda is liked
You are most welcome
Thank you for creating this (and the one about pulling the data into google sheets) both were very clear and helpful! I need to pull in # of purchases and landing page views to my google sheet can you tell me how to do that? Oh, and is there a way to get the most recent data on top?
Thank you very much. I need to up my game into api because thats where the future is.
The past was using APIs as well. Hope youved up your game.
Great walkthrough! Thanks a lot. I am trying to do this via python, if you have additional resources that would be super helpful.
Glad it was helpful! We'll be pushing out more content soon!
Wow very informative video.Sir please make a video on Facebook Catalogue Batch API.
First thank you very much for the video.
But when I add adaccount in graph api, it doesn't let me click submit and I click to generate token and I get that I need permissions.
Do I have to request permissions for ads_read and ads_management?
NOTE : I found the mistake, I didn't generate token in the tool's page when you selected ads_read, ads_management, read_insights
i spend hours figuring out how to connect facebook ads api to my dashboard apps and have no reslut. Really thanks for this i cant believe its actually really easy
Glad it helped
Amazing! Thank you so much! where I can join this webinar in the future? You have a Udemy course?
Thanks for this video it is helping me so much.
Glad it helped!
Hi, Simon! Thank you for the video. It's the third time i am here.
I have a problem. I want to get the "Page Name" level but it is not available. only ad, adset, campaign, account levels are available.
Do you know an alternative to get this "Page Name" or "Page ID" since Graph API? Thank you!
Hi, do you know how to call the API for the multiple ad-account or cross-account report?
2:50 gratidão pela oportunidade avanco social vocês são os melhores para as redes sociais
Thank you, this is really helpful. I was wondering, is there a way to send an image for the ad through the API?
Thanks! Just to clarify, you are trying to replace the image of an existing ad via API?
@@kitchnio Thanks for answering, I did a bunch of tests and found out how to send the base64 bytes through Postman
Thankyou for sharing it. I wanted to merge facebook ad data with google analytic for firebase data. Can you share some resources for it.
the best
Thank you very much for video
Can you share how to post video and images on profile and fanpage by using fb api?
Does this same API work for Instagram? Yesterday I ran several tests and couldn't retrieve the RTMP address for IG to do live streaming using OBS Studio. However, I had no issues doing the same for Facebook. In summary, can you start a live stream on Instagram using the Graph API?
Hey man, greath job!
How can i filter the "actions"? I need only landing page views, for example
I'd be great to shave a short intro for how this is useful for real usecases before jumping it to the nitty gritty. Grate vid though. Thanks
Hi. Great video.
How to query fb to get a list of campaigns and their insights with fields?
Thanks.
Thank you! You can add fields as a nested argument when querying an "edge".
The normal API call would be simply:
/act_/campaigns?fields=insights
But this will return the default value of insights, which is spend and impressions for the last 30 days.
To add further fields, e.g. "actions", you can use curly brackets:
/act_{account_id}/campaigns?fields=insights{spend,impressions,actions}
To change other parameters you would use .(), so:
/act_{account_id}/campaigns?fields=insights.date_preset(last_year){spend,impressions,actions}
if instead of the default "last_30d", you'd want to use "last_year" for the "date_preset" setting.
Hey, quick question: how applicable is this to the current Meta Marketing API? Is it all the same, or have any of these steps significantly changed? Apart from just UI changes of course.
Hi! I just want to learn your tutorials and they are so valuable and but I could not able to process your get access token because its does not appear public_profile on the permission dropdown list. Please Help me to resolve that
Could you assist me in retrieving the DDA results? The results for my work are currently empty, and I'm unsure how to resolve this issue.
How many of these data points are still valid with iOS's recent pixel blocking/tracking techniques?
Hi bro I need ur help to breakdown actions?
Good video..just wondering can all this be automated with Python ?
Yes, absolutely
Hey, Is it possible to pull amount spent at an adid level from graph api. I need this level of granularity for my use case.Any help is much much appreciated! Thanks in advance!
Also I really like your content. I have subscribed to your channel!
Thank you!
Of course. For example the following would get you spend, ad name and ad id for the whole account over the last 7 days broken down by day.
/act_/insights?level=ad&fields=spend,ad_name,ad_id&date_preset=last_7d&time_increment=1
Is there any way to create ad account without payment process
Could you please help me to pullout the conversion metrics? Tried using Marketing API fields but as it's not a numeric field, it's not working.
What conversion specifically?
Hey there Simon,
whenever I try to test out the Api using the GraphApiExplorer I get this error: "(#100) Missing permissions".
I have generated a token with the ads_management and the ads_read permissions so I do not understand why this is happening. Am I missing something?
Hi! What endpoint are you trying to call?
Like in Brazil
Maybe I'm missing something, but how do you deal with the access token expiring? If I want these reports in a google sheet to be fully automated, how do you make sure it can run without needing to go in every two hours to get a new access token?
Hi Aidan, we're about to record a video on it! If you don't want to wait for the video, check out Facebook's documentation: developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived
hey, is it possible to manage all my ads without an official app review?
For an internal app, you don't need publish the app, so no need for a review.
How can I get the data segment by campaign if I have many adaccounts? I want to select it with a range time btw, I tried but it doesn't work. Please! I need help
Please share what you tried exactly and I might be able to help.
what is the use of this access token can you elaborate am new about it
The access token is the equivalent to your username + password that you need to login into your Facebook (ads) account. So the access token identifies and authorizes you when accessing Facebook (ads) via API.
hello sir, jus a question , how can i get the facebook leads with this api , great video btw
We will probably make another video on that but it's not so straight-forward unfortunately. Using Zapier for Lead Ads might be a good starting point, though?
@@kitchnio Awaiting the video. Thanks!
Is it still up to date ? didn't they change their APIs at 2022?
Some things have changed, of course. Lots of things are the same, though! :)
developers.facebook.com/docs/graph-api/changelog
lengend in portugês (Brasil) please
how can we get the facebook followers each day?
Seems to be outdated? Nothing looks like this.... Sorry....