Getting your Instagram feed to Discord

Not so long ago, it was possible with a bit of effort, a third party feed generator and a Discord bot, to get Instagram to feed new images from your page to a Discord channel, complete with image preview. This then stopped working because as far as I can tell Instagram’s /p/<post> link is now behind their login wall, so anonymous feeds can’t get it. Result, lots of ugliness on my Discord, viz:

This bugged me enough to find a better solution, and one of my co-admins suggested IFTTT: some Googling later I found the bones of a recipe, which didn’t work. So here’s the result of me fixing it.

Step 1: create a Discord Webhook

Go to Server Settings (c’mon, you should know where that is by now), Webhooks, and hit the blurple[1] Create Webhook button.

Fill in the fields, upload an avatar image for the webhook if you want. Most importantly, you need to pick which channel you want the webhook to post to, and then copy the webhook URL (keep it private) and hit Save.

Step 2: use IFTTT to scrape your Instagram feed

Go to IFTTT, hit Explore, scroll down to Make your own from scratch. then hit Create. Hit +This, search for Instagram, select it and pick one of the triggers (I chose ‘Any new photo by you’). Easy.

Step 3: feed it to Discord

Now hit +That, and search for Webhooks – there is only one result, and from there only one action (‘Make a web request’), so select it. Now you need to configure it.

Easy bits first – paste your webhook URL into the URL field. Set the Method to POST, and the Content Type to application/json.

Finally, copy this into the Body field (or use the Add Ingredient button to add the Caption, Url and SourceUrl ingredient tokens):

{
  "content": "{{Caption}} {{Url}}",
  "embeds": [
    {  
      "image": {
        "url": "{{SourceUrl}}"
      }
    }
  ]
}

Hit Save. Go post to your Instagram feed and wait.

And there you are!

[1] ‘Blurple’ is the name of Discord’s official button colour

This entry was posted in Virtual un-distancing and tagged , . Bookmark the permalink.

1 Response to Getting your Instagram feed to Discord

  1. Jack says:

    Will this method only work for your own Instagram account? Can this be used to pull images from another public account that you don’t own?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.