New(ish) requirements for Instagram API POST endpoint

416 views Asked by At

I wrote a python script (automatically likes mediaIDs given a user-defined list of hashtags) that accesses the instagram API endpoint POST /media/media-id/likes using the python-instagram library. The program has been running for almost a year, many friends (and others) have used it since.

So I tried to set up another person today by registering a new instagram client. Then I RAN INTO THIS on the developer landing page. It states that Instagram is requiring users to request access to POST endpoints.

Here is a snippet of where the code fails:

for mID in mediaIDs:
    #rate limit is 30 requests/hour
    time.sleep(121)
    api_sub2 = igLogin_API()
    try:
        api.like_media(media_id=mID.id)
        like_count +=1
        userIDs.append(mID.user)
        liked_mediaIDs.append(mID)
        img_urls.append(mID.images['standard_resolution'].url)
    except:
        e = sys.exc_info()[0]
        print "already liked %s or %s" % (str(mID),str(e))

The exception is raised:

C:\Users\Andrew\Desktop\pygram>python IG_like.py
already likedMedia: 1006563954514666042_1643375967 or (<class'instagram.bind.InstagramAPIError'>, InstagramAPIError(), <traceback object at 0x0000000002C54648>)

Has instagram finally beaten bots? Can anyone offer a work-around?

1

There are 1 answers

0
mehulj94 On

Likes, relationships and comments now require approval.

The ability to POST and DELETE likes, follows and comments is restricted to applications that offer business services and not consumer facing apps. In particular, we may approve only the following types of business services:

• Media rights management: for example a platform for media publishers and brands to request permission from the Instagram Community to use Instagram content.

• Social media management: for example, a platform to help businesses integrate Instagram in their social media workflow

To request access to this endpoint, fill up the form

I am still on the process of finding a way to work around it.