Interface: UploadApi
Publishing media.
Methods
album()
album(items, options?): 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;
}>;Publishes 2 to 10 photos and videos as one carousel post.
Parameters
| Parameter | Type |
|---|---|
items | readonly AlbumItem[] |
options? | AlbumUploadOptions |
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; }>
photo()
photo(jpeg, options?): 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;
}>;Publishes a JPEG as a post.
Parameters
| Parameter | Type |
|---|---|
jpeg | Uint8Array |
options? | PhotoUploadOptions |
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; }>
reel()
reel(
mp4,
coverJpeg,
options?
): 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;
}>;Publishes an MP4 as a reel, with a separate cover picture.
Parameters
| Parameter | Type |
|---|---|
mp4 | Uint8Array |
coverJpeg | Uint8Array |
options? | ReelUploadOptions |
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; }>
story()
story(jpeg): 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;
}>;Publishes a JPEG as a story.
Parameters
| Parameter | Type |
|---|---|
jpeg | Uint8Array |
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; }>
video()
video(
mp4,
coverJpeg,
options?
): 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;
}>;Publishes an MP4 with its cover as a post.
Parameters
| Parameter | Type |
|---|---|
mp4 | Uint8Array |
coverJpeg | Uint8Array |
options? | VideoUploadOptions |
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; }>