Pricing
from $10.00 / 1,000 results
Instagram Post Scraper - Video url included
Given an instagram.com post/reel URL, extracts the direct CDN URL of the post's video, and of course relevant post info
Pricing
from $10.00 / 1,000 results
Rating
5.0
(1)
Developer
Actor stats
1
Bookmarked
15
Total users
10
Monthly active users
6 hours ago
Last modified
Categories
Share
Extracts direct video URLs and post metadata from Instagram post/reel URLs.
Auth
The scraper can run unauthenticated for some public posts. Instagram blocks logged-out scraping aggressively, so authenticated cookies are recommended for reliable actor runs.
Local CLI profile login
This only works for local CLI runs. Apify actors cannot run an interactive login flow.
Run once with a persistent browser profile and a visible browser:
$uv run python main.py --login --user-data-dir .instagram-profile
Log in to Instagram in the opened browser, then press Enter in the terminal. Later local runs can reuse that session:
$INSTAGRAM_USER_DATA_DIR=.instagram-profile uv run python main.py --print-only 'https://www.instagram.com/reel/SHORTCODE/'
You can also pass the profile path directly:
$uv run python main.py --user-data-dir .instagram-profile --print-only 'https://www.instagram.com/reel/SHORTCODE/'
Cookies
For local CLI runs, provide cookies with INSTAGRAM_COOKIES or --cookies.
The value can be either a raw Cookie header:
$INSTAGRAM_COOKIES='sessionid=...; csrftoken=...; ds_user_id=...' uv run python main.py --print-only 'https://www.instagram.com/reel/SHORTCODE/'
or a JSON cookie export array:
[{"name":"sessionid","value":"...","domain":".instagram.com","path":"/","secure":true}]
For Apify, cookies are not part of input_schema.json. The actor reads the
secret user_cookies environment variable instead. .actor/actor.json maps
that variable to the local Apify CLI secret @instagramCookies, which is
uploaded as an encrypted platform secret during apify push.
The Hermes daily deploy job refreshes instagramCookies from a persistent local
Chromium profile before running apify run --purge and apify push --force.
Initialize or repair that profile manually when it is logged out:
$uv run python main.py --login --user-data-dir .instagram-profile
After login, the cron script extracts a fresh Cookie header from
.instagram-profile, updates the local Apify secret, tests locally, and deploys:
$~/.hermes/profiles/apify-mgr/scripts/refresh_instagram_scraper.sh
Do not use the local --login flow inside actor runs; it is only for preparing
the persistent local profile used by the cron job. Do not commit cookies or
profile directories.
