How to Post Videos to Reels Using a Social Media API

Instagram reels are finally here! It’s been a while, but Instagram has updated its API to support: post reel video You can share videos, carousels and now reels on your behalf via Facebook social media API i.e. using FB Graph API.

With the success of short videos on TikTok, Instagram relied more on TikTok competitor Reels.

Reels content is quickly gaining popularity on Instagram. According to Meta, Reels is now 20% or more Time people spend on Instagram. So, to continue expanding the reels, Instagram now allows third-party apps to share videos on the reel tab.

What is an Instagram reel?

Instagram says:

reel is Fun and immersive videos that creatively tell your brand story, educate your audience and discover by those who love your business..

Basically a reel of 60 seconds, now 90 seconds of video, stitching together, editing video clips, adding music, applying filters, creating captions, inserting interactive backgrounds, and some cool creative things. It’s like a TikTok video where you can do more. , add stickers.

Instagram has made all tabs in its mobile app dedicated to Reels.

In this reel tab you can see all the reels, not just the accounts you follow.

Instagram tried to make Reels fun and interactive by giving creators a chance to go viral.

Using Instagram API with Reel

Instagram has extended its API to support Reels. endpoint POST/{ig-user-id}/media Updated to accept. media_type reel. If you’re used to posting videos to IG, it’s pretty much the same.

POST https://graph.facebook.com/{api-version}/{ig-user-id}/media
?media_type=REELS               // New
&video_url={reel-url}
&caption={caption}
&location_id={location-id}
&thumb_offset={thumb-offset}    // Available for Reels
&share_to_feed={share-to-feed}  // New
&access_token={access-token}

The two main differences worth noting are:

  • media_type set to REELS. This allows you to mark your video as a reel on Instagram.
  • share_to_feed set to true To make the reels appear on both sides feed and reel tab. This is what lil must meet Requirements Duration, length and encoding.

Also available with video thumb_offset field. This allows you to specify a frame of position (in milliseconds) in the video to use as the thumbnail.

Here is an example of JavaScript using: fetch Post the reel to Instagram. Running server-side in Node.js is fine given sensitive data like access tokens.

const access_token = "Js82ks92jald"; // The access token given from FB
const instagram_user_id = "12345";   // The IG user's ID
const reelUrl = "https://www.website.com/reel.mp4";
const caption = "This is the best real ever #Reels4Real";

const postUrl = `https://graph.facebook.com/${instagram_user_id}/media?video_url=${encodeURIComponent(reelUrl)}&caption=${encodeURIComponent(caption)}&access_token=${access_token}&media_type=REELS&share_to_feed=true&thumb_offset=2000`;

const postOptions = {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
};

fetch(postUrl, postOptions)
      .then((res) => res.json())
      .then(json => console.log(json))
      .catch(console.error);

This JavaScript code is fetch A call to the Facebook Graph media endpoint on behalf of an Instagram user (instagram_user_id). The main fields are Reels MP4 files (video_url), media_type Lilo, and access_token. It’s that simple!

If you need help with your Instagram access token, Instagram Graph API Overview.

How long can the reels be available through the API?

Instagram API documentation states that Reels are 90 seconds long. However, the maximum video length of 60 seconds is still valid. This is probably a bug in the new Reels implementation. We will update this article when the allowed period is extended to 90 seconds.

Using Ayrshare’s Social Media API

Another option to publish IG Reels is Ayrshare’s social media API. Specifically, you can use: reel Option to post videos to Instagram, YouTube, TikTok, etc.

{
    "instagramOptions": {
        "reels": true,
        "shareReelsFeed": true
    }
}

It’s nice to have Instagram. API enhancements Regularly like product tagging, carousels and comments. We hope to be able to use Instagram Stories next!

Source

Explore additional categories

Explore Other Classes