Back to Blog
TechnicalMarch 23, 20268 min read

Instagram Scraping API: How to Automate Data Extraction

Automate Instagram data extraction with APIs. Code examples in Python, Node.js, and cURL included.

An Instagram scraping API lets you programmatically extract data from Instagram profiles — emails, phone numbers, bios, follower counts, and more. Instead of manual tools or browser extensions, you integrate directly into your app, CRM, or data pipeline.

This guide covers the main API options, how to get started with the IGLeads.ai API, and code examples in cURL, Python, and Node.js.

Why Use an API Instead of Manual Tools?

  • Automation: Trigger extractions from your own app, webhook, or cron job
  • Integration: Pipe leads directly into your CRM, email tool, or database
  • Scale: Process thousands of extractions without manual intervention
  • Consistency: Same output format every time — no manual CSV cleanup

API Options Compared

APIFocusAuthPricingRate Limit
IGLeads.aiLead gen (emails + phones)Bearer token$49-199/mo25-500 req/min
ApifyRaw profile dataAPI token$49/mo+Varies by actor
Bright DataEnterprise scrapingAPI key$500+/moUnlimited (with proxy)
Instagram Graph APIOwn account data onlyOAuthFreeStrict limits

The official Instagram Graph API only lets you access data from accounts you manage — it's useless for lead generation. For extracting data from other profiles, you need a third-party API.

Getting Started with IGLeads.ai API

1. Get your API key

API access is available on all subscription plans (Starter $49/mo, Pro $99/mo, Business $199/mo). Generate your API key from the API dashboard.

2. Create an extraction job

Here's how to extract emails from a competitor's followers:

cURL example:

curl -X POST https://igleads-api.kylian-b16.workers.dev/v1/leads/competitors \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "usernames": ["competitor_username"],
    "limit": 1000
  }'

Python example:

import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://igleads-api.kylian-b16.workers.dev"

# Create extraction job
response = requests.post(
    f"{BASE_URL}/v1/leads/competitors",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "usernames": ["competitor_username"],
        "limit": 1000
    }
)

job = response.json()
job_id = job["jobId"]
print(f"Job created: {job_id}")

# Check job status
status = requests.get(
    f"{BASE_URL}/v1/leads/jobs/{job_id}",
    headers={"Authorization": f"Bearer {API_KEY}"}
)
print(status.json())

# Get results when complete
results = requests.get(
    f"{BASE_URL}/v1/leads/jobs/{job_id}/results",
    headers={"Authorization": f"Bearer {API_KEY}"}
)
leads = results.json()
print(f"Got {len(leads['results'])} leads")

Node.js example:

const API_KEY = "YOUR_API_KEY";
const BASE_URL = "https://igleads-api.kylian-b16.workers.dev";

// Create extraction job
const response = await fetch(`${BASE_URL}/v1/leads/competitors`, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    usernames: ["competitor_username"],
    limit: 1000
  })
});

const job = await response.json();
console.log("Job created:", job.jobId);

// Poll for results
const results = await fetch(
  `${BASE_URL}/v1/leads/jobs/${job.jobId}/results`,
  { headers: { "Authorization": `Bearer ${API_KEY}` } }
);

const leads = await results.json();
console.log(`Got ${leads.results.length} leads`);

Available Endpoints

EndpointMethodDescription
POST /v1/leads/competitorsPOSTExtract emails from competitor followers
POST /v1/leads/hashtagPOSTFind leads by hashtag
POST /v1/leads/locationPOSTExtract by location
POST /v1/leads/hotPOSTAI-detected hot leads
POST /v1/leads/networkPOSTSee who an account follows
POST /v1/leads/enrichPOSTEnrich existing Instagram IDs
GET /v1/leads/jobsGETList all your jobs
GET /v1/leads/jobs/:idGETCheck job status
GET /v1/leads/jobs/:id/resultsGETDownload results
PATCH /v1/leads/jobs/:id/stopPATCHStop a running job

Rate Limits

Rate limits depend on your subscription plan:

PlanRate LimitMonthly Quota
Starter ($49/mo)25 requests/min5,000 emails
Pro ($99/mo)100 requests/min15,000 emails
Business ($199/mo)500 requests/min50,000 emails

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.

Best Practices

  • Poll, don't wait. Extraction jobs run asynchronously. Create the job, then poll the status endpoint every 30-60 seconds until it completes.
  • Use partial results. For large jobs, use the /partial-results endpoint to start processing leads before the job finishes.
  • Handle rate limits gracefully. Implement exponential backoff when you receive 429 responses.
  • Store your API key securely. Never expose it in client-side code or public repositories.

Building a Complete Pipeline

A typical automated lead generation pipeline looks like this:

  • Step 1: Cron job triggers daily extraction from target competitors
  • Step 2: IGLeads.ai API extracts and verifies emails
  • Step 3: Webhook or poll delivers results to your app
  • Step 4: Deduplicate against existing contacts in your CRM
  • Step 5: New leads automatically added to your outreach sequence (Instantly, Lemlist, etc.)

For full API documentation, visit the developer docs. For a non-technical overview of what's possible, read our Instagram lead generation guide.

Get API Access

API access starts with any subscription plan. Sign up free, test with 100 leads via the dashboard, then upgrade to a plan for API access. The Starter plan ($49/mo) includes 5,000 emails and 25 requests/minute — enough for most teams.

Ready to extract Instagram leads?

Get 100 free leads and see the quality difference. No credit card required.