# Instagram Numeric ID to Username Lookup (`automation-lab/instagram-numeric-id-to-username`) Actor

Resolve batches of public Instagram numeric user IDs to current usernames and profile URLs for repeatable CRM identity reconciliation.

- **URL**: https://apify.com/automation-lab/instagram-numeric-id-to-username.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Social media
- **Stats:** 1 total users, 1 monthly users, 75.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 item extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Instagram numeric ID to username lookup

Resolve a public **Instagram user ID to username** and profile URL. Supply 1–25 numeric account IDs as strings; this Actor verifies each ID against Instagram's public mobile account-info response and writes one mapping per unique resolved ID. Use it when a CRM or creator database stores stable numeric IDs but needs a fresh username before joining records or opening profile links.

### Who is it for?

- **CRM operators** refresh existing creator IDs before matching or deduplicating contact records.
- **Data engineers** join older ID-based exports to current public profile links in a scheduled pipeline.
- **Researchers** verify a known numeric ID before following an account that may have changed its handle.

This is not a username search engine: you must already know the numeric user IDs. It does not discover accounts, followers, contact details, posts or historical usernames.

### Why use this Actor?

A username can change while the numeric account ID remains the join key. The Actor checks that the response ID equals the requested ID before returning a current handle. It deduplicates repeated input IDs and retries temporary denials on new US residential proxy identities, up to three attempts per ID. The output includes a UTC observation timestamp for later comparison. It does not claim a historical change event or continuously monitor Instagram for you.

### What data do I get?

Each resolved account produces one item in the default dataset:

| Field | Meaning |
| --- | --- |
| `instagramId` | Requested numeric ID, verified against the returned account ID; a string to avoid numeric precision loss. |
| `username` | Username returned at lookup time. |
| `profileUrl` | Instagram profile link built from the returned username. |
| `observedAt` | UTC time when this mapping was recorded. |

For example, a lookup of the public Instagram account ID `25025320` yielded:

```json
{
  "instagramId": "25025320",
  "username": "instagram",
  "profileUrl": "https://www.instagram.com/instagram/",
  "observedAt": "2026-09-28T06:10:00.000Z"
}
```

The timestamp above illustrates the record shape; each run generates a new timestamp. Other requested IDs can be missing if an account is unavailable, private or inaccessible through the public lookup at that time. Only verified matches are exported; compare returned `instagramId` values to your input to identify missing IDs. Logs do not print supplied IDs or usernames.

### Get started

1. Obtain one or more **numeric Instagram account IDs** from your own authorized dataset. A username or post ID is not a valid input.
2. Enter each ID as a digit-only string in `ids`; for a quick test, use `25025320`.
3. Run the Actor and open its default dataset's **ID-to-username mappings** view.
4. Export the dataset as JSON or CSV and join on `instagramId`, not on the possibly changed username.
5. For periodic reconciliation, schedule new runs and compare their datasets in your own database; the Actor itself does not retain a change history.

### Input

```json
{"ids":["25025320","1908910"]}
```

`ids` is required: 1–25 strings, each a positive numeric ID of up to 20 digits. Repeated IDs are looked up once. Numbers, usernames, URLs, empty arrays and malformed IDs fail validation. The Actor uses Apify **US residential proxy** for the Instagram mobile response. No login, session cookie or user-supplied proxy option is supported. Keep batch size bounded: upstream requests are sequential, with at most three fresh identities per ID.

### How much does it cost to resolve Instagram account IDs?

This is a pay-per-event Actor: a one-time `start` charge of $0.001 per run and an `item` charge per verified mapping. At the BRONZE spend tier the item price is $0.001, so an estimated 1 verified mapping costs $0.002, 5 cost $0.006, and 25 cost $0.026 in one run. Actual charges depend on the customer's **aggregate monthly Apify Store spend tier**, not on this Actor's batch size: FREE $0.00115/item, BRONZE $0.001, SILVER $0.00078, GOLD/PLATINUM/DIAMOND $0.0006. The one-time start event remains $0.001 across tiers. Check the live pricing panel before running. Invalid input is rejected before an Actor charge; an unresolved batch can consume runtime and proxy resources without yielding an item. Apify infrastructure usage depends on transfer, runtime and proxy consumption. A partial batch produces charges for verified items only. These examples are estimates, not guaranteed invoices; refunds, fraud, disputes, taxes, corrections and contractual clawbacks can affect eventual publisher payouts.

### Integrations and repeat reconciliation

Export the default dataset to Google Sheets or a database using Apify integrations, keyed by `instagramId`. For scheduled refreshes, run this Actor with the same stored IDs and compare `username` against the previous snapshot in your own system. A missing item is **not** proof an account was deleted or renamed: retry later and investigate denials before updating your CRM. For downstream applications, use `profileUrl` only after verifying your use complies with Instagram's rules and the applicable privacy requirements.

### API: cURL

Replace `YOUR_APIFY_TOKEN` with your own token, and never expose it in shared documents. This synchronous endpoint returns dataset items when the run completes:

