DatafetchPro
    Apr 15, 20265 min read12 views

    Instagram Saved Posts Exporter Script – Download URLs, Likes & Comments to CSV Easily

    Export your Instagram saved posts into a clean CSV file with URLs, likes, and comments. A simple one-click script to organize, analyze, and use your saved content more effectively.

    There’s something satisfying about saving posts on Instagram—ideas, inspiration, products, or content you want to revisit later. But after a while, your saved collection turns into a black hole. You know there’s something valuable in there… you just can’t easily organize or extract it.

    That’s where this simple script changes everything.

    Instead of manually opening each saved post and noting down details, this tool lets you export all your saved posts into a clean CSV file. With a single click, you get a list of post URLs along with their likes and comments—ready to use in Excel, Google Sheets, or your own workflow.





    Why this is useful

    If you’re someone who saves a lot of posts, this can quickly become a powerful resource.

    • Content research – See what type of posts get high engagement
    • Lead collection – Track posts from potential clients or niches
    • Inspiration library – Organize ideas outside Instagram
    • Data analysis – Understand trends without scrolling endlessly

    Instead of being stuck inside the app, your data becomes something you can actually work with.


    How it works (simple idea)

    Once you install the script using a browser extension like Tampermonkey, it adds a clean button on your saved posts page.

    Click the button → it scans visible posts → collects:

    • Post URL
    • Number of likes
    • Number of comments

    Then it instantly downloads a CSV file.

    No complicated setup. No login hacks. Just a practical shortcut.


    What makes it different

    A lot of tools overcomplicate things. This one keeps it simple:

    • Works directly on your saved posts page
    • No external servers or APIs
    • Clean CSV output (ready to use)
    • Minimal clicks

    It behaves like a lightweight assistant quietly doing the boring work for you.


    Best way to use it

    To get the most out of it:

    • Scroll through your saved posts first (load more content)
    • Then click export
    • Open the CSV in Excel or Google Sheets
    • Filter, sort, and analyze

    If you’re doing scraping, outreach, or automation, this becomes even more powerful when combined with your own workflows.


    Final thoughts

    This isn’t just about exporting data—it’s about turning saved content into something useful.

    Instead of letting posts sit idle inside Instagram, you can now:

    • Analyze them
    • Organize them
    • Use them for business or content strategy

    Small tool. Big leverage.


    // ==UserScript==
    // @name Instagram Saved Posts Exporter
    // @namespace http://tampermonkey.net/
    // @version 1.0
    // @description Export saved Instagram posts (URLs, likes, comments) to CSV.
    // @author You
    // @match https://www.instagram.com/*/saved/*
    // @grant none
    // ==/UserScript==

    (function () {
    'use strict';

    // --- 1. Create and Style the Export Button ---
    const exportBtn = document.createElement('button');
    exportBtn.innerText = 'Export Saved Posts';
    exportBtn.style.position = 'fixed';
    exportBtn.style.top = '20px';
    exportBtn.style.right = '20px';
    exportBtn.style.zIndex = '9999';
    exportBtn.style.padding = '12px 24px';
    exportBtn.style.color = 'white';
    exportBtn.style.fontWeight = 'bold';
    exportBtn.style.border = 'none';
    exportBtn.style.borderRadius = '8px';
    exportBtn.style.cursor = 'pointer';
    exportBtn.style.boxShadow = '0 4px 6px rgba(0,0,0,0.1)';
    // Instagram gradient color scheme
    exportBtn.style.background = 'linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%)';

    document.body.appendChild(exportBtn);
    async function waitForStats(post, timeout = 1000) {
    const start = Date.now();

    while (Date.now() - start < timeout) {
    const stats = post.querySelectorAll('ul li');
    // Check if the UL has rendered and has text content
    if (stats.length > 0 && stats[0].innerText.trim() !== "") {
    return stats;
    }
    // Small interval between checks (50ms)
    await new Promise(res => setTimeout(res, 50));
    }
    return null; // Return null if it never appeared
    }
    // --- 2. Export Logic ---
    exportBtn.addEventListener('click', async () => {
    // Select all post links
    const posts = document.querySelectorAll('a[href^="/p/"]');

    if (posts.length === 0) {
    alert('No saved posts found. Make sure the page is fully loaded.');
    return;
    }

    let csvContent = "URL,Likes,Comments\n";

    for (const post of posts) {
    // Get the full URL
    const url = post.href;
    post.scrollIntoView({ block: 'center', behavior: 'smooth' });

    const eventProps = {

    bubbles: true,

    cancelable: true,

    composed: true,

    view: window,

    buttons: 0

    };



    // 2. Dispatch a sequence of events to fool the React listeners

    post.dispatchEvent(new PointerEvent('pointerover', eventProps));

    post.dispatchEvent(new PointerEvent('pointerenter', eventProps));

    post.dispatchEvent(new MouseEvent('mouseover', eventProps));

    // 2. Short pause (50ms) to allow the DOM to update with the <ul>

    await waitForStats(post, 500);

    let likes = "0";

    let comments = "0";



    // Instagram usually hides the ul/li for likes and comments inside the anchor tag until hovered.

    // Even if hidden, the DOM often contains them. We look for the 'ul li' elements.

    const listItems = post.querySelectorAll('ul li');



    if (listItems.length >= 2) {

    // Typically, the first li is Likes and the second is Comments

    // We remove commas so it doesn't break the CSV format

    likes = listItems[0].innerText.replace(/,/g, '').trim() || "0";

    comments = listItems[1].innerText.replace(/,/g, '').trim() || "0";

    }else if(listItems.length >= 1) {

    likes = listItems[0].innerText.replace(/,/g, '').trim() || "0";

    }



    // Append to CSV string

    post.dispatchEvent(new MouseEvent('mouseout', { bubbles: true }));

    csvContent += `${url},${likes},${comments}\n`;

    };



    // --- 3. Trigger CSV Download ---

    const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });

    const downloadLink = document.createElement("a");

    const downloadUrl = URL.createObjectURL(blob);



    downloadLink.setAttribute("href", downloadUrl);

    downloadLink.setAttribute("download", "instagram_saved_posts.csv");

    downloadLink.style.visibility = 'hidden';



    document.body.appendChild(downloadLink);

    downloadLink.click();

    document.body.removeChild(downloadLink);

    });



    })();

    0