rocketapi 1.0.7__tar.gz → 1.0.9__tar.gz

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.
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rocketapi
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Summary: RocketAPI Python SDK
5
5
  Home-page: https://github.com/rocketapi-io/rocketapi-python
6
- Download-URL: https://github.com/rocketapi-io/rocketapi-python/archive/refs/tags/v1.0.7.tar.gz
6
+ Download-URL: https://github.com/rocketapi-io/rocketapi-python/archive/refs/tags/v1.0.9.tar.gz
7
7
  Author: RocketAPI
8
8
  Author-email: developer@rocketapi.io
@@ -48,6 +48,7 @@ class InstagramAPI(RocketAPI):
48
48
  - `search_hashtags`
49
49
  - `search_locations`
50
50
  - `search_audios`
51
+ - `search_clips`
51
52
 
52
53
  Args:
53
54
  query (str): The search query
@@ -102,7 +103,7 @@ class InstagramAPI(RocketAPI):
102
103
 
103
104
  Args:
104
105
  user_id (int): User id
105
- count (int): Number of media to retrieve (max: 50)
106
+ count (int): Number of media to retrieve (max: 12)
106
107
  max_id (str): Use for pagination
107
108
 
108
109
  You can use the `max_id` parameter to paginate through the media (take from the `max_id` (!) field of the response).
@@ -311,6 +312,19 @@ class InstagramAPI(RocketAPI):
311
312
  payload["max_id"] = max_id
312
313
  return self.request("instagram/media/get_likes", payload)
313
314
 
315
+ def get_media_likes_by_id(self, media_id):
316
+ """
317
+ Retrieve up to 1000 media likes by media id.
318
+
319
+ Args:
320
+ media_id (int): Media id
321
+
322
+ Pagination is not supported for this endpoint.
323
+
324
+ For more information, see documentation: https://docs.rocketapi.io/api/instagram/media/get_likes_by_id
325
+ """
326
+ return self.request("instagram/media/get_likes_by_id", {"id": media_id})
327
+
314
328
  def get_media_comments(self, media_id, can_support_threading=True, min_id=None):
315
329
  """
316
330
  Retrieve media comments by media id.
@@ -375,7 +389,7 @@ class InstagramAPI(RocketAPI):
375
389
  """
376
390
  return self.request("instagram/location/get_info", {"id": location_id})
377
391
 
378
- def get_location_media(self, location_id, page=None, max_id=None):
392
+ def get_location_media(self, location_id, page=None, max_id=None, tab=None):
379
393
  """
380
394
  Retrieve location media by location id.
381
395
 
@@ -383,6 +397,7 @@ class InstagramAPI(RocketAPI):
383
397
  location_id (int): Location id
384
398
  page (int): Page number
385
399
  max_id (str): Use for pagination
400
+ tab (str): Tab name: recent, ranked (default: recent)
386
401
 
387
402
  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.
388
403
 
@@ -393,6 +408,8 @@ class InstagramAPI(RocketAPI):
393
408
  payload["page"] = page
394
409
  if max_id is not None:
395
410
  payload["max_id"] = max_id
411
+ if tab is not None:
412
+ payload["tab"] = tab
396
413
  return self.request("instagram/location/get_media", payload)
397
414
 
398
415
  def get_hashtag_info(self, name):
@@ -500,13 +517,38 @@ class InstagramAPI(RocketAPI):
500
517
  payload["max_id"] = max_id
501
518
  return self.request("instagram/audio/get_media", payload)
502
519
 
520
+ def get_audio_media_by_canonical_id(self, audio_canonical_id, max_id=None):
521
+ """
522
+ Retrieve audio media by audio canonical id.
523
+
524
+ Args:
525
+ audio_canonical_id (int): Audio canonical id
526
+ max_id (str): Use for pagination
527
+
528
+ You can use the `max_id` parameter to paginate through media (take from the `next_max_id` field of the response).
529
+
530
+ For more information, see documentation: https://docs.rocketapi.io/api/instagram/audio/get_media_by_canonical_id
531
+ """
532
+ payload = {"id": audio_canonical_id}
533
+ if max_id is not None:
534
+ payload["max_id"] = max_id
535
+ return self.request("instagram/audio/get_media_by_canonical_id", payload)
536
+
537
+ def get_live_info(self, broadcast_id):
538
+ """
539
+ Retrieve live information by broadcast id.
540
+
541
+ Args:
542
+ broadcast_id (int): Broadcast id
543
+
544
+ For more information, see documentation: https://docs.rocketapi.io/api/instagram/live/get_info
545
+ """
546
+ return self.request("instagram/live/get_info", {"id": broadcast_id})
547
+
503
548
  def get_user_about(self, user_id):
504
549
  """
