Function: getMediaInfo()
function getMediaInfo(client, mediaId): Promise<{
[key: string]: unknown;
caption?: | {
[key: string]: unknown;
text?: string;
}
| null;
code?: string;
comment_count?: number | null;
id?: string;
image_versions2?: {
[key: string]: unknown;
candidates?: object[];
};
like_count?: number | null;
media_type?: number;
pk?: string;
taken_at?: number;
user?: {
[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;
};
usertags?: | {
[key: string]: unknown;
in?: object[];
}
| null;
video_versions?: object[] | null;
}>;Fetches one media by its full id (the pk_userid composite the feed returns). media/{id}/info/ wraps the media in a one-element items array. The single item is validated into the Media model. A missing item or a shape mismatch surfaces as a typed error.
Parameters
| Parameter | Type |
|---|---|
client | PrivateClient |
mediaId | string |
Returns
Promise<{ [key: string]: unknown; caption?: | { [key: string]: unknown; text?: string; } | null; code?: string; comment_count?: number | null; id?: string; image_versions2?: { [key: string]: unknown; candidates?: object[]; }; like_count?: number | null; media_type?: number; pk?: string; taken_at?: number; user?: { [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; }; usertags?: | { [key: string]: unknown; in?: object[]; } | null; video_versions?: object[] | null; }>