skip to Main Content

I try to get the next metrics of each of my posts in my page in a specific range of date, the metrics I need are: date, URL from the post, message from the post, likes, number of comments, number of shares, clicks to links, others click, views, negative clicks, reach organic and paid.

I already have date, URL, message, likes, number of comments, and number of shares.
With this call:

url = "https://graph.facebook.com/{page-ID}/feed?fields=message,comments.summary(true),reactions.limit(1).summary(true),shares&since=" + start_date + "&until=" + end_date + "&access_token=" + access_token

Does anyone know how to get the rest?:
clicks to links, others clicks, views, negative clicks, reach organic and paid.

I tried with the next call but only gave me general impressions.

url = "https://graph.facebook.com/{page-ID}/insights?metric=post_impressions,post_impressions_paid&since=" + start_date + "&until=" + end_date + "&access_token=" + access_token

For the people in the future who wants this information

I’m using 15.0v of the API

The lenguaje is python and start_date, end_date and access_token, are variables.

In start_date and end_date need to be "Unix time" in str format (example for jaunary 1 of 2023: start_date = "1672552800")

In my app have the next permissions:

  • read_insights
  • pages_show_list
  • ads_management
  • ads_read
  • pages_read_engagement
  • pages_read_user_content
  • public_profile

2

Answers


  1. Chosen as BEST ANSWER

    Okay, I figured out, you need to make the HTTP request for each post with the ID of the post for that kind of métric, this is an example

    https://graph.facebook.com/{ID_POST}/insights?metric=post_impressions,post_impressions_organic,post_impressions_paid,post_clicks,post_consumptions,post_consumptions_unique&since=" + start_date + "&until=" + end_date + "&access_token=" + access_token

    Since the first call with all the metrics(reactions,comments,shares) already give each ID-post, I think I can get the ID's and make the calls with that for the others metrics, If anyone knows a easier way to do this pls tell my


  2. You can get bulk posts insights using args like this

    insights.metric(post_impressions)
    

    for example

    https://graph.facebook.com/v16.0/{page_id}/posts?access_token={token}&fields=message,created_time,permalink_url,insights.metric(post_impressions,post_clicks_by_type_unique,post_video_views_paid_unique,post_video_views_organic_unique,post_video_avg_time_watched)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search