tikapi 3.1.31__tar.gz → 3.1.50__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tikapi
3
- Version: 3.1.31
3
+ Version: 3.1.50
4
4
  Summary: TikAPI | TikTok Unofficial API
5
5
  Home-page: https://www.tikapi.io
6
6
  Author: TikAPI
@@ -9,7 +9,7 @@ INSTALL_REQUIRES = [
9
9
 
10
10
  setup(
11
11
  name='tikapi',
12
- version='3.1.31',
12
+ version='3.1.50',
13
13
  description='TikAPI | TikTok Unofficial API',
14
14
  long_description_content_type="text/markdown",
15
15
  long_description=open("README.md", "r", encoding="utf-8").read(),
@@ -22,13 +22,14 @@ def TikAPI(apiKey: str):
22
22
  nextCursorParams = {}
23
23
 
24
24
  if body.get("hasMore") or body.get("has_more"):
25
- nextCursor = body.get("offset", body.get("cursor"))
25
+ nextCursor = body.get("offset", body.get("cursor", body.get("nextCursor")))
26
26
  if not nextCursor:
27
27
  return None
28
28
 
29
29
  nextCursorParams = {
30
30
  'cursor': nextCursor,
31
- 'offset': nextCursor
31
+ 'offset': nextCursor,
32
+ 'nextCursor': nextCursor
32
33
  }
33
34
 
34
35
  elif body.get('notice_lists'):
@@ -465,12 +465,12 @@ def Rests(options: dict):
465
465
  return wrap({"path":"/public/check","help":"Get a user's profile information","comment":"Get profile information and statistics from a username.","params":{"username":{"help":"The TikTok user username","validate":"^([a-zA-Z0-9_.]+|https?://vm.tiktok.com/[a-zA-Z0-9]+/?)$","type":"string","example":"lilyachty"},"user_id":{"help":"Optionally you can get the profile information using the user_id parameter.","type":"string","validate":"^[0-9]+$"}},"$other":{"openapi":{"hideParams":["user_id","session_id"],"showExamplesInCode":["username"]}},"method":"GET"}, cls.__get_options__(), "Public.check")(username=username, user_id=user_id, country=country, session_id=session_id, **otherParams)
466
466
 
467
467
  @classmethod
468
- def posts(cls, secUid: str = None, count: int = Default(30), cursor: str = None, country: str = None, session_id: int = None, **otherParams) -> APIResponse:
468
+ def posts(cls, secUid: str = None, count: int = Default(30), cursor: str = None, user_id: str = None, country: str = None, session_id: int = None, **otherParams) -> APIResponse:
469
469
  '''
470
470
  Get a user's feed posts
471
471
  '''
472
472
  count = None if count is cls.posts.__defaults__[1] else count
473
- return wrap({"help":"Get a user's feed posts","path":"/public/posts","comment":"<a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","params":{"secUid":{"validate":"^(.*?){30,}$","help":"The TikTok user secUid. You can get this from the <a href='#tag/Public/operation/public.check'>Get profile information</a> endpoint using the username.","type":"string","example":"MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud","required":True},"count":{"example":30,"default":30,"max":30,"type":"number","help":"Maximum amount of items for one request","validate":"^[0-9]{1,2}$"},"cursor":{"help":"The starting point of the items list. Returned in every response, should be included in the next request for iteration.<br><br> *(A simple iteration method is already implemented in the Javascript & Python libraries as seen in the request samples)*","type":"string","validate":"^[0-9]+$"}},"$other":{"openapi":{"hideParams":["session_id"]}},"method":"GET"}, cls.__get_options__(), "Public.posts")(secUid=secUid, count=count, cursor=cursor, country=country, session_id=session_id, **otherParams)
473
+ return wrap({"help":"Get a user's feed posts","path":"/public/posts","comment":"<a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","params":{"secUid":{"validate":"^(.*?){30,}$","help":"The TikTok user secUid. You can get this from the <a href='#tag/Public/operation/public.check'>Get profile information</a> endpoint using the username.","type":"string","example":"MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud","required":True},"count":{"example":30,"default":30,"max":30,"type":"number","help":"Maximum amount of items for one request","validate":"^[0-9]{1,2}$"},"cursor":{"help":"The starting point of the items list. Returned in every response, should be included in the next request for iteration.<br><br> *(A simple iteration method is already implemented in the Javascript & Python libraries as seen in the request samples)*","type":"string","validate":"^[0-9]+$"},"user_id":{"help":"The TikTok user ID","type":"string","validate":"^[0-9]+$"}},"$other":{"openapi":{"hideParams":["session_id","user_id"]}},"method":"GET"}, cls.__get_options__(), "Public.posts")(secUid=secUid, count=count, cursor=cursor, user_id=user_id, country=country, session_id=session_id, **otherParams)
474
474
 
475
475
  @classmethod
476
476
  def likes(cls, secUid: str = None, count: int = Default(30), cursor: str = None, country: str = None, session_id: int = None, **otherParams) -> APIResponse:
@@ -510,7 +510,23 @@ def Rests(options: dict):
510
510
  Get video information
511
511
  '''
512
512
 
513
- return wrap({"path":"/public/video","help":"Get video information","comment":"<a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","params":{"id":{"help":"The video ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)","type":"string","validate":"^([0-9]+|https?://vm.tiktok.com/[a-zA-Z0-9]+/?)$","required":True,"example":"7109178205151464746"}},"$other":{"openapi":{"hideParams":["session_id"]}},"method":"GET"}, cls.__get_options__(), "Public.video")(id=id, country=country, session_id=session_id, **otherParams)
513
+ return wrap({"path":"/public/video","help":"Get video information","comment":"<a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","params":{"id":{"help":"The video ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)","type":"string","validate":"^([0-9]+|https?://vm.tiktok.com/[a-zA-Z0-9]+/?)$","required":True,"example":"7003402629929913605"}},"$other":{"openapi":{"hideParams":["session_id"]}},"method":"GET"}, cls.__get_options__(), "Public.video")(id=id, country=country, session_id=session_id, **otherParams)
514
+
515
+ @classmethod
516
+ def videoV2(cls, id: str = None, country: str = None, session_id: int = None, **otherParams) -> APIResponse:
517
+ '''
518
+ Get video information (alternative endpoint)
519
+ '''
520
+
521
+ return wrap({"path":"/public/video/v2","help":"Get video information (alternative endpoint)","comment":"<a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","params":{"id":{"help":"The video ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)","type":"string","validate":"^([0-9]+|https?://vm.tiktok.com/[a-zA-Z0-9]+/?)$","required":True,"example":"7109178205151464746"}},"$other":{"openapi":{"hide":True,"hideParams":["session_id"]}},"method":"GET"}, cls.__get_options__(), "Public.videoV2")(id=id, country=country, session_id=session_id, **otherParams)
522
+
523
+ @classmethod
524
+ def videoV3(cls, id: str = None, username: str = None, country: str = None, session_id: int = None, **otherParams) -> APIResponse:
525
+ '''
526
+ Get video information (alternative endpoint)
527
+ '''
528
+
529
+ return wrap({"path":"/public/video/v3","help":"Get video information (alternative endpoint)","comment":"<a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","params":{"id":{"help":"The video ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)","type":"string","validate":"^([0-9]+|https?://vm.tiktok.com/[a-zA-Z0-9]+/?)$","required":True,"example":"7109178205151464746"},"username":{"help":"The username of the video author.","validate":"^([a-zA-Z0-9_.]+|https?://vm.tiktok.com/[a-zA-Z0-9]+/?)$","type":"string","required":True}},"$other":{"openapi":{"hide":True,"hideParams":["session_id"]}},"method":"GET"}, cls.__get_options__(), "Public.videoV3")(id=id, username=username, country=country, session_id=session_id, **otherParams)
514
530
 
515
531
  @classmethod
516
532
  def relatedPosts(cls, video_id: str = None, country: str = None, session_id: int = None, **otherParams) -> APIResponse:
@@ -585,12 +601,12 @@ def Rests(options: dict):
585
601
  return wrap({"help":"Discover by keyword","comment":"Get popular posts, users, music or hashtags from a keyword. <br><br>Limited to only a few items. If you want more, try using the <a href='#tag/Public/operation/public.search'>Search</a> endpoint instead.","path":"/public/discover/keyword","params":{"keyword":{"required":True,"example":"lilyachty","type":"string"}},"$other":{"openapi":{"hideParams":["session_id"]}},"method":"GET"}, cls.__get_options__(), "Public.discoverKeyword")(keyword=keyword, country=country, session_id=session_id, **otherParams)
586
602
 
587
603
  @classmethod
588
- def search(cls, category: str = None, query: str = None, session_id: int = None, cursor: int = None, country: str = None, **otherParams) -> APIResponse:
604
+ def search(cls, category: str = None, query: str = None, session_id: int = None, nextCursor: str = None, country: str = None, **otherParams) -> APIResponse:
589
605
  '''
590
606
  Search
591
607
  '''
592
608
 
593
- return wrap({"help":"Search","comment":"Search anything, users, videos, or get keyword autocomplete suggestions. <br/><a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","path":"/public/search/{category}","params":{"category":{"help":"The search category","in":["general","users","videos","autocomplete"],"required":True,"type":"string","example":"general","location":"path"},"query":{"type":"string","example":"lilyachty","required":True,"help":"The search keyword"},"cursor":{"help":"The starting offset of items list. Returned in every response, should be included in the next request for iteration.<br><br> *(A simple iteration method is already implemented in the Javascript & Python libraries as seen in the request samples)*","type":"number","validate":"^[0-9]+$"},"session_id":{"type":"number","max":100,"example":0,"help":"The cookies and IP are preserved through different requests for a longer amount of time. You should use this if you want to keep the search suggestions the same."}},"$other":{"openapi":{"hideParams":["session_id"]}},"method":"GET"}, cls.__get_options__(), "Public.search")(category=category, query=query, session_id=session_id, cursor=cursor, country=country, **otherParams)
609
+ return wrap({"help":"Search","comment":"Search anything, users, videos, or get keyword autocomplete suggestions. <br/><a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","path":"/public/search/{category}","params":{"category":{"help":"The search category","in":["general","users","videos","autocomplete"],"required":True,"type":"string","example":"general","location":"path"},"query":{"type":"string","example":"lilyachty","required":True,"help":"The search keyword"},"nextCursor":{"type":"string","help":"A iteration parameter returned in each response, should be included in the next requests to get the next items."},"session_id":{"type":"number","max":100,"example":0,"help":"The cookies and IP are preserved through different requests for a longer amount of time. You should use this if you want to keep the search suggestions the same."}},"$other":{"openapi":{"hideParams":["session_id"]}},"method":"GET"}, cls.__get_options__(), "Public.search")(category=category, query=query, session_id=session_id, nextCursor=nextCursor, country=country, **otherParams)
594
610
 
595
611
  Rests.Public = Public
596
612
  class UserPostsComments(Rests.BaseClass):
@@ -685,12 +701,12 @@ def Rests(options: dict):
685
701
  return super().set(**values)
686
702
 
687
703
  @classmethod
688
- def feed(cls, count: int = Default(30), cursor: str = None, secUid: str = None, **otherParams) -> APIResponse:
704
+ def feed(cls, count: int = Default(30), cursor: str = None, secUid: str = None, user_id: str = None, **otherParams) -> APIResponse:
689
705
  '''
690
706
  Get feed posts
691
707
  '''
692
708
  count = None if count is cls.feed.__defaults__[0] else count
693
- return wrap({"help":"Get feed posts","comment":"Get current user feed posts, or someone elses by providing the `secUid` parameter.","path":"/user/feed","params":{"count":{"example":30,"default":30,"max":30,"type":"number","help":"Maximum amount of items for one request","validate":"^[0-9]{1,2}$"},"cursor":{"help":"The starting point of the items list. Returned in every response, should be included in the next request for iteration.<br><br> *(A simple iteration method is already implemented in the Javascript & Python libraries as seen in the request samples)*","type":"string","validate":"^[0-9]+$"},"secUid":{"validate":"^(.*?){30,}$","help":"The TikTok user secUid. You can get this from the <a href='#tag/Public/operation/public.check'>Get profile information</a> endpoint using the username.","type":"string","example":"MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud"}},"$other":{"openapi":{"fields":{"security":[{"apiKey":[],"accountKey":["explore"]}]}}},"method":"GET"}, cls.__get_options__(), "UserPosts.feed")(count=count, cursor=cursor, secUid=secUid, **otherParams)
709
+ return wrap({"help":"Get feed posts","comment":"Get current user feed posts, or someone elses by providing the `secUid` parameter.","path":"/user/feed","params":{"count":{"example":30,"default":30,"max":30,"type":"number","help":"Maximum amount of items for one request","validate":"^[0-9]{1,2}$"},"cursor":{"help":"The starting point of the items list. Returned in every response, should be included in the next request for iteration.<br><br> *(A simple iteration method is already implemented in the Javascript & Python libraries as seen in the request samples)*","type":"string","validate":"^[0-9]+$"},"secUid":{"validate":"^(.*?){30,}$","help":"The TikTok user secUid. You can get this from the <a href='#tag/Public/operation/public.check'>Get profile information</a> endpoint using the username.","type":"string","example":"MS4wLjABAAAAsHntXC3s0AvxcecggxsoVa4eAiT8OVafVZ4OQXxy-9htpnUi0sOYSr0kGGD1Loud"},"user_id":{"help":"The TikTok user ID","type":"string","validate":"^[0-9]+$"}},"$other":{"openapi":{"fields":{"security":[{"apiKey":[],"accountKey":["explore"]}]},"hideParams":["user_id"]}},"method":"GET"}, cls.__get_options__(), "UserPosts.feed")(count=count, cursor=cursor, secUid=secUid, user_id=user_id, **otherParams)
694
710
 
695
711
  @classmethod
696
712
  def likes(cls, count: int = Default(30), secUid: str = None, cursor: str = None, **otherParams) -> APIResponse:
@@ -748,13 +764,21 @@ def Rests(options: dict):
748
764
  count = None if count is cls.explore.__defaults__[0] else count
749
765
  return wrap({"help":"Get trending posts","comment":"Get current user recommended posts from the *For You* section.","path":"/user/explore","params":{"count":{"example":30,"default":30,"max":30,"type":"number","help":"Maximum amount of items for one request","validate":"^[0-9]{1,2}$"}},"$other":{"openapi":{"fields":{"security":[{"apiKey":[],"accountKey":["explore"]}]}}},"method":"GET"}, cls.__get_options__(), "UserPosts.explore")(count=count, **otherParams)
750
766
 
767
+ @classmethod
768
+ def search(cls, category: str = None, query: str = None, nextCursor: str = None, **otherParams) -> APIResponse:
769
+ '''
770
+ Search
771
+ '''
772
+
773
+ return wrap({"help":"Search","comment":"Search anything, users, videos, or get keyword autocomplete suggestions. Using this instead of the Public Search endpoint will give you more personalized and consistent results. <br/><a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","path":"/user/search/{category}","params":{"category":{"help":"The search category","in":["general","users","videos","autocomplete"],"required":True,"type":"string","example":"general","location":"path"},"query":{"type":"string","example":"lilyachty","required":True,"help":"The search keyword"},"nextCursor":{"type":"string","help":"A iteration parameter returned in each response, should be included in the next requests to get the next items."}},"$other":{"openapi":{"fields":{"security":[{"apiKey":[],"accountKey":["explore"]}]}}},"method":"GET"}, cls.__get_options__(), "UserPosts.search")(category=category, query=query, nextCursor=nextCursor, **otherParams)
774
+
751
775
  @classmethod
752
776
  def video(cls, id: str = None, **otherParams) -> APIResponse:
753
777
  '''
754
778
  Get video information
755
779
  '''
756
780
 
757
- return wrap({"help":"Get video information","comment":"<a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","path":"/user/video","params":{"id":{"help":"The video ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)","type":"string","validate":"^([0-9]+|https?://vm.tiktok.com/[a-zA-Z0-9]+/?)$","required":True,"example":"7109178205151464746"}},"$other":{"openapi":{"fields":{"security":[{"apiKey":[],"accountKey":["explore"]}]}}},"method":"GET"}, cls.__get_options__(), "UserPosts.video")(id=id, **otherParams)
781
+ return wrap({"help":"Get video information","comment":"<a target=\"_blank\" href='https://helpdesk.tikapi.io/portal/en/kb/articles/how-to-download-tiktok-videos'>\nLearn more about downloading videos</a>\n\n","path":"/user/video","params":{"id":{"help":"The video ID. Can also be a short TikTok link (e.g. vm.tiktok.com/UwU)","type":"string","validate":"^([0-9]+|https?://vm.tiktok.com/[a-zA-Z0-9]+/?)$","required":True,"example":"7003402629929913605"}},"$other":{"openapi":{"fields":{"security":[{"apiKey":[],"accountKey":["explore"]}]}}},"method":"GET"}, cls.__get_options__(), "UserPosts.video")(id=id, **otherParams)
758
782
 
759
783
  @classmethod
760
784
  def like(cls, media_id: str = None, **otherParams) -> APIResponse:
@@ -1022,7 +1046,7 @@ def Rests(options: dict):
1022
1046
  Get analytics
1023
1047
  '''
1024
1048
  days = None if days is cls.analytics.__defaults__[1] else days
1025
- return wrap({"help":"Get analytics","comment":"Get analytics for business or creator accounts","path":"/creator/analytics/{type}","params":{"type":{"required":True,"in":["overview","content","video","followers","live"],"type":"string","help":"The analytics type","example":"overview","location":"path"},"days":{"default":7,"help":"The days time frame for the analytics data","validate":"^[0-9]+$","type":"number"},"media_id":{"help":"Required only for **video** type analytics, otherwise don't include.","validate":"^[0-9]+$"}},"$other":{"openapi":{"fields":{"security":[{"apiKey":[],"accountKey":["view_profile"]}],"tags":["Profile"]}}},"method":"GET"}, cls.__get_options__(), "User.analytics")(type=type, days=days, media_id=media_id, **otherParams)
1049
+ return wrap({"help":"Get analytics","comment":"Get analytics for business or creator accounts","path":"/creator/analytics/{type}","params":{"type":{"required":True,"in":["overview","content","video","followers","live"],"type":"string","help":"The analytics type","example":"overview","location":"path"},"days":{"default":7,"help":"The days time frame for the analytics data","validate":"^[0-9]+$","type":"number"},"media_id":{"help":"Required only for **video** type analytics, otherwise don't include.","validate":"^[0-9]+$"}},"$other":{"openapi":{"fields":{"security":[{"apiKey":[],"accountKey":["view_analytics"]}],"tags":["Profile"]}}},"method":"GET"}, cls.__get_options__(), "User.analytics")(type=type, days=days, media_id=media_id, **otherParams)
1026
1050
 
1027
1051
  @classmethod
1028
1052
  def verify(cls, **otherParams) -> APIResponse:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tikapi
3
- Version: 3.1.31
3
+ Version: 3.1.50
4
4
  Summary: TikAPI | TikTok Unofficial API
5
5
  Home-page: https://www.tikapi.io
6
6
  Author: TikAPI
File without changes
File without changes
File without changes