505
550
  Obtain user details from «About this Account» section.
506
551
 
507
- ⭐️ This method is exclusively available to our Enterprise+ clients.
508
- If you wish to enable it for your account, please get in touch with our support team: https://t.me/rocketapi
509
-
510
552
  Args:
511
553
  user_id (int): User id
512
554
 
@@ -557,3 +599,14 @@ class InstagramAPI(RocketAPI):
557
599
  For more information, see documentation: https://docs.rocketapi.io/api/instagram/audio/search
558
600
  """
559
601
  return self.request("instagram/audio/search", {"query": query})
602
+
603
+ def search_clips(self, query):
604
+ """
605
+ Search for a specific clip with a caption that includes the query (max 12 results)
606
+
607
+ Args:
608
+ query (str): The search query
609
+
610
+ For more information, see documentation: https://docs.rocketapi.io/api/instagram/media/search_clips
611
+ """
612
+ return self.request("instagram/media/search_clips", {"query": query})
@@ -11,6 +11,7 @@ class RocketAPI:
11
11
  For more information, see documentation: https://docs.rocketapi.io/api/
12
12
  """
13
13
  self.base_url = "https://v1.rocketapi.io/"
14
+ self.version = "1.0.9"
14
15
  self.token = token
15
16
  self.max_timeout = max_timeout
16
17
 
@@ -18,6 +19,9 @@ class RocketAPI:
18
19
  return requests.post(
19
20
  url=self.base_url + method,
20
21
  json=data,
21
- headers={"Authorization": f"Token {self.token}"},
22
+ headers={
23
+ "Authorization": f"Token {self.token}",
24
+ "User-Agent": f"RocketAPI Python SDK/{self.version}",
25
+ },
22
26
  timeout=self.max_timeout,
23
27
  ).json()
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rocketapi
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Summary: RocketAPI Python SDK
5
5
  Home-page: https://github.com/rocketapi-io/rocketapi-python
6
- Download-URL: https://github.com/rocketapi-io/rocketapi-python/archive/refs/tags/v1.0.7.tar.gz
6
+ Download-URL: https://github.com/rocketapi-io/rocketapi-python/archive/refs/tags/v1.0.9.tar.gz
7
7
  Author: RocketAPI
8
8
  Author-email: developer@rocketapi.io
@@ -3,12 +3,12 @@ import setuptools
3
3
 
4
4
  setuptools.setup(
5
5
  name="rocketapi",
6
- version="1.0.7",
6
+ version="1.0.9",
7
7
  author="RocketAPI",
8
8
  author_email="developer@rocketapi.io",
9
9
  description="RocketAPI Python SDK",
10
10
  packages=["rocketapi"],
11
11
  url="https://github.com/rocketapi-io/rocketapi-python",
12
- download_url="https://github.com/rocketapi-io/rocketapi-python/archive/refs/tags/v1.0.7.tar.gz",
12
+ download_url="https://github.com/rocketapi-io/rocketapi-python/archive/refs/tags/v1.0.9.tar.gz",
13
13
  install_requires=["requests"],
14
14
  )
File without changes
File without changes
File without changes