Skip to content

Interface: FriendshipApi ​

The follow graph: relationship actions and the follower/following lists.

Methods ​

addCloseFriend() ​

ts
addCloseFriend(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Adds a user to the account's close friends.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


approve() ​

ts
approve(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Approves a follow request.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


block() ​

ts
block(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Blocks a user.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


deny() ​

ts
deny(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Denies a follow request.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


follow() ​

ts
follow(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Follows a user, or sends a request to a private one.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


followers() ​

ts
followers(pk, options?): Promise<Page<{
[key: string]: unknown;
  biography?: string;
  external_url?: string | null;
  follower_count?: number | null;
  following_count?: number | null;
  full_name?: string;
  is_private?: boolean;
  is_verified?: boolean;
  media_count?: number | null;
  pk?: string;
  profile_pic_url?: string | null;
  username?: string;
}>>;

One page of a user's followers.

Parameters ​

ParameterType
pkstring
options?FollowListOptions

Returns ​

Promise<Page<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>>


following() ​

ts
following(pk, options?): Promise<Page<{
[key: string]: unknown;
  biography?: string;
  external_url?: string | null;
  follower_count?: number | null;
  following_count?: number | null;
  full_name?: string;
  is_private?: boolean;
  is_verified?: boolean;
  media_count?: number | null;
  pk?: string;
  profile_pic_url?: string | null;
  username?: string;
}>>;

One page of the accounts a user follows.

Parameters ​

ParameterType
pkstring
options?FollowListOptions

Returns ​

Promise<Page<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>>


mute() ​

ts
mute(pk, options?): Promise<void>;

Mutes a user's posts, stories or both, without unfollowing.

Parameters ​

ParameterType
pkstring
options?MuteOptions

Returns ​

Promise<void>


paginateFollowers() ​

ts
paginateFollowers(pk): AsyncGenerator<{
[key: string]: unknown;
  biography?: string;
  external_url?: string | null;
  follower_count?: number | null;
  following_count?: number | null;
  full_name?: string;
  is_private?: boolean;
  is_verified?: boolean;
  media_count?: number | null;
  pk?: string;
  profile_pic_url?: string | null;
  username?: string;
}>;

Walks a user's followers, one at a time across pages.

Parameters ​

ParameterType
pkstring

Returns ​

AsyncGenerator<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>


paginateFollowing() ​

ts
paginateFollowing(pk): AsyncGenerator<{
[key: string]: unknown;
  biography?: string;
  external_url?: string | null;
  follower_count?: number | null;
  following_count?: number | null;
  full_name?: string;
  is_private?: boolean;
  is_verified?: boolean;
  media_count?: number | null;
  pk?: string;
  profile_pic_url?: string | null;
  username?: string;
}>;

Walks the accounts a user follows, one at a time across pages.

Parameters ​

ParameterType
pkstring

Returns ​

AsyncGenerator<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>


paginatePending() ​

ts
paginatePending(): AsyncGenerator<{
[key: string]: unknown;
  biography?: string;
  external_url?: string | null;
  follower_count?: number | null;
  following_count?: number | null;
  full_name?: string;
  is_private?: boolean;
  is_verified?: boolean;
  media_count?: number | null;
  pk?: string;
  profile_pic_url?: string | null;
  username?: string;
}>;

Walks the follow requests waiting for approval.

Returns ​

AsyncGenerator<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>


pending() ​

ts
pending(options?): Promise<Page<{
[key: string]: unknown;
  biography?: string;
  external_url?: string | null;
  follower_count?: number | null;
  following_count?: number | null;
  full_name?: string;
  is_private?: boolean;
  is_verified?: boolean;
  media_count?: number | null;
  pk?: string;
  profile_pic_url?: string | null;
  username?: string;
}>>;

One page of the follow requests waiting for approval.

Parameters ​

ParameterType
options?FollowListOptions

Returns ​

Promise<Page<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>>


removeCloseFriend() ​

ts
removeCloseFriend(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Removes a user from the account's close friends.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


removeFollower() ​

ts
removeFollower(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Removes a user from the account's followers.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


status() ​

ts
status(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

How the account relates to a user: following, followed by, blocking, and so on.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


unblock() ​

ts
unblock(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Unblocks a user.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


unfollow() ​

ts
unfollow(pk): Promise<{
[key: string]: unknown;
  blocking?: boolean;
  followed_by?: boolean;
  following?: boolean;
  incoming_request?: boolean;
  is_bestie?: boolean;
  is_muting_reel?: boolean;
  is_private?: boolean;
  is_restricted?: boolean;
  muting?: boolean;
  outgoing_request?: boolean;
}>;

Unfollows a user, or withdraws a pending request.

Parameters ​

ParameterType
pkstring

Returns ​

Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>


unmute() ​

ts
unmute(pk, options?): Promise<void>;

Undoes a mute.

Parameters ​

ParameterType
pkstring
options?MuteOptions

Returns ​

Promise<void>

MIT License. Not affiliated with, endorsed or sponsored by Meta or Instagram.