@@ -57,16 +57,30 @@ def search(self, query):
57
57
"""
58
58
return self .request ("instagram/search" , {"query" : query })
59
59
60
+ def get_web_profile_info (self , username ):
61
+ """
62
+ Retrieve user web profile information by username.
63
+
64
+ Args:
65
+ username (str): Username
66
+
67
+ For more information, see documentation: https://docs.rocketapi.io/api/instagram/user/get_web_profile_info
68
+ """
69
+ return self .request (
70
+ "instagram/user/get_web_profile_info" , {"username" : username }
71
+ )
72
+
60
73
def get_user_info (self , username ):
61
74
"""
62
75
Retrieve user information by username.
76
+ This is an alias for get_web_profile_info.
63
77
64
78
Args:
65
79
username (str): Username
66
80
67
81
For more information, see documentation: https://docs.rocketapi.io/api/instagram/user/get_info
68
82
"""
69
- return self .request ( "instagram/user/get_info" , { " username" : username } )
83
+ return self .get_web_profile_info ( username )
70
84
71
85
def get_user_info_by_id (self , user_id ):
72
86
"""
@@ -97,6 +111,24 @@ def get_user_media(self, user_id, count=12, max_id=None):
97
111
payload ["max_id" ] = max_id
98
112
return self .request ("instagram/user/get_media" , payload )
99
113
114
+ def get_user_media_by_username (self , username , count = 12 , max_id = None ):
115
+ """
116
+ Retrieve user media by username.
117
+
118
+ Args:
119
+ username (str): Username
120
+ count (int): Number of media to retrieve (max: 12)
121
+ max_id (str): Use for pagination
122
+
123
+ You can use the `max_id` parameter to paginate through the media (take from the `next_max_id` field of the response).
124
+
125
+ For more information, see documentation: https://docs.rocketapi.io/api/instagram/user/get_media_by_username
126
+ """
127
+ payload = {"username" : username , "count" : count }
128
+ if max_id is not None :
129
+ payload ["max_id" ] = max_id
130
+ return self .request ("instagram/user/get_media_by_username" , payload )
131
+
100
132
def get_user_clips (self , user_id , count = 12 , max_id = None ):
101
133
"""
102
134
Retrieve user clips (videos from "Reels" section) by id.
@@ -294,24 +326,39 @@ def get_media_info_by_shortcode(self, shortcode):
294
326
"instagram/media/get_info_by_shortcode" , {"shortcode" : shortcode }
295
327
)
296
328
297
- def get_media_likes (self , shortcode , count = 12 , max_id = None ):
329
+ def get_media_likes_by_shortcode (self , shortcode ):
298
330
"""
299
331
Retrieve up to 1000 media likes by media shortcode.
300
332
301
333
Args:
302
334
shortcode (str): Media shortcode
303
- count (int): Not supported right now
304
- max_id (str): Not supported right now
305
335
306
336
Pagination is not supported for this endpoint.
307
337
308
338
For more information, see documentation: https://docs.rocketapi.io/api/instagram/media/get_likes
309
339
"""
310
- payload = {"shortcode" : shortcode , "count" : count }
311
- if max_id is not None :
312
- payload ["max_id" ] = max_id
340
+ payload = {"shortcode" : shortcode }
313
341
return self .request ("instagram/media/get_likes" , payload )
314
342
343
+ def get_media_likes (self , shortcode , count = 12 , max_id = None ):
344
+ """
345
+ Retrieve up to 1000 media likes by media shortcode.
346
+ This is an alias for get_media_likes_by_shortcode.
347
+
348
+ Note: The parameters count and max_id are kept for backward compatibility but are no longer supported.
349
+
350
+ Args:
351
+ shortcode (str): Media shortcode
352
+ count (int): DEPRECATED - No longer supported
353
+ max_id (str): DEPRECATED - No longer supported
354
+
355
+ Pagination is not supported for this endpoint.
356
+
357
+ For more information, see documentation: https://docs.rocketapi.io/api/instagram/media/get_likes
358
+ """
359
+ # Ignoring count and max_id parameters as they're no longer supported
360
+ return self .get_media_likes_by_shortcode (shortcode )
361
+
315
362
def get_media_likes_by_id (self , media_id ):
316
363
"""
317
364
Retrieve up to 1000 media likes by media id.
@@ -434,14 +481,15 @@ def get_hashtag_info(self, name):
434
481
"""
435
482
return self .request ("instagram/hashtag/get_info" , {"name" : name })
436
483
437
- def get_hashtag_media (self , name , page = None , max_id = None ):
484
+ def get_hashtag_media (self , name , page = None , max_id = None , tab = None ):
438
485
"""
439
486
Retrieve hashtag media by hashtag name.
440
487
441
488
Args:
442
489
name (str): Hashtag name
443
490
page (int): Page number
444
491
max_id (str): Use for pagination
492
+ tab (str): Tab name: recent, top, or clips (default: recent)
445
493
446
494
In order to use pagination, you need to use both the `max_id` and `page` parameters. You can obtain these values from the response's `next_page` and `next_max_id` fields.
447
495
@@ -452,6 +500,8 @@ def get_hashtag_media(self, name, page=None, max_id=None):
452
500
payload ["page" ] = page
453
501
if max_id is not None :
454
502
payload ["max_id" ] = max_id
503
+ if tab is not None :
504
+ payload ["tab" ] = tab
455
505
return self .request ("instagram/hashtag/get_media" , payload )
456
506
457
507
def get_highlight_stories_bulk (self , highlight_ids ):
@@ -611,13 +661,19 @@ def search_audios(self, query):
611
661
"""
612
662
return self .request ("instagram/audio/search" , {"query" : query })
613
663
614
- def search_clips (self , query ):
664
+ def search_clips (self , query , max_id = None ):
615
665
"""
616
666
Search for a specific clip with a caption that includes the query (max 12 results)
617
667
618
668
Args:
619
669
query (str): The search query
670
+ max_id (str): Use for pagination
671
+
672
+ You can use the max_id parameter to paginate through following (take from the reels_max_id field of the response).
620
673
621
674
For more information, see documentation: https://docs.rocketapi.io/api/instagram/media/search_clips
622
675
"""
623
- return self .request ("instagram/media/search_clips" , {"query" : query })
676
+ payload = {"query" : query }
677
+ if max_id is not None :
678
+ payload ["max_id" ] = max_id
679
+ return self .request ("instagram/media/search_clips" , payload )
0 commit comments