当前位置: 首页 > Skill >

keyapi-instagram

keyapi-instagram

keyapi-instagram

Discover and analyze Instagram users and content through the KeyAPI REST API using live official docs. Use for profiles, posts, Reels, Stories, Highlights, followers, following, tagged content, reposts, comments, hashtags, music, Explore sections, locations, and search.

1.1.2 2026.11.22 792
获取Skill文件查看使用说明
作 者:林舟 许可证: 更新时间:2026.11.22
本文目录展开

Instagram KeyAPI Skill

Turn natural-language Instagram requests into documentation-guided KeyAPI REST workflows. Start from the user's business goal, map it to the closest scenario, verify the current endpoint contract in the latest KeyAPI docs, then execute the request with a helper script when available or with direct REST when it is not.

Execution Contract

  • Use KeyAPI REST API execution for live data lookup, ranking, analysis, search, comparison, and reporting.
  • Treat https://docs.keyapi.ai/llms.txt and linked endpoint pages as the source of truth for method, /v1/... path, parameters, enums, pagination, request body, and response shape.
  • Do not use platform web pages or manual browsing as a substitute for API data.
  • Keep credentials local. Never print or restate KEYAPI_TOKEN.
  • If official docs conflict with this skill, follow the official docs.

Hard Rule

For Instagram data lookup, ranking, analysis, search, comparison, or reporting, use KeyAPI API execution and official KeyAPI docs. Do not use platform web pages as a substitute for API results.

Workflow

  1. Apply references/global-rules.md as the base execution contract.
  2. Check auth with node scripts/configure-keyapi-auth.mjs --status when script execution is available and setup state is unknown; treat authStatus: "available" as ready and authStatus: "unavailable" as missing credentials.
  3. If authStatus is unavailable, stop live execution, load references/setup-and-auth.md, and tell the user the exact setup command: node scripts/configure-keyapi-auth.mjs. Do not only say "set KEYAPI_TOKEN".
  4. Identify the user's goal, entity, scope, metric, pagination depth, and desired output.
  5. Use references/scenarios.md to map the request to an Instagram scenario.
  6. Use references/routing-policy.md to choose search/list, detail, resolver, ranking/trend, related-entity, or composed workflow patterns.
  7. Apply references/instagram-rules.md for Instagram-specific identifiers, pagination, and reporting rules.
  8. Load the scenario reference named in references/scenarios.md when the request maps to a curated scenario.
  9. Resolve current docs with node scripts/search-keyapi-docs.mjs --query "<semantic entity action>" --resolve when the helper script is available; otherwise open https://docs.keyapi.ai/llms.txt and the selected endpoint page directly. Build the query from the inferred scenario/API concept, not by copying vague or translated user wording literally.
  10. Use the resolver output or opened docs page to extract the current OpenAPI method, /v1/... path, required query/body parameters, examples, and response contract before any live API call. Never infer API paths from docs URLs, scenario names, endpoint titles, remembered routes, or a previous 404.
  11. Ask only for missing high-value inputs that cannot be safely defaulted.
  12. Prefer node scripts/keyapi-api.mjs for live REST calls when script execution is available. Use the host's HTTP client only when scripts are unavailable or the helper cannot express the documented request.
  13. Check HTTP status and KeyAPI response envelope. code = 0 means success; non-zero code is an API-level failure.
  14. Return the result in user-facing analytical language, separating observed API facts from inference.

Interaction Rules

  • Do not start by listing raw endpoints or dumping all parameters. First identify the user's business goal, choose the closest scenario, collect only missing high-value inputs, resolve the current docs, then execute.
  • Prefer scenario names and user-facing workflows over endpoint names for non-technical users. Use raw endpoint names only after the route is chosen or when the user asks for integration details.
  • Treat endpoint selection as semantic routing first: infer the platform data surface and action from the user's goal, then use docs search to verify the current endpoint.
  • If multiple endpoints could solve the task, choose the one with the least user input burden and strongest documented filtering.
  • If the user's request is vague, offer 2 to 4 concrete scenario options instead of asking an open-ended question.
  • If a request needs a broad report or many adjacent calls, confirm the sections and maximum scope before execution.
  • If credentials are missing, pause live execution and route to setup; do not fall back to platform websites or unauthenticated browsing for API data.

Scenario Selection

Read references/scenarios.md to choose the best scenario card. If no exact scenario fits, use the nearest scenario with explicit assumptions or fall back to advanced mode that exposes filters gradually. Treat the official docs index as the endpoint source of truth, not the scenario card.

Input Model

Compress parameter-heavy APIs into these decision fields:

  • Goal: search, detail, enrichment, ranking, comparison, monitoring, or report
  • Entity: the Instagram object being searched, analyzed, compared, ranked, or monitored
  • Scope: username/user ID, post/Reel/Story/Highlight URL or ID, hashtag, music, location, language, and date window
  • Metric or sort: recency, likes, comments, views, plays, follower fit, hashtag volume, creator similarity
  • Pagination depth: one page, top N, until enough evidence, or all available within the user's approved scope
  • Output format: concise answer, table, raw JSON, or structured report

Scenario Families

  • User profile and content library analysis
  • Follower/following and related-user exploration
  • Post, comment, like, and reply analysis
  • Hashtag, Reel, music, Explore, and location discovery
  • Shortcode/media ID conversion workflows

