javascript instagram media downloader

How can we download Instagram videos and photos using the HTML CSS JavaScript program? Solution: See this JavaScript Instagram Media Downloader. In other words, Program For Save Instagram Photos & Videos.

Previous I have shared JS Random Password Generator for social media, but this is for download Instagram’s media. Basically, Instagram is the largest media sharing social platform in the world. And our idols and favorite celebrities are on this network. Sometimes we like any photos or videos and want to save it offline but, we can’t save or download Instagram media directly. Then we have to go a third-party website for download media, but we can create a program for that work.

Today you will learn to create a program for Save Insta Photos & Videos. Basically there is a text input field, a button, and a dummy image. When you will put a valid Instagram photo or video linked to the input field and click on the button then the image will visible by replacing the dummy image. After the image appearance, you click save it by right click on the mouse.

So, Today I am sharing JavaScript Instagram Media Downloader. This program is completely based on JavaScript, no other libraries used in there. The program getting the image or video and shows on the page and you can save it locally. Peoples search for Instagram downloader, you can take this script and use it your website to getting visitors.

If you are thinking now how this Instagram downloader actually is, then see the preview given below.

Preview Of Save Insta Photos & Videos Program

See this video preview to getting an idea of how this save photos and videos program looks like.

Live Demo

Now you can see this visually, you can also see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

JavaScript Instagram Media Downloader Source Code

Before sharing source code, let’s talk about it. First I have created a header and a section using HTML. The header for placing the blank input and the button and the section for showing the image and massage. Also in the HTML file, I have linked the other files like JavaScript and CSS. HTML has very little part in this program, it just creating the layout and frame of the program.

Now using CSS, I have placed all the elements in the right place, as you can see in the preview. I just styled the header section and input fields, also I placed a dummy image in the image section by default. This a responsive design, for creating that I have used CSS @media query and resize the elements according to small screen size.

JavaScript doing here the main work of the program, the whole program is based on JS. There I have used JavaScript const statement in the whole program (info). There I have created 3 sections of codes, first for getting video, second for getting the image, and third for the printing media like photos and videos. In the JS file, I left comments on every section for easy understanding.

Left all other things you will learn after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files for that. First for HTML, second for CSS, and the third one for JavaScript. Follow the steps to creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

function.js

The final step, Create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created JavaScript Instagram Media Downloader, Save Insta Photos & Videos Program. If you have any doubt or questions comment down below.

Thanks For Visiting, Keep Visiting.

15 COMMENTS

  1. Hello Shaan! I needed your help. I was creating a ‘Newsletter Sign Up Form’ for my blog. I have the image of how it should should look, but, I am not able to create it. So, please can you help me in creating that sign up form? If yes, then thanks a lot. This is the image of how my form should look – http://bit.ly/31QTCiq

  2. If the video or image link has multiple video/image then i couldnt able to get that. in that case what should i do??please help me

  3. Hey buddy
    Thanks for this code and I also want to ask you something.
    I have used this code in my site and also done some modifications. But the code is not adjusting according to mobile devices screen. Please provide some solution for that.

    • heyy you can use the above meta tag into your of the html. tht will create your webpage…..compatible with all the devices with the device width

  4. I love you. Thank you so much. This solution is better than Instagram’s own OEmbed api solution for sharing IG posts on my website, and IDGAF if it violates their TOS. Their embeds take up way too much space with controls that do nothing except redirect to Instagram (just cluttering my page with excessive branding), and they are not as responsive as what you can get with the solution you have here. Furthermore, their embeds are iframes and so there is no way of binding to video events like play, pause, ready, etc.

    I love you x1000

    -Isaac

      • UPDATE: It is December 18/2020 and I can confirm this demo still works. Thank you so much to the author Shaan!! I was trying to access the video element of instagram embedss but accessing the iframe, but it wouldnt let me access the inner elements of the instagram iframe embed, do you know why this is? Im so glad I found this solution, thank you so much. However, I am still unsure on how you are getting the video data, what exactly is ‘meta[property=”og:video”]’ and how does it work, thanks!!

  5. Hello, tahnk you so much! Only one thing tho, this doesnt work for instagram posts with multiple videos. The meta[property=”og:video”] tage doesnt show up in that repsonse html. Any work around to this?

  6. Have you checked the application before publishing on Website. The script is not working.

    I would suggest just check before publish on website and help people to save their valuable time.

LEAVE A REPLY

Please enter your comment!
Please enter your name here