Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instagram API for ADS posts not working

I get instagram post details (likes, comments) by using the media endpoint:

$data1 = file_get_contents("https://api.instagram.com/v1/media/$media_id/likes?access_token=$access_token");

This works for normal posts from my feed, but when I input the $media_id for an instagram post that is an AD I always get invalid media id

{
  "meta":  {
    "error_type": "APINotFoundError",
    "code": 400,
    "error_message": "invalid media id"
  }
}

Are ads treated as different types of posts or the API is unable to retrieve any details from them?

like image 750
bob Avatar asked May 25 '26 22:05

bob


1 Answers

Yes, the ads are treated like a different type of post and can only be managed or fully read by means of the Facebook APIs. Try the Graph API, the Marketing API or the Business Manager API, that's where I got the most useful tips and results.

(sorry, dont have enough rep to post more than two links. But don't worry, you'll find it on google in a heartbeat)

like image 101
Chico Carvalho Avatar answered May 31 '26 13:05

Chico Carvalho



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!