VOOZH about

URL: https://apify.com/zen-studio/instagram-login

⇱ Instagram Login API with 2FA | Session Cookie Authentication Β· Apify


πŸ‘ Instagram Login API with 2FA | Session Cookie Authentication avatar

Instagram Login API with 2FA | Session Cookie Authentication

Pricing

from $0.09 / login

Go to Apify Store

Instagram Login API with 2FA | Session Cookie Authentication

Login to Instagram with email/password and two-factor authentication. Stores session cookies server-side for use with the Instagram Automation API. No browser needed.

Pricing

from $0.09 / login

Rating

0.0

(0)

Developer

πŸ‘ Zen Studio

Zen Studio

Maintained by Community

Actor stats

0

Bookmarked

58

Total users

14

Monthly active users

a day ago

Last modified

Share

Instagram Login & Cookie Extractor | 2FA Support

Log in to Instagram programmatically and extract session cookies. Handles email verification and two-factor authentication. No browser required.

RELATED ACTORS

Instagram ➀Instagram Automation API
  • Session cookies β€” Returns sessionid, csrftoken, ds_user_id, and browser fingerprint cookies
  • 2FA support β€” Handles email verification codes and authenticator apps
  • Residential proxies β€” Country selection to match your usual login location
  • No browser β€” Direct GraphQL authentication, fast and lightweight

Try it free

Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

zen-studio/instagram-login on Apify. Call:ApifyClient("TOKEN").actor("zen-studio/instagram-login").call(run_input={...}), then client.dataset(run["defaultDatasetId"]).list_items().items for results. Key inputs:email(string, required),password(string),code(string). Full actor spec(input schema with all params/enums/defaults, output dataset fields,README):GEThttps://api.apify.com/v2/acts/zen-studio~instagram-login/builds/default(Bearer TOKEN) β†’ inputSchema, actorDefinition.storages.dataset, readme. Pricing: login $0.099/login. Get token: https://console.apify.com/account/integrations

How It Works

  1. Run 1 (Login) β€” Provide email + password. If the account has no 2FA, returns cookies immediately. If 2FA is enabled, returns pending_2fa and triggers the verification code.

  2. Run 2 (Verify) β€” Provide email + code (the 6-digit code from your email or authenticator app). Completes authentication and returns cookies.

Output

Successful Login

{
"status":"ok",
"email":"your_email",
"message":"Login successful (no 2FA required)",
"ds_user_id":"548591854",
"cookies":{
"sessionid":"548591854%3AaBcDeFgHiJkL%3A1",
"csrftoken":"aBcDeFgHiJkLmNoPqRsTuV",
"ds_user_id":"548591854",
"datr":"xY2aBcDeFgHiJk",
"mid":"ZaBcDeFgHiJkLm",
"ig_did":"A1B2C3D4-E5F6-7890-ABCD-EF1234567890"
}
}

Pending 2FA

{
"status":"pending_2fa",
"email":"your_email",
"message":"Enter the code that we sent to y***@e*****.com"
}

Error

{
"status":"error",
"error_code":"invalid_password",
"message":"The password you entered is incorrect"
}

Quick Start

Login (No 2FA)

{
"email":"your_instagram_email",
"password":"your_password",
"country":"US"
}

Login (With 2FA)

Step 1 β€” Start login:

{
"email":"your_instagram_email",
"password":"your_password",
"country":"US"
}

Output: status: "pending_2fa" β€” check your email for the code.

Step 2 β€” Submit code:

{
"email":"your_instagram_email",
"code":"123456"
}

Output: status: "ok" with session cookies.

Input Parameters

ParameterTypeRequiredDescription
emailstringYesInstagram email or username
passwordstringFor loginInstagram password (not needed for 2FA completion)
codestringFor 2FA6-digit verification code from email or authenticator
countrystringNoLogin country code (default: US)

Login Country

Use the country where your Instagram account is normally accessed from. Logging in from an unexpected location may trigger additional security challenges.

API Integration

Python

from apify_client import ApifyClient
client = ApifyClient("your_token")
# Step 1: Start login
run = client.actor("zen-studio/instagram-login").call(run_input={
"email":"your_email",
"password":"your_password",
"country":"US",
})
result = client.dataset(run["defaultDatasetId"]).list_items().items[0]
if result["status"]=="pending_2fa":
code =input("Enter 2FA code: ")
# Step 2: Complete 2FA
run = client.actor("zen-studio/instagram-login").call(run_input={
"email":"your_email",
"code": code,
})
result = client.dataset(run["defaultDatasetId"]).list_items().items[0]
# Use cookies in your own requests
cookies = result["cookies"]
print(f"Session ID: {cookies['sessionid']}")

