{
  "version": 1,
  "slug": "scrape-instagram-followers-python-api",
  "title": "How to Scrape Instagram Followers in Python Using an API",
  "excerpt": "Scrape Instagram followers from two public profiles with Python, compare the collected audiences by user ID, and enrich shared profiles for research.",
  "cover": {
    "src": "/howto_images/scrape-instagram-followers-python-api/scrape-instagram-followers-python-api-cover.png",
    "optimized": "https://www.datablist.com/_next/image?url=%2Fhowto_images%2Fscrape-instagram-followers-python-api%2Fscrape-instagram-followers-python-api-cover.png&w=1200&q=75"
  },
  "url": "https://www.datablist.com/how-to/scrape-instagram-followers-python-api",
  "contentMarkdown": "\nYou can scrape Instagram followers in Python by sending one or more public\nprofile usernames, URLs, or numeric user IDs to Datablist's **[Instagram\nFollowers Scraper API](/apis/instagram-followers-scraper)** with the Requests\nlibrary. The API returns follower records as JSON and identifies the source\nprofile behind every relationship.\n\nThis guide starts with the followers collected for [Jupiter\nHikes](https://jupiterhikes.com/about/), a long-distance hiker and filmmaker.\nI then reuse the same Python function to compare his collected followers with\nthose of [Darwin on the Trail](https://www.darwinonthetrail.com/), another\nlong-distance hiker and outdoor filmmaker. The code groups the results by numeric\nInstagram user ID and finds the users present in both collected lists.\n\n> 🔑 **Summary For Those In a Rush**\n>\n> Use Datablist's **Instagram Followers Scraper API** to scrape followers from\n> public Instagram profiles with Python. Submit the profiles you want to scrape,\n> set a per-profile limit, and retrieve the available follower records as JSON\n> for your own research or marketing workflow. Check that Instagram lets you\n> browse each profile's followers before starting.\n>\n> - **Input:** Instagram usernames, profile URLs, or numeric user IDs.\n> - **Output:** Follower records with user IDs, available profile details, and the source profile each follower came from.\n\n> 💡 **Prefer a no-code solution?** Use Datablist's **[Instagram Followers\n> source](/sources/instagram-followers)** to generate follower rows without\n> writing code.\n\nThe [collection-based Instagram follower\nguide](/how-to/scrape-instragram-follower-of-influencer) covers the same source\nthrough the Datablist interface. The rest of this guide focuses on the API.\n\n## Check if Instagram limits the follower list {#instagram-follower-visibility}\nBefore submitting a scrape, open the target Instagram profile and click\n***Followers***. Check that you can browse the follower list. A public profile\ndoes not guarantee that Instagram exposes all its followers.\n\nIf you see **“Only [username] can see all followers,”** expect a partial list\nfrom the scraper, even for a public profile. The API can retrieve only the\nfollowers Instagram makes available; increasing the requested limit does not\nmake hidden followers accessible.\n\n![The follower visibility notice on Levi’s Instagram profile.](/howto_images/scrape-instagram-followers-python-api/follower-visibility-notice.png)\n\nCheck each profile you plan to scrape so you know whether its available follower\nlist is sufficient for your task before starting the API request.\n\n## Set up Python and your Datablist API key {#set-up-python-and-your-datablist-api-key}\nDatablist REST API access is included with the Growth plan. Source tasks also\nconsume credits. I break down the follower-source cost after the walkthrough.\n\nCreate a Personal API Key from your [Datablist API account\npage](https://app.datablist.com/account/api). For this example, I use the\n`requests` package. Create a project folder, open it in a terminal, and run:\n\n```shell\npython -m venv .venv\nsource .venv/bin/activate\npython -m pip install requests\n```\n\nCreate a file named `scrape_instagram_followers.py`, then put your key in the\n`DATABLIST_API_KEY` environment variable:\n\n```shell\nexport DATABLIST_API_KEY=\"your-api-key\"\n```\n\nThe script reads this variable and sends the value through the `X-API-Key`\nheader.\n\n## Scrape Instagram followers with one Python function {#scrape-instagram-followers-with-one-python-function}\nThe first request uses `jupiterhikes`, the username of long-distance hiker and\ncreator Jupiter Hikes. The source also accepts a full profile URL or a numeric\nInstagram user ID string. For example, Jupiter Hikes' numeric ID is\n`\"1507518892\"`.\n\nPaste this complete script into `scrape_instagram_followers.py`:\n\n```python\nimport json\nimport os\nimport time\nimport uuid\n\nimport requests\n\n\ndef scrape_instagram_users(\n    profiles,\n    api_key,\n    scraping_type=\"followers\",\n    limit_per_profile=100,\n):\n    \"\"\"Submit profiles, wait for the source task, and return all generated users.\"\"\"\n    tasks_url = \"https://api.datablist.com/v1/sources/tasks\"\n    headers = {\"X-API-Key\": api_key}\n\n    unique_id = str(uuid.uuid4())\n    print(f\"Task uniqueId: {unique_id}\", flush=True)\n\n    payload = {\n        \"sourceId\": \"instagram-source\",\n        \"uniqueId\": unique_id,\n        \"settings\": {\n            \"profiles\": profiles,\n            \"scrapingType\": scraping_type,\n            \"limitPerProfile\": limit_per_profile,\n        },\n    }\n\n    response = requests.post(tasks_url, headers=headers, json=payload)\n    response.raise_for_status()\n    task = response.json()\n    task_id = task[\"@id\"]\n    task_url = f\"{tasks_url}/{task_id}\"\n    print(f\"Task ID: {task_id}\")\n\n    while task[\"status\"] not in (\"completed\", \"failed\", \"stopped\"):\n        time.sleep(3)\n        response = requests.get(task_url, headers=headers)\n        response.raise_for_status()\n        task = response.json()\n\n    print(f\"Task status: {task['status']}; credits used: {task['credits']['used']}\")\n    if task[\"status\"] != \"completed\":\n        raise RuntimeError(\n            f\"Task {task_id} {task['status']}: {task.get('error')}\"\n        )\n\n    results = []\n    params = {\"limit\": 10}\n    while True:\n        response = requests.get(\n            f\"{task_url}/results\",\n            headers=headers,\n            params=params,\n        )\n        response.raise_for_status()\n        page = response.json()\n        results.extend(page[\"results\"])\n\n        next_cursor = page[\"nextCursor\"]\n        if next_cursor is None:\n            break\n        params[\"cursor\"] = next_cursor\n\n    return results\n\n\nif __name__ == \"__main__\":\n    api_key = os.environ.get(\"DATABLIST_API_KEY\")\n    if not api_key:\n        raise RuntimeError(\"Set DATABLIST_API_KEY before running this script.\")\n\n    profiles = [\"jupiterhikes\"]\n    follower_results = scrape_instagram_users(profiles, api_key)\n    print(json.dumps(follower_results, indent=2, ensure_ascii=False))\n```\n\nRun it with:\n\n```shell\npython scrape_instagram_followers.py\n```\n\nThe function makes three kinds of API calls in order.\n\n1. `POST /v1/sources/tasks` sends the source ID and settings. The API accepts\n   the background task and returns its task ID.\n2. `GET /v1/sources/tasks/{taskId}` checks that task every three seconds. The\n   Requests client waits, but the task itself runs asynchronously in Datablist.\n3. `GET /v1/sources/tasks/{taskId}/results` retrieves a page of flat follower\n   objects. The loop passes every non-null `nextCursor` back unchanged until the\n   API returns `null`.\n\nThe example sets `scrapingType` to `followers` and requests 100 users with\n`limitPerProfile`. Treat 100 as a requested limit, not an exact result count.\nProvider page boundaries and the users available during the task can change the\nnumber returned.\n\nThe script prints `uniqueId` before submission. If the connection drops during\nthe POST, that value helps you find the accepted task instead of immediately\ncreating another paid run.\n\n## How the API builds follower relationship records {#how-the-api-builds-follower-relationship-records}\nDatablist first resolves each username, full profile URL, or numeric ID to its\nsource Instagram profile. Background work then retrieves follower pages and\nhandles the provider cursor. You only manage the Datablist task and result-page\ncursors shown in the script.\n\nRepeated user IDs are deduplicated within one source profile's returned list.\nWhen the same user appears under two submitted creators, the API keeps two\nrelationship records. Each one has different `followerSourceProfile...` fields.\nThat behavior is what makes the audience comparison possible.\n\nUse these fields in the next sections:\n\n- `instagramUserId` is the stable key for comparing returned users.\n- `instagramUsername`, `instagramFullName`, and the other `instagram...` fields\n  describe the follower when that public value is available.\n- `followerSourceProfileId`, `followerSourceProfileUsername`, and\n  `followerSourceProfileUrl` identify the starting creator.\n\nThis source retrieves relationship lists. It does not search candidates or\ncalculate confidence scores.\n\n## Read the Jupiter Hikes results {#read-the-jupiter-hikes-results}\nThe completed Jupiter Hikes task returned 124 unique follower records and used\n2.24 credits. Although the request specified `limitPerProfile: 100`, the running\ncount was 99 before the provider returned another page of 25 users. Datablist\nkept that complete page, which brought the result to 124.\n\nHere is the final results-page response. The envelope and all four follower\nobjects are preserved as returned:\n\n```json\n{\n  \"taskId\": \"695846750eb440c3870e763d38ef4f4b\",\n  \"results\": [\n    {\n      \"instagramUserId\": \"52256365838\",\n      \"instagramUsername\": \"adventuresoforest\",\n      \"instagramFullName\": \"Forest\",\n      \"instagramProfileUrl\": \"https://www.instagram.com/adventuresoforest/\",\n      \"instagramPicture\": \"https://scontent-fra3-2.cdninstagram.com/v/t51.82787-19/809812326_18068055263741839_8426418313724501534_n.jpg?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-fra3-2.cdninstagram.com&_nc_cat=107&_nc_oc=Q6cZ2gGE1JNYkQoszNL29wj7UyG4OGKOarcf_iw1luHzGMllAjP-kLWQ5LQPxtYI3LUcC5g&_nc_ohc=1hyyyEDHulgQ7kNvwFJIKKP&_nc_gid=ATIykjgJSgaEOBqdAnjQcg&edm=AIfao94BAAAA&ccb=7-5&ig_cache_key=GGbBRDCPB8fvzDBAAB4eZa7PpvB0bmNDAQAB1501500j-ccb7-5&oh=00_AQQZ3R0wDeV-bTnR2lYSje_IQ-ly9n6pyxGHXpJGAmzUHA&oe=6AF37F89&_nc_sid=9f8d40\",\n      \"followerSourceProfile\": \"https://www.instagram.com/jupiterhikes/\",\n      \"followerSourceProfileId\": \"1507518892\",\n      \"followerSourceProfileUsername\": \"jupiterhikes\",\n      \"followerSourceProfileUrl\": \"https://www.instagram.com/jupiterhikes/\",\n      \"instagramVerified\": false,\n      \"instagramPrivate\": false\n    },\n    {\n      \"instagramUserId\": \"199102398\",\n      \"instagramUsername\": \"richie_nu_field\",\n      \"instagramFullName\": \"新野 豊\",\n      \"instagramProfileUrl\": \"https://www.instagram.com/richie_nu_field/\",\n      \"instagramPicture\": \"https://scontent-fra3-1.cdninstagram.com/v/t51.2885-19/348434195_2264827180367957_813086592749200065_n.jpg?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby42NDAuYzIifQ&_nc_ht=scontent-fra3-1.cdninstagram.com&_nc_cat=105&_nc_oc=Q6cZ2gGE1JNYkQoszNL29wj7UyG4OGKOarcf_iw1luHzGMllAjP-kLWQ5LQPxtYI3LUcC5g&_nc_ohc=xux3gQ4SQEAQ7kNvwGj5tEv&_nc_gid=ATIykjgJSgaEOBqdAnjQcg&edm=AIfao94BAAAA&ccb=7-5&ig_cache_key=GBOvxBRVQJAr2QsIAMHicrzyqUgLbkULAAAB1501500j-ccb7-5&oh=00_AQRa3Zl_viAM914UM1_kQYrqGwPLfpmVqPwlMltzkNd44Q&oe=6AF3871F&_nc_sid=9f8d40\",\n      \"followerSourceProfile\": \"https://www.instagram.com/jupiterhikes/\",\n      \"followerSourceProfileId\": \"1507518892\",\n      \"followerSourceProfileUsername\": \"jupiterhikes\",\n      \"followerSourceProfileUrl\": \"https://www.instagram.com/jupiterhikes/\",\n      \"instagramVerified\": false,\n      \"instagramPrivate\": false\n    },\n    {\n      \"instagramUserId\": \"43861505420\",\n      \"instagramUsername\": \"shivroam\",\n      \"instagramFullName\": \"Shivam Rana I Mountaineer\",\n      \"instagramProfileUrl\": \"https://www.instagram.com/shivroam/\",\n      \"instagramPicture\": \"https://scontent-fra3-1.cdninstagram.com/v/t51.82787-19/858921985_18104766389457421_6701325443259882004_n.jpg?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-fra3-1.cdninstagram.com&_nc_cat=101&_nc_oc=Q6cZ2gGE1JNYkQoszNL29wj7UyG4OGKOarcf_iw1luHzGMllAjP-kLWQ5LQPxtYI3LUcC5g&_nc_ohc=NMw7vs1oyqQQ7kNvwEYvnsx&_nc_gid=ATIykjgJSgaEOBqdAnjQcg&edm=AIfao94BAAAA&ccb=7-5&ig_cache_key=GAEcMjMNkmJpMFJAABTaykn84-9cbmNDAQAB1501500j-ccb7-5&oh=00_AQR5iJXKSUhS5uS8xmmkgeYw-QZ8AbYxVHqIj3guogZgyA&oe=6AF38C8B&_nc_sid=9f8d40\",\n      \"followerSourceProfile\": \"https://www.instagram.com/jupiterhikes/\",\n      \"followerSourceProfileId\": \"1507518892\",\n      \"followerSourceProfileUsername\": \"jupiterhikes\",\n      \"followerSourceProfileUrl\": \"https://www.instagram.com/jupiterhikes/\",\n      \"instagramVerified\": false,\n      \"instagramPrivate\": false\n    },\n    {\n      \"instagramUserId\": \"23413245087\",\n      \"instagramUsername\": \"double24762\",\n      \"instagramFullName\": \"double 佳\",\n      \"instagramProfileUrl\": \"https://www.instagram.com/double24762/\",\n      \"instagramPicture\": \"https://scontent-iad6-1.cdninstagram.com/v/t51.2885-19/573323465_1219825463302212_7278921664109726296_n.png?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xNTAuYzIifQ&_nc_ht=scontent-iad6-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gH2sHBsdmQY1aWiWoZZWA6eZ603UbEQOH0raGAaH9APRHqzVjuOTqB7gW86Vp6E9Xx44csiK9pjfjrqCVl5R1HC&_nc_ohc=kwiilGbw6cUQ7kNvwHe7b38&edm=AAAAAAABAAAA&ccb=7-5&ig_cache_key=YW5vbnltb3VzX3Byb2ZpbGVfcGlj.3-ccb7-5&oh=00_AQT5TH4G4DvUg9YUXYlVAW4_1Z03ebdjvl84MLuV0umlaQ&oe=6AF37C2A&_nc_sid=328259\",\n      \"followerSourceProfile\": \"https://www.instagram.com/jupiterhikes/\",\n      \"followerSourceProfileId\": \"1507518892\",\n      \"followerSourceProfileUsername\": \"jupiterhikes\",\n      \"followerSourceProfileUrl\": \"https://www.instagram.com/jupiterhikes/\",\n      \"instagramVerified\": false,\n      \"instagramPrivate\": false\n    }\n  ],\n  \"nextCursor\": null\n}\n```\n\nThe first record has numeric user ID `52256365838`, username\n`adventuresoforest`, and the available public profile fields. Its\n`followerSourceProfileUsername` is `jupiterhikes`, so you know which submitted\nprofile produced the relationship. The task can still complete when an optional\nprofile value is absent. Read the fields that exist instead of rebuilding every\nrecord from a fixed schema.\n\n## Compare two collected audiences by Instagram user ID {#compare-two-collected-audiences-by-instagram-user-id}\nOnce the single-profile request works, reuse `scrape_instagram_users()` with\nboth hiking creators in one task. Group the returned relationships by numeric\nuser ID and keep every source username attached to that ID:\n\n```python\ncomparison_profiles = [\n    \"jupiterhikes\",\n    \"https://www.instagram.com/darwin_onthetrail/\",\n]\ncomparison_results = scrape_instagram_users(comparison_profiles, api_key)\n\naudience_by_id = {}\ncollected_count = {}\n\nfor result in comparison_results:\n    source_username = result[\"followerSourceProfileUsername\"]\n    collected_count[source_username] = collected_count.get(source_username, 0) + 1\n\n    user_id = result[\"instagramUserId\"]\n    grouped_user = audience_by_id.setdefault(\n        user_id,\n        {\"user\": result, \"source_profiles\": set()},\n    )\n    grouped_user[\"source_profiles\"].add(source_username)\n\noverlap = [\n    {\n        **grouped_user[\"user\"],\n        \"source_profiles\": sorted(grouped_user[\"source_profiles\"]),\n    }\n    for grouped_user in audience_by_id.values()\n    if len(grouped_user[\"source_profiles\"]) == len(comparison_profiles)\n]\n\noverlap_report = {\n    \"collected_count\": collected_count,\n    \"overlap_count\": len(overlap),\n    \"overlap\": overlap,\n}\nprint(json.dumps(overlap_report, indent=2, ensure_ascii=False))\n```\n\nThe two-profile task returned 124 follower relationships for Jupiter Hikes\nand 46 for Darwin on the Trail. Three numeric IDs appeared in both collected\nlists. The task used 2.7 credits.\n\nThe grouping code uses `instagramUserId` instead of the username because the ID\nis the stable join key returned by the API. It keeps one complete API user object\nand adds a sorted `source_profiles` list. For each of the three shared IDs, that\nlist contains `darwin_onthetrail` and `jupiterhikes`.\n\nFor example, numeric ID `42048393083` appears once in the Jupiter Hikes results\nand once in the Darwin on the Trail results. Both records describe the username\n`hikingful`, but each carries a different `followerSourceProfileUsername`. The\ngrouping code joins those two relationship records into one user object with\n`source_profiles: [\"darwin_onthetrail\", \"jupiterhikes\"]`.\n\n![Two collected Instagram follower lists joined by numeric user ID to find audience overlap while preserving both source profiles](/howto_images/scrape-instagram-followers-python-api/illustrations/instagram-follower-audience-overlap.png)\n\n> 📘 **Interpret the overlap narrowly:** A shared ID appeared in both returned\n> slices. It does not measure the creators' complete audience overlap, prove a\n> current follow at publication time, or qualify the account for outreach.\n\nThe `collected_count` values make the denominator explicit. If you calculate a\npercentage, label it clearly. For example, `3 / 124` describes the shared IDs as\na percentage of the Jupiter Hikes records collected in this task.\n\nIf you prefer a local browser script, see the guide to [scraping Instagram\nfollowers, following lists, and post authors for\nfree](/how-to/scrape-instagram-users-free-followers-followings-authors).\n\n## Enrich shared profiles for audience research {#enrich-shared-profiles-for-audience-research}\nThe overlap gives you numeric Instagram IDs and source provenance. A practical\nfollow-up is to submit those shared IDs to the Instagram Profile Scraper\nenrichment, then segment the successful results by available website, public\nemail, bio, category, or profile metrics.\n\nAdd this second function below the source function. It uses the same API key and\nthe same submit, poll, and paginate sequence:\n\n```python\ndef enrich_instagram_profiles(overlap_users, api_key):\n    \"\"\"Retrieve public profile details for the numeric IDs in the overlap.\"\"\"\n    if not overlap_users:\n        return []\n\n    tasks_url = \"https://api.datablist.com/v1/enrichments/tasks\"\n    headers = {\"X-API-Key\": api_key}\n    inputs = [\n        {\n            \"inputId\": user[\"instagramUserId\"],\n            \"data\": {\"instagramIdentifier\": user[\"instagramUserId\"]},\n        }\n        for user in overlap_users\n    ]\n\n    payload = {\n        \"enrichmentId\": \"instagram-profile-scraper\",\n        \"uniqueId\": str(uuid.uuid4()),\n        \"settings\": {\"scrapeType\": \"profile\"},\n        \"inputs\": inputs,\n    }\n    response = requests.post(tasks_url, headers=headers, json=payload)\n    response.raise_for_status()\n    task = response.json()\n    task_id = task[\"@id\"]\n    task_url = f\"{tasks_url}/{task_id}\"\n\n    while task[\"status\"] not in (\"completed\", \"failed\", \"stopped\"):\n        time.sleep(3)\n        response = requests.get(task_url, headers=headers)\n        response.raise_for_status()\n        task = response.json()\n\n    if task[\"status\"] != \"completed\":\n        raise RuntimeError(\n            f\"Task {task_id} {task['status']}: {task.get('error')}\"\n        )\n\n    profile_results = []\n    params = {\"limit\": 100}\n    while True:\n        response = requests.get(\n            f\"{task_url}/results\",\n            headers=headers,\n            params=params,\n        )\n        response.raise_for_status()\n        page = response.json()\n        profile_results.extend(page[\"results\"])\n        if page[\"nextCursor\"] is None:\n            break\n        params[\"cursor\"] = page[\"nextCursor\"]\n\n    return profile_results\n\n\nprofile_results = enrich_instagram_profiles(overlap, api_key)\nprofiles_with_websites = [\n    result\n    for result in profile_results\n    if result[\"status\"] == \"success\"\n    and result[\"outputs\"].get(\"instagramWebsite\")\n]\nprofiles_with_public_email = [\n    result\n    for result in profile_results\n    if result[\"status\"] == \"success\"\n    and result[\"outputs\"].get(\"instagramEmail\")\n]\n```\n\nWhen the two collected lists have no shared IDs, `overlap` is empty and this\nfunction returns `[]` before it sends a POST request. You can continue with an\nempty research segment without creating a paid enrichment task.\n\nUsing each numeric ID as both `inputId` and `instagramIdentifier` makes the join\nback to the overlap unambiguous. Keep every returned result object, including\nunsuccessful statuses, empty outputs, credit usage, and errors. Filter only when\nyou build a local segment.\n\nThe `profile` mode starts at 2 credits per numeric ID and can return public bio,\nwebsite, email or phone fields when the profile exposes them, along with profile\ncounts and category details. A found profile may still have empty contact\nfields. The code prepares research segments locally. It does not send messages\nor treat a shared follower as consent to contact them.\n\nFor a no-code version of this follow-up, use Datablist's **[Instagram Profile\nScraper](/enrichments/instagram-profile-scraper-bulk)**.\n\n## Switch from followers to following {#switch-from-followers-to-following}\nThe same source can retrieve accounts followed by a submitted profile. Change\nonly the `scraping_type` argument:\n\n```python\nfollowing_results = scrape_instagram_users(\n    [\"1507518892\"],\n    api_key,\n    scraping_type=\"following\",\n    limit_per_profile=100,\n)\n```\n\nThese records describe accounts followed by Jupiter Hikes. Their provenance\nmoves to `followingSourceProfileId`, `followingSourceProfileUsername`, and\n`followingSourceProfileUrl`. Use the actual returned count just as you would in\nfollowers mode.\n\n## Estimate the Instagram follower API cost {#estimate-the-instagram-follower-api-cost}\nThe Instagram follower source uses 0.01 credits for each returned follower or\nfollowing user. Resolving a submitted source profile can use up to 1 additional\ncredit. Cached resolution can reduce the actual charge.\n\nFor two profiles and a requested limit of 100 users per profile, a planning\nestimate is:\n\n`2 × (1 + 100 × 0.01) = 4 credits`\n\nThis is an estimate, not a cap. The two-profile task returned 170\nrelationship records and used 2.7 credits. Read `task.credits.used` after your\nrun for the actual charge.\n\n<div format=\"cost-calculator\"\n     data-heading=\"Estimate your follower API cost\"\n     data-unit-label=\"Returned users\"\n     data-credits-per-unit=\"0.01\"\n     data-lower-rate-label=\"Follower or following user\"\n     data-initial-quantity=\"1000\"\n     data-max-quantity=\"1000000\">\n<p>Each returned follower or following user uses 0.01 credits, before source-profile resolution.</p>\n</div>\n\nAPI access, included plan credits, optional top-ups, and task usage are separate.\nThe Growth monthly plan costs $50 or €50 and includes REST API access plus\n20,000 monthly credits. The smallest current top-up adds 20,000 credits for $20\nor €17.50.\n\nAt those top-up rates, 1,000 returned users consume 10 credits. That usage is\nequivalent to $0.01 or €0.00875 before source-profile resolution. This is a\nnormalized usage value, not a package you can buy: the top-up still costs $20 or\n€17.50, and API access still requires the Growth subscription. See the current\n[Datablist pricing](/pricing) for the catalog.\n\nThe optional Instagram Profile Scraper has its own cost. With a numeric ID and\n`scrapeType: \"profile\"`, it starts at 2 credits for each submitted overlap\nprofile.\n\n## Fix common input, task, and result problems {#fix-common-input-task-and-result-problems}\n### The API key is missing {#the-api-key-is-missing}\nThe script raises `Set DATABLIST_API_KEY before running this script.` before an\nHTTP request. Export the variable in the same shell and run the file again.\n\n### The API rejects the key {#the-api-rejects-the-key}\n`response.raise_for_status()` raises an HTTP error. Check that you copied the\nPersonal API Key correctly and that your account has Growth-plan API access.\nKeep the single `X-API-Key` header used in the example.\n\n### A source profile cannot be resolved {#a-source-profile-cannot-be-resolved}\nCheck that each value is a username, a full Instagram profile URL, or a numeric\nuser ID string. Inspect the existing task and its error before creating another\npaid run.\n\n### Credits are insufficient {#credits-are-insufficient}\nCheck your balance and reduce the number of profiles or the requested limit\nbefore submitting another task. A task that has already started can still have\nused credits.\n\n### The task is failed or stopped {#the-task-is-failed-or-stopped}\nThe script prints the task ID and raises a `RuntimeError`. Use that ID to inspect\nthe existing task, its `error`, `credits.used`, and any available partial\nresults. A failed or stopped task can retain generated rows, so do this before\nsubmitting again.\n\n### The returned count differs from the requested limit {#the-returned-count-differs-from-the-requested-limit}\nReport the actual count from the results. `limitPerProfile` is a requested\nlimit. It does not guarantee an exact number, and one result does not tell you\nwhy the provider returned fewer or more accessible users.\n\n### The submission response was lost {#the-submission-response-was-lost}\nList your recent source tasks and match the `uniqueId` printed before the POST:\n\n```python\nunique_id = \"paste-the-printed-unique-id\"\nresponse = requests.get(\n    \"https://api.datablist.com/v1/sources/tasks\",\n    headers={\"X-API-Key\": api_key},\n    params={\"sourceId\": \"instagram-source\", \"limit\": 100},\n)\nresponse.raise_for_status()\nfor task in response.json()[\"tasks\"]:\n    if task[\"uniqueId\"] == unique_id:\n        print(task[\"@id\"], task[\"status\"])\n```\n\nContinue polling that task ID or retrieve its existing results. The [Sources\ntask documentation](https://platform.datablist.com/docs/sources/tasks) covers\nthe list, status, result, and retention endpoints in detail.\n\n## Next steps {#next-steps}\nYou now have one reusable Python Requests function that retrieves Instagram\nfollower relationships and a local report that compares the collected Jupiter\nHikes and Darwin on the Trail lists by numeric user ID. Each shared record keeps\nboth source profiles.\n\nReplace the examples with a small, reviewed set of public creator profiles.\nChoose a deliberate per-profile limit, then interpret the overlap against the\nactual count returned for each source. You can download the [maintained\nsynchronous Requests\nexample](https://github.com/datablist/instagram-followers-scraper-api/blob/main/python/sync_requests.py)\nor use the [maintained async HTTPX\nexample](https://github.com/datablist/instagram-followers-scraper-api/blob/main/python/async_httpx.py)\nwhen you need non-blocking concurrency. If you need source accounts first, start\nwith the guide to [finding Instagram profiles\nby keywords](/how-to/search-scrape-instagram-profiles-keywords)."
}