```bash
curl -X POST 'https://api.apify.com/v2/acts/automation-lab~instagram-numeric-id-to-username/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"ids":["25025320"]}'
```

For a large batch or when synchronous response time is insufficient, start a normal run, wait for completion and fetch its default dataset via the Apify API.

### API: JavaScript

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/instagram-numeric-id-to-username')
  .call({ ids: ['25025320'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### API: Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/instagram-numeric-id-to-username').call(
    run_input={'ids': ['25025320']}
)
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### Use with Apify MCP

To expose this Actor to Claude Code through Apify MCP:

```bash
claude mcp add --transport http apify \
  'https://mcp.apify.com?tools=automation-lab/instagram-numeric-id-to-username'
```

For Claude Desktop, Cursor, or VS Code, configure the equivalent HTTP MCP server (using the client-specific configuration UI or file):

```json
{"mcpServers":{"apify":{"url":"https://mcp.apify.com?tools=automation-lab/instagram-numeric-id-to-username"}}}
```

Authenticate according to Apify MCP instructions. Example prompts: “Look up the current public username and profile URL for numeric Instagram ID 25025320.” “Reconcile IDs 25025320 and 1908910 for a CRM import.” The client must pass IDs as strings; it cannot discover IDs from handles with this Actor.

### Limits and reliability

The public upstream response may deny access, change format, rate-limit, or stop returning an account. Up to three attempts use different residential sessions for temporary 401/403/429 or server errors; a 404 stops attempts for that ID. Unverified records are skipped. If **nothing** resolves, the run fails rather than returning an apparently successful empty mapping. If some IDs resolve and others do not, the run succeeds with the verified subset and logs a generic warning per skipped ID without exposing the ID. A run is a point-in-time observation, not an accuracy guarantee after a username changes.

### Data handling and AI

No AI model is used, and no account login or user-supplied credential is needed. This independent tool is not affiliated with, endorsed by, or certified by Instagram or Meta. The Actor sends each submitted numeric ID to Instagram's mobile account-info endpoint via Apify's US residential proxy. It stores verified numeric IDs, public usernames, profile links and observation timestamps in the run's default Apify dataset; Apify stores the input and run logs under your account's configured retention settings. It has no cross-run cache or separate third-party storage, and it does not log submitted IDs or returned usernames. Manage dataset/input deletion and retention in Apify Console. Do not submit sensitive or unauthorized data.

### Legality and responsible use

Use only IDs you are authorized to process and comply with Instagram terms, applicable privacy/data-protection law, and your own retention policy. A profile link may later redirect or stop working. Do not treat a public lookup as consent for contact, bulk outreach, personal profiling or circumvention of access restrictions. This tool does not log in or access private content.

### Troubleshooting

**No items and failed run?** Check that the IDs are numeric user IDs, not post IDs, and retry later if the log shows upstream denials. The source can change without notice. **Some IDs missing?** Compare input IDs with the returned `instagramId` values; missing items are not verified mappings and logs deliberately omit identifiers. **Malformed input?** Provide strings such as `"25025320"`, not JSON numbers, with no spaces or usernames. **Unexpected username?** Check that you supplied the correct account ID and rerun; usernames can change over time.

For support with a run, open an issue on this Actor's Apify Store page and include the run link and a description of the mismatch. Do not paste your Apify token or private source data into a public issue.

### Related automation-lab Actors

If you already have a handle or profile URL and need richer profile fields, use [Instagram Public Profile Details Scraper](https://apify.com/automation-lab/instagram-public-profile-details). For public profile metrics over time, see [Instagram Profile Stats Scraper](https://apify.com/automation-lab/instagram-profile-stats-scraper). Neither is a replacement for this numeric-ID reconciliation workflow.

### Frequently asked questions

**Can this find a numeric ID from a username?** No. It works in the other direction: supply the numeric account ID to retrieve its current public handle.

**Will it show previous usernames?** No. Store and compare separate snapshots yourself if you need history.

**Can I submit 100 IDs?** Split them into batches of at most 25. Requests are sequential and some IDs can fail under upstream restrictions.

**Does a skipped ID mean the account is gone?** No. It may have been temporarily denied or unavailable; investigate before removing a record from your system.

# Changelog

This Actor's version history is a separate document: https://apify.com/automation-lab/instagram-numeric-id-to-username/changelog.md

# Actor input Schema

## `ids` (type: `array`):

Public numeric user IDs as strings, preserving all digits. Up to 25 IDs per run.

## Actor input object example

```json
{
  "ids": [
    "25025320",
    "1908910"
  ]
}
```

# Actor output Schema

## `overview` (type: `string`):

Default dataset with one item per resolved, unique numeric ID.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "ids": [
        "25025320",
        "1908910"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/instagram-numeric-id-to-username").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "ids": [
        "25025320",
        "1908910",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/instagram-numeric-id-to-username").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "ids": [
    "25025320",
    "1908910"
  ]
}' |
apify call automation-lab/instagram-numeric-id-to-username --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/instagram-numeric-id-to-username"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Ul4ymYEavVJvblWiy/builds/hIOzuRQN3BOTFacJ7/openapi.json