KeyAPI-Specific Usage

  • Prefer API-side filters from the current docs over client-side filtering.
  • If multiple endpoints could solve the task, choose the one with the least user input burden and strongest documented filtering.
  • For broad reports, confirm the requested sections before launching a multi-endpoint workflow.
  • For Instagram reporting, separate account, content, hashtag, music, location, follower/following, Story, Highlight, and tagged-content evidence.
  • If the user asks about integration details, answer with method, path, auth, required params, and a minimal request example from the current docs.

Onboarding Rule

When the user has not set up credentials yet, proactively provide the setup script command. Do not answer only with "configure KEYAPI_TOKEN".

When authStatus is unavailable:

  • explain that KeyAPI uses Bearer token authentication with KEYAPI_TOKEN
  • point them to the KeyAPI dashboard and auth docs
  • require local setup with node scripts/configure-keyapi-auth.mjs when script execution is available
  • also mention node scripts/configure-keyapi-auth.mjs --status for checking whether authentication is available
  • explain that setup writes credentials into shell environment variables
  • explain that --status reports available or unavailable; continue live requests when it reports available
  • continue live requests only after setup is complete

Script Contract

This skill includes helper scripts under scripts/ for reliable local execution:

  • scripts/configure-keyapi-auth.mjs
  • scripts/search-keyapi-docs.mjs
  • scripts/keyapi-api.mjs

Run script commands from this skill directory. If the host agent uses a different current working directory, resolve scripts/... relative to this SKILL.md. For large JSON bodies, especially base64 image payloads, prefer --body-file or --image-file instead of inline --body. keyapi-api.mjs always sends live API requests; repeating identical requests calls the API again. The helper does not create local response files unless --output-file is supplied. Large responses may return a stdout preview; when complete fields are needed for extraction, sorting, aggregation, or validation, use --output-file to save the full helper result and read the API payload from data.data. For agent-internal analysis, write to a temporary path such as the OS temp directory or a workspace .tmp-keyapi-*.json file; do not present that temporary file as a user deliverable, and clean it up when practical or briefly mention it in the final answer. When the user asks to save results, export JSON, or provide a file, treat --output-file as an intentional user-facing output file. Use --stdout full only when the user explicitly needs raw JSON in stdout. For query strings, prefer repeated --query-param key=value or --param key=value; use --query-file query.json or --query only when structured array/object query values are needed. Query sources merge in this order: --query, --query-file, then repeated query params, with later values overriding earlier ones; empty query-param values are not sent.

Prefer them in this order when script execution is available:

  1. auth status
  2. docs resolution before live REST calls
  3. live REST call

If script execution is unavailable in the host agent, or if the helper cannot express the documented request, do not fail the task. Use the same documented REST method, path, headers, query, and body with the host's available HTTP client.

Script Examples

Resolve current docs for this platform:

node scripts/search-keyapi-docs.mjs --query "<entity action>" --resolve

Execute a documented GET endpoint:

node scripts/keyapi-api.mjs --path /v1/instagram/... --query-param example=value

Execute query parameters from a JSON file:

node scripts/keyapi-api.mjs --path /v1/instagram/... --query-file query.json

Preview a large response without saving:

node scripts/keyapi-api.mjs --path /v1/instagram/... --query-param example=value --stdout preview

Write a complete response to a temporary file for internal analysis:

node scripts/keyapi-api.mjs --path /v1/instagram/... --query-param example=value --output-file .tmp-keyapi-instagram-response.json

Save or export a complete response for the user:

node scripts/keyapi-api.mjs --path /v1/instagram/... --query-param example=value --output-file response.json

Execute a documented POST endpoint:

node scripts/keyapi-api.mjs --path /v1/instagram/... --method POST --body '{"example":"value"}'

Execute a documented POST endpoint with a large JSON body:

node scripts/keyapi-api.mjs --path /v1/instagram/... --method POST --body-file request.json

Execute an image JSON endpoint from a local file:

node scripts/keyapi-api.mjs --path /v1/instagram/... --method POST --query-param example=value --image-file ./image.jpg --image-field image_base64

References

  • references/global-rules.md
  • references/scenarios.md
  • references/routing-policy.md
  • references/instagram-rules.md
  • references/instagram-user-rules.md
  • references/instagram-content-rules.md
  • references/instagram-discovery-rules.md
  • references/setup-and-auth.md

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,016
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,004
Apache开启.htaccess及使用方法详解

本文介绍如何在本地Apache环境中启用.htaccess文件,主要涉及修改httpd.conf中的AllowOverride参数。同时详细解析.htaccess的多种实用功能,包括自定义错误页面、目录密码保护、IP访问限制、URL自动转向、默认首页设置以及防止图片盗链等配置方法,并分析了使用.htaccess对服务器性能和安全性的潜在影响。

2026.05.09 1,001
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,001
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,000
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,000
Skill 文件
  • SKILL.md
    • Instagram KeyAPI Skill
    • Execution Contract
    • Hard Rule
    • Workflow
    • Interaction Rules
    • Scenario Selection
    • Input Model
    • Scenario Families
    • KeyAPI-Specific Usage
    • Onboarding Rule
    • Script Contract
    • Script Examples
    • References
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期