When scraping images from Instagram, users often encounter the issue of downloaded images having unsatisfactorily low resolution. Therefore, improving image resolution has become a primary concern. Using browser extensions can help retrieve higher-resolution images. This article introduces two methods—choose the one that best suits your needs.
The root cause of this issue lies in the differentiated restrictions imposed by Instagram’s API based on access permissions:
When in a logged-out state, even when sending requests through the public API, Instagram only provides access to images at a basic resolution (commonly 1080p), making it impossible to obtain higher-quality versions.
Once logged in, authenticated users gain access to higher-resolution media files, such as 1440p HD versions.
This distinction is further emphasized by the differences in how tools operate: By default, Instaloader runs in an unauthenticated mode, so it can only retrieve images at the base 1080p resolution. In contrast, browser extensions operate within the context of a user’s logged-in session, effectively inheriting authenticated access permissions, which allows them to directly obtain higher-resolution media.
Method 1: Using Login Authentication
To obtain the highest resolution of Instagram images, login authentication is required: instaloader --login=your_username --no-captions --no-metadata-json target_username
After logging in, Instaloader can simulate requests from an authenticated user, gaining access to API endpoints that provide the highest resolution image links.
Method 2: Directly Using download_post()
Simple Example:
Python
import instaloader
# 1. Create an Instaloader instance
L = instaloader.Instaloader(
# Optionally, customize the download settings
download_pictures=True,
download_videos=False, # Download only images
download_video_thumbnails=False,
download_geotags=False,
download_comments=False,
save_metadata=False, # For brevity, metadata files can be left unsaved
compress_json=False,
)
# 2. Get targeted posts
try:
post = instaloader.Post.from_shortcode(L.context, "C_AbcDef12345") # ⚠️ Replace with a shortcode for a real post
print(f"? Downloading post: {post.shortcode}")
print(f" - Image URL (highest resolution): {post.url}")
print(f" - Image size: {post.dimensions[0]}x{post.dimensions[1]}") # Print it out in its original size
# 3. Perform the download
L.download_post(post, target="high_res_images")
print(f"✅ Download complete! The image has been saved to the 'high_res_images' folder.")
except instaloader.exceptions.NotFoundException:
print("❌ Error: Post not found. Please check that the shortcode is correct.")
except Exception as e:
print(f"❌ An error occurred: {e}")