Skip to main content
Glama

ig_get_hashtag

Retrieve Instagram hashtag details using a specific ID to analyze performance metrics and content trends.

Instructions

Get hashtag information by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashtag_idYesHashtag ID (from ig_search_hashtag)

Implementation Reference

  • Implementation of the ig_get_hashtag tool, which retrieves hashtag information from the Instagram API using a provided hashtag ID.
    server.tool(
      "ig_get_hashtag",
      "Get hashtag information by ID.",
      {
        hashtag_id: z.string().describe("Hashtag ID (from ig_search_hashtag)"),
      },
      async ({ hashtag_id }) => {
        try {
          const { data, rateLimit } = await client.ig("GET", `/${hashtag_id}`, {
            fields: "id,name,media_count",
          });
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Get hashtag 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