naystack - v1.5.10
    Preparing search index...
    • Fetches an Instagram user's profile. Defaults to the authenticated user ("me").

      Parameters

      • token: string

        Instagram access token.

      • Optionalid: string

        User id to fetch. Defaults to "me" (the token owner).

      • Optionalfields: string[]

        Optional array of field names to request. Default: ["username", "followers_count", "media_count"].

      Returns Promise<T & InstagramError | null>

      Promise of user data (typed as T, defaults to InstagramUser).

      import { getInstagramUser } from "naystack/socials";

      const user = await getInstagramUser(accessToken);
      console.log(user?.username, user?.followers_count);