<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rory chen</title>
    <description>The latest articles on DEV Community by rory chen (@flyrory).</description>
    <link>https://dev.to/flyrory</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4178675%2F9b450c80-8800-4aa8-a83b-b78d77839cda.png</url>
      <title>DEV Community: rory chen</title>
      <link>https://dev.to/flyrory</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/flyrory"/>
    <language>en</language>
    <item>
      <title>Turn an authorized Instagram Reel link into a media-library record</title>
      <dc:creator>rory chen</dc:creator>
      <pubDate>Mon, 12 Oct 2026 08:30:43 +0000</pubDate>
      <link>https://dev.to/flyrory/turn-an-authorized-instagram-reel-link-into-a-media-library-record-11kd</link>
      <guid>https://dev.to/flyrory/turn-an-authorized-instagram-reel-link-into-a-media-library-record-11kd</guid>
      <description>&lt;p&gt;A creator sends your content tool a link to one of their own public Instagram Reels. Your application needs a caption, thumbnail, duration, and a video URL for an immediate preview. A social-page URL is not a direct media-file URL, so the first step is to resolve it into structured data.&lt;/p&gt;

&lt;p&gt;This tutorial uses &lt;strong&gt;Instagram Reel Video &amp;amp; Metadata API&lt;/strong&gt;, an independently operated product I provide through RapidAPI and API.market. It supports public Reel videos you own or have permission to process. It requires no Instagram login or cookies. It does not support private content, Stories, Posts, account access, or permanent media hosting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start offline
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/flyrory/instagram-reel-api-examples" rel="noopener noreferrer"&gt;public sample repository&lt;/a&gt; includes JavaScript and Python clients with no third-party dependencies. Use Node.js 22+ or Python 3.11+. Clone the repository and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/flyrory/instagram-reel-api-examples.git
&lt;span class="nb"&gt;cd &lt;/span&gt;instagram-reel-api-examples
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then preview either client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node resolve.mjs &lt;span class="nt"&gt;--demo&lt;/span&gt;
&lt;span class="c"&gt;# Python alternative:&lt;/span&gt;
python3 resolve.py &lt;span class="nt"&gt;--demo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will get synthetic JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"source_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://www.instagram.com/reel/DEMO/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"shortcode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"DEMO"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"media_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"video"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"video_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://media.example.invalid/reel.mp4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"thumbnail_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://media.example.invalid/thumbnail.jpg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"caption"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Synthetic preview of your authorized Reel."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"duration_seconds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;12.5&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These media URLs deliberately do not resolve. No key or network request is needed for this preview.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect your marketplace subscription
&lt;/h2&gt;

&lt;p&gt;Subscribe to &lt;a href="https://rapidapi.com/cqqrory/api/instagram-reel-video-metadata-api" rel="noopener noreferrer"&gt;BASIC on RapidAPI&lt;/a&gt;, then set your consumer &lt;code&gt;RAPIDAPI_KEY&lt;/code&gt; privately in your local environment. Keep keys on your backend and out of source control, screenshots, and browser code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MARKETPLACE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;rapidapi
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SAMPLE_REEL_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'https://www.instagram.com/reel/YOUR_SHORTCODE/'&lt;/span&gt;
&lt;span class="c"&gt;# Privately set RAPIDAPI_KEY before running the client.&lt;/span&gt;
node resolve.mjs &lt;span class="nt"&gt;--authorized&lt;/span&gt;
&lt;span class="c"&gt;# Or:&lt;/span&gt;
python3 resolve.py &lt;span class="nt"&gt;--authorized&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;YOUR_SHORTCODE&lt;/code&gt; with an actual public Reel you own or may process. The &lt;code&gt;--authorized&lt;/code&gt; flag confirms your permission; it does not create it. To use &lt;a href="https://api.market/store/cqqrory/public-reel-media-resolver" rel="noopener noreferrer"&gt;API.market&lt;/a&gt;, set &lt;code&gt;MARKETPLACE=api_market&lt;/code&gt; and privately set &lt;code&gt;API_MARKET_KEY&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The request is &lt;code&gt;POST /v1/media/resolve&lt;/code&gt; through the selected marketplace, with a JSON body containing one &lt;code&gt;url&lt;/code&gt;. The samples use fixed marketplace gateways, refuse redirects, and apply a 20-second timeout. They do not need supplier-origin credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Save a record that remains useful
&lt;/h2&gt;

&lt;p&gt;Treat the source Reel URL as the reference you can resolve again. Your library record might contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"source_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://www.instagram.com/reel/DEMO/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"shortcode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"DEMO"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"caption"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Synthetic preview of your authorized Reel."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"duration_seconds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;12.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"resolved_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-10-12T00:00:00Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;resolved_at&lt;/code&gt; is added by your application, not returned by the API. Caption, thumbnail, and duration depend on what is available upstream. A returned media URL is temporary: use it immediately for your authorized workflow, and resolve the source again when needed. It is unsuitable as a permanent video or thumbnail storage key. The API does not archive media for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handle unavailable content and limits
&lt;/h2&gt;

&lt;p&gt;Try &lt;code&gt;node resolve.mjs --demo --status 404&lt;/code&gt; or the equivalent Python command to exercise an unavailable-content path offline. The client exits with a nonzero status and prints recovery guidance instead of reporting success.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;HTTP status&lt;/th&gt;
&lt;th&gt;Application behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Ask for a supported public Reel URL and check the JSON.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;401 / 403&lt;/td&gt;
&lt;td&gt;Check the marketplace subscription and consumer key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;td&gt;Mark this source as unavailable; do not repeatedly retry it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;429&lt;/td&gt;
&lt;td&gt;Check allowance, slow requests, and respect &lt;code&gt;Retry-After&lt;/code&gt; when present.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;502 / 503 / 504&lt;/td&gt;
&lt;td&gt;Offer a later retry with bounded backoff.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Avoid aggressive retry loops. They consume capacity and cannot make deleted or restricted content available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose a plan after a successful test
&lt;/h2&gt;

&lt;p&gt;RapidAPI BASIC currently includes 20 requests/month. API.market has a 7-day trial with 20 API units total. PRO is $9.99/month for 250 requests or API units; ULTRA is $24.99/month for 1,000. Request allowances use hard limits; RapidAPI also displays a separate bandwidth platform fee. Review the actual marketplace billing page before subscribing.&lt;/p&gt;

&lt;p&gt;Try one authorized Reel first, then estimate your monthly volume. For a tool that already has a media library or review workflow, this API provides the resolution step; your application owns the import experience, permissions, and any media retention.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rapidapi.com/cqqrory/api/instagram-reel-video-metadata-api" rel="noopener noreferrer"&gt;Try on RapidAPI&lt;/a&gt; · &lt;a href="https://api.market/store/cqqrory/public-reel-media-resolver" rel="noopener noreferrer"&gt;API.market&lt;/a&gt; · &lt;a href="https://www.postman.com/flychjs-team/instagram-reel-video-metadata-api/collection/5i6755n/instagram-reel-video-metadata-api" rel="noopener noreferrer"&gt;Postman collection&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Questions about integrating your creator or client workflow? Contact &lt;a href="mailto:cqqrory@gmail.com"&gt;cqqrory@gmail.com&lt;/a&gt; with your use case and expected monthly volume. Please send no API keys or account credentials.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>api</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
