@olastudio/social-media-sdk 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1511,6 +1511,31 @@ var InstagramAPI = class {
1511
1511
  );
1512
1512
  }
1513
1513
  }
1514
+ /**
1515
+ * Get comments for a media item
1516
+ * @param mediaId - Media ID
1517
+ * @param limit - Max number of comments to fetch (default: 25)
1518
+ * @returns Array of comments
1519
+ */
1520
+ async getMediaComments(mediaId, limit = 25) {
1521
+ try {
1522
+ const response = await this.get(
1523
+ `/${mediaId}/comments`,
1524
+ {
1525
+ fields: "id,text,timestamp,username,like_count,from{id,username},replies{id,text,timestamp,username,like_count}",
1526
+ limit
1527
+ }
1528
+ );
1529
+ return response.data || [];
1530
+ } catch (error) {
1531
+ throw new APIError(
1532
+ `Failed to fetch comments: ${error instanceof Error ? error.message : "Unknown error"}`,
1533
+ void 0,
1534
+ "COMMENTS_FETCH_ERROR",
1535
+ error
1536
+ );
1537
+ }
1538
+ }
1514
1539
  /**
1515
1540
  * Get Instagram account insights
1516
1541
  */