HikerAPI

io.github.subzeroidv1.1.2更新於 Oct 6, 2026

Instagram data via HikerAPI: profiles, posts, reels, stories, comments, hashtags, locations.

概覽

AI 產生的概覽

讓助理透過 HikerAPI 查詢 Instagram 資料:個人檔案、貼文、Reels、限時動態、留言、主題標籤與地點。

功能
啟動時依 HikerAPI 的 OpenAPI 規格產生 MCP 工具,把每個唯讀 GET 端點對應成一個工具,例如 get_v2_user_by_username 或 get_v2_hashtag_medias_recent。預設核心集提供約 44 個精選工具,每個任務一個,並附有說明用途、分頁與計費的手寫描述。設定 HIKERAPI_TOOLS=all 可曝露所有未棄用的端點(100 個以上)。回應以原始 JSON 文字傳回,非 2xx 回應會以工具錯誤呈現。
適用情境
適合助理需要 Instagram 個人檔案、貼文、Reels、限時動態、留言、主題標籤或地點資料,用於研究、監測或內容分析的場合。如果你已有 HikerAPI 存取權限,並希望助理直接呼叫這些端點而不必自己寫 API 程式碼,就值得加入。
執行需求
透過 stdio 在本機執行,通常使用 npx hikerapi-mcp,因此需要 Node.js。需要在 HIKERAPI_KEY 環境變數中提供 HikerAPI 存取金鑰,並以 x-access-key 標頭送出。需要連線至 api.hikerapi.com 的網路,並在啟動時取得 OpenAPI 規格。選用變數可控制基礎 URL、工具集、標籤篩選、逾時與回應大小上限。
安裝前請注意
HIKERAPI_KEY 是計費憑證:請求會消耗你的 HikerAPI 配額或額度,免費額度有限。若 HIKERAPI_URL 指向預設主機以外的位址,金鑰會被送往該主機,伺服器會在啟動時提出警告。所有工具皆為唯讀,但傳回的資料涉及第三方 Instagram 帳號,請依適用規範處理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 HikerAPI,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

hikerapi-mcp

[npm version] [npm downloads] [License: MIT]

MCP server for HikerAPI — Instagram data API. Available on npm: hikerapi-mcp.

Generates MCP tools from the HikerAPI OpenAPI spec at startup. HikerAPI only exposes read (GET) endpoints — each tool maps 1:1 to one of them (GET /v2/user/by/username → get_v2_user_by_username). By default you get a core set of ~45 tools, one per task, each with a description that tells the assistant when to use it; HIKERAPI_TOOLS=all exposes every non-deprecated endpoint (100+).

Get 100 Free API Requests

Sign up with this link and get 100 free HikerAPI requests — no credit card required. Enough to wire up the MCP server, try a few prompts in Claude/Cursor/Codex, and evaluate the data quality before committing.

Get your free 100 requests here

Quick start

  1. Get an API key at hikerapi.com/tokens.
  2. Add the server to your AI assistant.
  3. Ask your assistant something like:
    • "Get the Instagram profile for @nasa."
    • "Find the top 5 recent posts under the hashtag #photography."
    • "Show stories for the user with id 25025320."

Claude Code

bash
claude mcp add hikerapi -e HIKERAPI_KEY=your-api-key -- npx -y hikerapi-mcp

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "hikerapi": {      "command": "npx",      "args": ["-y", "hikerapi-mcp"],      "env": {        "HIKERAPI_KEY": "your-api-key"      }    }  }}

Cursor / Windsurf

Same shape as Claude Desktop — put the block under mcpServers in the app's MCP config file.

Zed

Add to ~/.config/zed/settings.json:

json
{  "context_servers": {    "hikerapi": {      "command": "npx",      "args": ["-y", "hikerapi-mcp"],      "env": {        "HIKERAPI_KEY": "your-api-key"      }    }  }}

OpenAI Codex

Append to ~/.codex/config.toml:

toml
[mcp_servers.hikerapi]command = "npx"args = ["-y", "hikerapi-mcp"]
[mcp_servers.hikerapi.env]HIKERAPI_KEY = "your-api-key"

Tools

