Here's how to create a free Instagram reels downloader website:
- Create a simple frontend using HTML/CSS/JavaScript
- Use Vercel or Netlify for free hosting
- Set up a serverless function to handle the download logic
- Deploy your site
Let me write a basic implementation you can use with Vercel:
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reels Downloader</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
input {
width: 100%;
padding: 10px;
margin-bottom: 10px;
}
button {
padding: 10px 15px;
background: #0095f6;
color: white;
border: none;
cursor: pointer;
}
#result {
margin-top: 20px;
}
</style>
</head>
<body>
<h1>Instagram Reels Downloader</h1>
<input type="text" id="reelUrl" placeholder="Paste Instagram Reel URL here">
<button onclick="downloadReel()">Download</button>
<div id="result"></div>
<script>
async function downloadReel() {
const url = document.getElementById('reelUrl').value;
const resultDiv = document.getElementById('result');
if (!url) {
resultDiv.innerHTML = "Please enter a valid URL";
return;
}
resultDiv.innerHTML = "Processing...";
try {
const response = await fetch('/api/download', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ url })
});
const data = await response.json();
if (data.success && data.downloadUrl) {
resultDiv.innerHTML = `
<p>Download ready!</p>
<a href="${data.downloadUrl}" target="_blank">Click here to download</a>
`;
} else {
resultDiv.innerHTML = `Error: ${data.message || 'Could not process this URL'}`;
}
} catch (error) {
resultDiv.innerHTML = `Error: ${error.message}`;
}
}
</script>
</body>
</html>
Now create a serverless function for Vercel:
// api/download.js
const axios = require('axios');
const cheerio = require('cheerio');
module.exports = async (req, res) => {
try {
if (req.method !== 'POST') {
return res.status(405).json({ success: false, message: 'Method not allowed' });
}
const { url } = req.body;
if (!url || !url.includes('instagram.com')) {
return res.status(400).json({ success: false, message: 'Invalid Instagram URL' });
}
// This is a simplified example. In reality, you'd need to:
// 1. Fetch the Instagram page
// 2. Parse it to find the video URL
// 3. Return that URL or proxy the content
// For demonstration purposes only:
const response = await axios.get(url);
const $ = cheerio.load(response.data);
// This is a placeholder - actual Instagram scraping is more complex
// and may require different approaches as Instagram updates their site
const videoUrl = $('meta[property="og:video"]').attr('content');
if (!videoUrl) {
return res.status(404).json({ success: false, message: 'Video not found' });
}
return res.status(200).json({
success: true,
downloadUrl: videoUrl
});
} catch (error) {
console.error(error);
return res.status(500).json({ success: false, message: 'Server error' });
}
};
Steps to deploy:
- Create a new folder for your project
- Save the HTML file as
index.html in a public folder
- Save the serverless function as
api/download.js
- Create a
package.json file:
{
"name": "reels-downloader",
"version": "1.0.0",
"dependencies": {
"axios": "^0.27.2",
"cheerio": "^1.0.0-rc.12"
}
}
- Push to GitHub
- Connect your GitHub repo to Vercel and deploy
Important notes:
- Instagram regularly changes their site structure, so this basic scraping approach may break
- Instagram's terms of service may not allow this kind of scraping
- For a more reliable solution, you might need to use a third-party API service, but those usually require payment
Would you like me to explain or break down any part of this code?