Get Facebook Ad Account prepaid balance from Graph API - facebook

I'm trying to get the prepaid balance of an ad account using FB Graph API. Currently, I'm trying to hit the https://graph.facebook.com/v11.0/act_<AD_ACCOUNT_ID> endpoint requesting the balance field, as specified in the docs, but the information doesn't match with the one provided in the UI.
Specifically, I'm trying to get the information displayed here
Where can I find this information in the Graph API?

Related

How to get the Pixel ID of an ad account - Facebook marketing API

Is it possible to get the Pixel ID of an ad account thru the Facebook Marketing API? and if so, how to call the API?
I took a look at the documentation but I'm unable to find out how to do it
audiences-api/pixel/
reference/ads-pixel/
As described in the doc:
If a pixel exists for an ad account, get the code with Marketing API
with an HTTP GET to
https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adspixels.
Otherwise you could create it:
To create a pixel, HTTP POST to https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adspixels.

Determine Custom Conversion Action for AdSet in Facebook Marketing API

I'm using the Facebook API Marketing API to get insight information about different ad campaigns. In the ad campaign insight results, there are a number of actions with values. When I look in the Facebook Ad Manager UI, I see the Result column for Campaigns where it shows me the value I'd like to extract from the API. The problem I'm running into is that I need to programmatically determine what action to pull the value from.
When I look in the AdSet settings in the UI, I see the Conversion Event which ties to a Custom Conversion but I don't know how to get that Custom Conversion ID for the ad set from the API.

How to access Instagram feed of any user with new Graph API?

Facebook recently introduced Instagram Graph API, which allows to fetch data from Instagram page that is connected to your Facebook company page, instagram.com/developers states:
The Instagram Graph API is Now Available to All Developers.
For Non-Business Instagram Accounts please continue to use the existing Instagram API.
So, for example, if my company has account instagram.com/my_first_company, I can only retrieve its feed and no one else.
Using old Instagram API to retrieve public_content permission (access to any feed) is no longer an option too, from old API documetation:
public_content - to read any public profile info and media on a user’s
behalf (applications no longer accepted)
What will happen to existing tools that have public_content permission? (for example, there are tons of plugins for various CMS that allow to display recent Instagram photos)
Is there any valid way to access public_content (access to any feed) right now (besides fetching HTML pages of Instagram website)?
Are there any plans to enable Graph API for non-business customers, of so when?
UPD. There seem to be ?__a=1 endpoint that allows to get access to recent photos of any public feed without any tokens. But it's not official and no one knows when/if Instagram will close it. If you do - please let me know.
UPD 2. Instagram removed ?__a=1 endpoint, not sure for how long, probably forever. Currently the only way to access instagram feed is to scrap instagram.com website, which is a horror.
Prerequisite: You first need the business Instagram account to be linked with FB Page. https://help.instagram.com/356902681064399 - That one can do from the profile page of Instagram account.
Get the Instagram business account id:
graph.facebook.com/v2.8/<fbPageId>?fields=instagram_business_account. (the fbPageId is the page id of the facebook page the account is linked)
To fetch instagram media feed: graph.facebook.com/v2.8/<igBusinessId>/media to fetch the media feed of the Instagram account. (the igBusinessId is the id returned in above linked instagram_business_account) - This is still owned media as per the page access_token. Not any other user's feed.
All other endpoints (such as comments moderation, detailed insights API) mentioned here works on the business media list returned on above call.
Please note:
This still does not allow to fetch un-authenticated user's Instagram feed. That is not possible via API now. There is no valid way via API to get to public_content scope. There can be few Instagram Marketing partners for which this is enabled. But, in general the scope is deprecated now!
Currently, for FB graph API to work we need linked business page to Instagram account. As above apis uses page tokens.
You can get information about any IG business account using your FB access_token using the business_discovery API as given here.
You must have an IG business account to read other users data like user_info or media details using the id of your IG business account as a node.
Ex:
GET graph.facebook.com/[YOUR-IG-BUSINESS-ACCOUNT-ID]?fields=business_discovery.username(USERNAME){media{caption,media_url,media_type,like_count,comments_count,id}}

How to use the Facebook Ads API to get custom columns in Ads Manager?

I've been experimenting with the Facebook Marketing API to see what I can access in terms of the user's campaigns, ad sets and ads etc. One thing I'm curious by, through the API, is it possible to get the customised columns that the user has selected when viewing metrics for their campaigns, ad sets or ads?
For example, the user has selected to see only Delivery, Cost and Budget metrics for their ad sets. Can I somehow know they've picked these columns from the API alone?
You can't. The Ads manager on Facebook is just another app using the Marketing API (same goes for Power editor, Graph API explorer and others).
Settings of the Ads manager aren't part of ad account data and are private to the app.

Not getting expected campaign IDs when using Facebook Ad Report Stats API

I created an access token with my personal account with additional ad_management permissions. I used curl to exchange this short-lived token for a permanent access token.
The roles page for my ads account says "You can manage campaigns, view reports, and view billing information."
I use this access_token with curl to get the offsite_conversions count from yesterday. The results contain data for a few campaigns. However these campaigns are nowhere to be found in the campaigns list in the ads manager. If I click a campaign and replace the ID in the url with one of the campaign ids int he response I get a "This content is currently unavailable" error page.
Additionally there are at least three campaigns shown in the ads manager's campaign list which do have a few offsite conversions recorded which are not showing up in the response of the Ad Report Stats API call.
How can I get more information to solve this problem?
I was confused by the relatively recent change in the ad campaign terminologies. The reporting api is still using the old terms where a campaign corresponds to what is now an ad set.
If you want to match the campaigns in the ads manager with the campaigns you can fetch with the marketing api I would recommend you add ?fields=name. If you don't recognise the names, then there is probably something wrong :-)