Tools are generated at startup from the live HikerAPI OpenAPI spec.

HikerAPI has 100+ GET endpoints, and most of them are version variants of the same call (v1 / v2 / gql / g2). Handing all of them to an assistant makes it pick the wrong one, so the default core set keeps one endpoint per task:

GroupToolsExamples
Profiles16get_v2_user_by_username, get_gql_user_medias, get_g2_user_followers
Posts, comments, likers8get_v2_media_info_by_url, get_v2_media_comments, get_v2_media_likers
Search7get_v2_fbsearch_accounts, get_v2_fbsearch_reels, get_v1_search_hashtags
Hashtags4get_v2_hashtag_medias_top, get_v2_hashtag_medias_recent
Locations3get_g2_location_by_id, get_v1_location_medias_recent_chunk
Stories, highlights, links5get_v2_story_by_url, get_v2_highlight_by_id, get_v1_share_by_url
Audio1get_v2_track_by_id

Core tools carry hand-written descriptions (what the tool does, when to prefer a sibling, pagination, billing) and every tool is annotated read-only. The list lives in src/curated.ts.

Set HIKERAPI_TOOLS=all to expose every non-deprecated endpoint instead — same tool names as before, so existing prompts keep working. Tool names mirror their endpoint (GET /v2/user/by/username → get_v2_user_by_username); call tools/list over MCP for the current list with parameter schemas. Legacy and System groups are excluded in both modes.

Configuration

VariableDescriptionRequired
HIKERAPI_KEYYour HikerAPI access key (sent as x-access-key header)yes
HIKERAPI_URLBase URL. Default: https://api.hikerapi.com (alias https://api.instagrapi.com)no
HIKERAPI_SPEC_URLOpenAPI spec URL. Default: ${HIKERAPI_URL}/openapi.jsonno
HIKERAPI_TOOLScore (default): curated set, one tool per task. all: every non-deprecated endpointno
HIKERAPI_TAGSWhitelist: only include operations with these tags (comma-separated)no
HIKERAPI_EXCLUDE_TAGSBlacklist: additional tags to exclude (on top of default Legacy,System)no
HIKERAPI_TIMEOUT_MSPer-request timeout for API calls. Default: 30000no
HIKERAPI_SPEC_TIMEOUT_MSTimeout for the startup spec fetch. Default: 60000no
HIKERAPI_SPEC_RETRY_DELAY_MSBase delay between the 3 startup spec fetch attempts. Default: 2000no
HIKERAPI_MAX_RESPONSE_BYTESMax bytes read from each API response. Default: 10485760 (10 MB)no
HIKERAPI_MAX_SPEC_BYTESMax bytes read from the OpenAPI spec. Default: 8388608 (8 MB)no

Legacy and System tags are excluded by default. Deprecated operations are also skipped.

If HIKERAPI_URL points to a host other than api.hikerapi.com or api.instagrapi.com, the server prints a warning on startup — your key will be sent there, so only use it for a self-hosted or proxied HikerAPI.

Requests are sent with User-Agent: hikerapi-mcp/<version>.

Example — expose every endpoint of the most common groups:

json
"env": {  "HIKERAPI_KEY": "...",  "HIKERAPI_TOOLS": "all",  "HIKERAPI_TAGS": "User Profile,Post Details,Search,Hashtags,Stories"}

How it works

AI Assistant ←stdio→ hikerapi-mcp ──https──> api.hikerapi.com                          │                          └─ fetches /openapi.json once on startup,                             builds one MCP tool per GET endpoint                             (core set by default)

Tool arguments map to the endpoint's query and path parameters. The response body is returned as-is (JSON text). Non-2xx responses are surfaced as tool errors with the HTTP status and body.

Development

bash
git clone https://github.com/subzeroid/hikerapi-mcp.gitcd hikerapi-mcpnpm installnpm run buildHIKERAPI_KEY=your-key node dist/index.js

Run in watch mode:

bash
HIKERAPI_KEY=your-key npm run dev

Run tests (unit + stdio smoke tests against a local mock server, no network/API key required):

bash
npm test

License

MIT

來源:README.md,提交 0ca4b6a

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v1.1.2最新Oct 6, 2026