JavaScript

import{ ApifyClient }from'apify-client';
const client =newApifyClient({token:'your_token'});
// Step 1: Start login
let run =await client.actor('zen-studio/instagram-login').call({
email:'your_email',
password:'your_password',
country:'US',
});
let{ items }=await client.dataset(run.defaultDatasetId).listItems();
if(items[0].status ==='pending_2fa'){
// Step 2: Complete 2FA
run =await client.actor('zen-studio/instagram-login').call({
email:'your_email',
code:'123456',
});
({ items }=await client.dataset(run.defaultDatasetId).listItems());
}
// Use cookies in your own requests
const{ cookies }= items[0];
console.log(`Session ID: ${cookies.sessionid}`);

Pricing

Pay-per-event pricing. You only pay for successful logins.

EventPrice
Actor start$0.00005
Successful login$0.099

Failed logins, pending 2FA states, and errors are not charged.

FAQ

Q: How long do sessions last? A: Sessions typically last days to weeks depending on account activity and Instagram's security policies.

Q: What if I enter the wrong 2FA code? A: The actor returns an error. Run it again with the correct code. The pending state persists between runs.

Q: Does this work with authenticator apps? A: Yes. Any 6-digit TOTP code from Google Authenticator, Authy, or similar apps works.

Q: Why use a specific login country? A: Instagram flags logins from unusual locations. Use the country where you normally access your account to avoid additional security challenges.

Legal Compliance

This actor authenticates with credentials you provide for your own Instagram account. You are responsible for complying with Instagram's Terms of Service and applicable data protection regulations.


Start Using Instagram Login

You might also like

Instagram Profile Scraper ⚑ No Login Required

vulnv/instagram-profile-scraper

Extract comprehensive data from public Instagram profiles including follower counts, following counts, posts data, bio information, and profile details. Bulk processing supported. No Instagram authentication needed - just provide profile URLs and get structured JSON data.

Instagram Profile Scraper – Cheap & Fast πŸ“ΈπŸ”βœ¨

contactminerlabs/instagram-profile-scraper---cheap-fast

πŸ” Scrape Instagram Profiles Instantly Enter a keyword & extract highly relevant Instagram profiles, including username, profile name, bio, followers, following & profile URL πŸ“Š Perfect for lead generation, influencer outreach & enriching your data pipelines across Google Sheets & automation tools

πŸ‘ User avatar

ContactMinerLabs

39

Email Data Breach Checker

lofomachines/email-breach-checker

Check if your email has been compromised in a data breach. Scan one or hundreds of emails in bulk to find leaked passwords, exposed accounts, and stolen credentials. Get a full risk score, breach history, and affected sites β€” fast, accurate, and affordable.

89

Instagram Story Details Scraper

louisdeconinck/instagram-story-details-scraper

Extract detailed Instagram stories data for data analysis, content monitoring, and competitor research. Does not require authentication or login. Fast & easy to use. Supports photo & video stories.

πŸ‘ User avatar

Louis Deconinck

1.3K

4.7

Instagram Stories Downloader Scraper

datavoyantlab/instagram-story-downloader

Fast, secure Instagram Stories scraper to download public IG stories. Export to CSV, JSON, Excel, or HTML. No login or cookies required. Automate via API, Zapier, or webhooks

1.1K

4.8

Instagram Story Downloader

easyapi/instagram-story-downloader

Download Instagram stories effortlessly! Save photos and videos from multiple accounts simultaneously while preserving original quality. Perfect for content creators, social media managers, and anyone wanting to archive Instagram stories. πŸš€

Instagram Stories Scraper Downloader

louisdeconinck/instagram-stories-scraper

Efficiently extract and download all stories from your chosen Instagram profiles, enabling you to stay updated and engaged with the latest content effortlessly. Does not require authentication or login. Fast & easy to use. Supports photo & video stories.

πŸ‘ User avatar

Louis Deconinck

529

1.3

Instagram Story Scraper

gordian/instagram-story-scraper

Permanently save Instagram Stories before they vanish: Scrape high-quality media and extract captions with AI in seconds.

πŸ”₯ Instagram Profile Scraper API

coderx/instagram-profile-scraper-api

Instagram Profile Insights Scraper is a fast and lightweight tool for extracting rich public data from Instagram usernames. It retrieves profile details and the latest posts, making it easy to analyze accounts at scale for research, marketing, or competitive insights.