morlord
morlord

Reputation: 56

Get likes from instagram ad post via API

I have deal with problem. I want to load likes from ad posts with API. For this I use 2 methods:

  1. https://api.instagram.com/v1/media/shortcode/D?access_token=ACCESS-TOKEN with this method I get media-id of record
  2. https://api.instagram.com/v1/media/{media-id}/likes?access_token=ACCESS-TOKEN with this method I’m trying to get likes, but receive error, that media-id is incorrect.

How to get likes from ad posts?

Upvotes: 2

Views: 10276

Answers (1)

Rehan Manzoor
Rehan Manzoor

Reputation: 2753

Well if it's saying your media id is not correct then its right.

https://api.instagram.com/v1/media/{media-id}/likes?access_token=ACCESS-TOKEN

Because this is the endpoint for likes in the instagram official Official Instagram API.

Confusion Since it's a year i've been working on instagram API extensively, there is a tiny chance that you're taking the wrong media id. if you're having media_id like this 1442272751838402596_2344486445 this id is composed of two things and separated by _ (underscore).

POST_ID: 1442272751838402596
OWNER_ID: 2344486445

So becareful when you're getting the likes for a post using media ID.

Upvotes: 4

Related Questions