Skip to content

ereli/InstaMassUnliker

 
 

Repository files navigation

InstaMassUnliker

Bulk-unlike Instagram posts using a local Typer CLI managed by uv.

Requirements

  • uv
  • Python 3.10 or newer (uv can install it)
  • An Instagram data export in JSON format
  • Your Instagram sessionid browser cookie

Install

git clone git@github.com:ereli/InstaMassUnliker.git
cd InstaMassUnliker
uv sync
uv run insta-unliker --help

Do not use sudo. uv creates an isolated .venv and installs the locked dependencies there.

There is no run.sh or other installer script — use uv sync and uv run insta-unliker for all commands.

Download your liked-post history

You need liked_posts.json in the project root before running unlike. If it is missing, the CLI prints step-by-step instructions.

Request the archive from Instagram

  1. Open Accounts Center.
  2. Select Your information and permissions.
  3. Select Download your information and choose the Instagram account.
  4. Request Some of your informationLikes.
  5. Choose Download to device, All time, and JSON format.
  6. Download the ZIP when Instagram notifies you it is ready (this can take hours or days).

Extract liked_posts.json from the ZIP

Inside the archive, the file is at:

your_instagram_activity/likes/liked_posts.json

Extract it into the project root (replace DOWNLOAD.zip with your file):

unzip -j ~/Downloads/DOWNLOAD.zip your_instagram_activity/likes/liked_posts.json -d .
chmod 600 liked_posts.json

Or unzip the archive fully and copy the file:

unzip ~/Downloads/DOWNLOAD.zip -d ~/Downloads/instagram-export
cp ~/Downloads/instagram-export/your_instagram_activity/likes/liked_posts.json ./liked_posts.json
chmod 600 liked_posts.json

Instagram exports may encode the file as either an object containing likes_media_likes or as a top-level array. Both formats are supported.

Keep the downloaded original as a backup. The application removes completed entries from its local copy to checkpoint progress.

Add your account

uv run insta-unliker account add

The command asks for your username and sessionid cookie. To find the cookie:

  1. Sign in at https://www.instagram.com.
  2. Open browser developer tools.
  3. Open Application or StorageCookieshttps://www.instagram.com.
  4. Copy the value of the sessionid cookie.

The cookie is hidden while entered and stored in accounts/USERNAME.json with owner-only permissions. It grants access to your logged-in account: never share or commit it. Log out that Instagram session when finished to revoke it.

Run

uv run insta-unliker unlike USERNAME

Example:

uv run insta-unliker unlike erelie

Press Ctrl+C once for a safe stop. Successful items are removed from liked_posts.json, and remaining entries are preserved for the next run.

Other commands:

uv run insta-unliker account list
uv run insta-unliker account remove USERNAME
uv run insta-unliker stats
uv run insta-unliker config
uv run insta-unliker menu

Configuration

Runtime settings live in config.json:

{
  "delay": {"min": 0.8, "max": 2.0},
  "break": {"min": 300, "max": 900, "probability": 0.0005},
  "accounts": {},
  "max_retries": 3,
  "retry_delay": 10,
  "error_cooldown": 30,
  "checkpoint_every": 25,
  "stop_on_unlike_failure": true
}

Longer delays reduce request frequency but do not guarantee that Instagram will permit or ignore automation.

Safety

  • This project uses an unofficial Instagram API. Instagram can change or block it without warning.
  • Automated access may violate Instagram's terms and can trigger rate limits, challenges, or account restrictions.
  • The session cookie is stored locally in plaintext.
  • accounts/, logs/, and liked_posts.json are excluded by .gitignore.
  • Do not commit other files from your Instagram export; they may contain private account data.
  • Claims that automation is undetectable are not credible. Use this only if you accept the account risk.

Development

uv sync
uv run pytest

Tests do not make live Instagram requests.

Licensed under the MIT License.

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 95.2%
  • Batchfile 4.8%