Discover, profile, and deeply analyze Instagram users — from identity resolution and content inventory to social graph exploration and audience similarity mapping.
This skill provides comprehensive Instagram user intelligence using the KeyAPI MCP service. It enables retrieval of detailed user profiles, content libraries (posts, Reels, Stories, Highlights), social connections (followers, following), tagged appearances, reposts, and algorithmic similarity matches — all through a unified, cache-first workflow.
Use this skill when you need to:
RequirementDetailsKEYAPI_TOKENA valid API token from keyapi.ai. If you don't have one, register at the site to obtain your free token. Set it as an environment variable: export KEYAPI_TOKEN=your_token_hereNode.jsv18 or higherDependenciesRun npm install in the skill directory to install @modelcontextprotocol/sdk
All tool calls in this skill target the KeyAPI Instagram MCP server:
text
Server URL : https://mcp.keyapi.ai/instagram/mcp
Auth Header: Authorization: Bearer $KEYAPI_TOKEN
Setup (one-time):
bash
# 1. Install dependencies
npm install
# 2. Set your API token (get one free at https://keyapi.ai/)
export KEYAPI_TOKEN=your_token_here
# 3. List all available tools to verify the connection
node scripts/run.js --platform instagram --list-tools
User NeedNode(s)Best ForResolve user ID to username (or vice versa)get_user_info_by_user_idID-to-handle translation, data normalizationFull profile snapshot (by username or user ID)get_user_infoProfile audit, follower/following counts, bio, verification statusAll published posts with metadataget_user_postsContent inventory, posting cadence analysisReels library with engagement dataget_user_reelsShort-video strategy, Reels performance overviewFollower list samplingget_user_followersAudience quality sampling, fan demographicsFollowing list explorationget_user_followingNetwork affinity, brand partnership signalsActive Stories (last 24 hours)get_user_storiesReal-time content monitoring — expires after 24 hoursHighlights indexget_user_highlightsCurated content categories, evergreen story topicsStories inside a specific Highlightget_highlight_storiesDeep-dive into a pinned content collectionPosts where user is taggedget_user_tagged_postsInfluencer attribution, UGC discoveryReposted / shared content listget_user_reposts_listContent amplification patterns, cross-promotion signalsAlgorithmically similar usersget_similar_usersAudience lookalike discovery, competitive mappingRelated / recommended profilesget_related_profilesExpanded creator discovery beyond keyword searchSearch users by keywordsearch_usersInitial user discovery by name or handle fragment
Clarify the research objective and map it to one or more nodes. Typical entry points:
get_user_info with username. If you only have a numeric user ID, use get_user_info_by_user_id first.get_user_posts + get_user_reels + get_user_stories for a full content snapshot.get_user_followers + get_user_following with pagination_token to traverse the network.get_user_highlights first to retrieve Highlight IDs, then get_highlight_stories for each ID.get_similar_users or get_related_profiles to expand a creator list.User Identification
Most endpoints accept either
username(e.g.,user_id(numeric, e.g.,25025320) — pass one, not both.
- Use
get_user_infowithusernameto resolve the numericuser_idwhen downstream nodes require it.get_user_reposts_listandget_related_profilesaccept onlyuser_id— resolve it first if you start from a handle.
Before calling any node, inspect its input schema to confirm required parameters, data types, and available options:
bash
node scripts/run.js --platform instagram --schema <tool_name>
# Examples
node scripts/run.js --platform instagram --schema get_user_info
node scripts/run.js --platform instagram --schema get_user_highlights
Execute tool calls and persist responses to the local cache to avoid redundant API calls.
Calling a tool:
bash
# Single call with pretty output
node scripts/run.js --platform instagram --tool <tool_name> \
--params '<json_args>' --pretty
# Force fresh data, skip cache
node scripts/run.js --platform instagram --tool <tool_name> \
--params '<json_args>' --no-cache --pretty
Example — get full user profile:
bash
node scripts/run.js --platform instagram --tool get_user_info \
--params '{"username":"instagram"}' --pretty
Example — get user posts (first page):
bash
# Use user_id to avoid the "username " (with space) schema quirk
node scripts/run.js --platform instagram --tool get_user_posts \
--params '{"user_id":"25025320"}' --pretty
Example — get next page using pagination token:
bash
node scripts/run.js --platform instagram --tool get_user_posts \
--params '{"user_id":"25025320","pagination_token":"<token_from_previous_response>"}' --pretty
Example — get Highlights, then stories in one Highlight:
bash
# Step 1: get Highlight IDs
node scripts/run.js --platform instagram --tool get_user_highlights \
--params '{"username":"instagram"}' --pretty
# Step 2: get Stories in a specific Highlight
node scripts/run.js --platform instagram --tool get_highlight_stories \
--params '{"highlight_id":"17895069621772257"}' --pretty
Pagination:
Instagram endpoints use token-based pagination — not numeric page numbers.
Endpoint groupPagination parameterNotesget_user_posts, get_user_reels, get_user_followers, get_user_following, get_user_tagged_posts``pagination_tokenPass token from previous responseget_user_reposts_list``max_idPass cursor from previous response; leave empty for first callget_user_stories, get_user_highlights, get_similar_users, get_related_profiles—No pagination; single-call response
Cache directory structure:
text
.keyapi-cache/
└── YYYY-MM-DD/
├── get_user_info/
│ └── {params_hash}.json
├── get_user_info_by_user_id/
│ └── {params_hash}.json
├── get_user_posts/
│ └── {params_hash}.json
├── get_user_reels/
│ └── {params_hash}.json
├── get_user_followers/
│ └── {params_hash}.json
├── get_user_following/
│ └── {params_hash}.json
├── get_user_stories/
│ └── {params_hash}.json
├── get_user_highlights/
│ └── {params_hash}.json
├── get_highlight_stories/
│ └── {params_hash}.json
├── get_user_tagged_posts/
│ └── {params_hash}.json
├── get_user_reposts_list/
│ └── {params_hash}.json
├── get_similar_users/
│ └── {params_hash}.json
├── get_related_profiles/
│ └── {params_hash}.json
└── search_users/
└── {params_hash}.json
Cache-first policy:
Before every API call, check whether a cached result already exists for the given parameters. If a valid cache file exists, load from disk and skip the API call.
After collecting all API responses, produce a structured user intelligence report:
For individual profile analysis:
For discovery / shortlist building:
RuleDetailUser identificationMost endpoints accept username or user_id — pass one. get_user_reposts_list and get_related_profiles require user_id only; resolve it via get_user_info first if starting from a handle.get_user_posts username quirkThe get_user_posts schema has a trailing space in the parameter name: "username " (with space). Use user_id instead of username when calling this endpoint to avoid potential parameter rejection.PaginationUse pagination_token for most user-list endpoints. Use max_id for get_user_reposts_list. Some endpoints ( get_user_stories, get_user_highlights, get_similar_users, get_related_profiles) return all data in a single call.Highlights workflowAlways call get_user_highlights first to obtain Highlight IDs before calling get_highlight_stories. The highlight_id may or may not include the "highlight:" prefix — pass it exactly as returned.Success checkcode = 0 → success. Any other value → failure. Always check the response code before processing data.Retry on 500If code = 500, retry the identical request up to 3 times with a 2–3 second pause between attempts before reporting the error.Cache firstAlways check the local .keyapi-cache/ directory before issuing a live API call.
CodeMeaningAction0SuccessContinue workflow normally400Bad request — invalid or missing parametersValidate input against the tool schema; ensure at least one of username or user_id is provided401Unauthorized — token missing or expiredConfirm KEYAPI_TOKEN is set correctly; visit keyapi.ai to renew403Forbidden — plan quota exceeded or feature restrictedReview plan limits at keyapi.ai404Resource not found — user may not exist or account is privateVerify the username or user ID; private accounts may have restricted data429Rate limit exceededWait 60 seconds, then retry500Internal server errorRetry up to 3 times with a 2–3 second pause; if it persists, log the full request and response and skip this nodeOther non-0Unexpected errorLog the full response body and surface the error message to the user