Skip to main content
Glama

ig_search_hashtag

Find Instagram hashtag IDs by name to enable media queries. Required step before accessing hashtag content through the Instagram Graph API.

Instructions

Search for a hashtag ID by name. Required before querying hashtag media. Limited to 30 unique hashtags per 7-day rolling window.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesHashtag name to search (without #)

Implementation Reference

  • The `ig_search_hashtag` tool registration and handler implementation. It uses `client.ig` to call the `/ig_hashtag_search` endpoint.
    server.tool(
      "ig_search_hashtag",
      "Search for a hashtag ID by name. Required before querying hashtag media. Limited to 30 unique hashtags per 7-day rolling window.",
      {
        q: z.string().describe("Hashtag name to search (without #)"),
      },
      async ({ q }) => {
        try {
          const { data, rateLimit } = await client.ig("GET", "/ig_hashtag_search", {
            q,
            user_id: client.igUserId,
          });
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Hashtag search failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mikusnuz/meta-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server