Tiktok protocol, buffet crawler, interface analysis, search, tiktok recommendation, city recommendation, fan list, etc.

Tiktok protocol, buffet crawler, interface analysis, search, tiktok recommendation, city recommendation, fan list, etc.

Tiktok search interface

Interface nametypelink
Search user comprehensive informationposthttps://aweme-hl.snssdk.com/aweme/v1/challenge/search/?
Search related user listposthttps://search-hl.amemv.com/aweme/v1/discover/search/?
Search the list of related topicsposthttps://search-hl.amemv.com/aweme/v1/challenge/search/?

query string parameters: (additional parameters on the link)

params = {'update_version_code': '9802', 'aid': '1128', 
          'cdid': '46423769-97c1-4fae-a612-44f5ccf4b778', 'resolution': '810*1440', 
		  'language': 'zh', '_rticket': '1588840942288', 'ac': 'wifi', 
		   'os_api': '23', 'channel': 'tengxun_new', 
		   'openudid': 'c055533a0591b2dc', 
		   'device_brand': 'Xiaomi', 'device_type': 'MI%205s', 'device_platform': 'android', 
		   'ssmix': 'a', 
		   'uuid': '008796763985702', 
		   'ts': '1588840941', 
		   'version_name': '9.8.1', 'dpi': '320', 'version_code': '981', 
		   'app_name': 'aweme', 'os_version': '6.0.1', 
		   'manifest_version_code': '981', 
		   'device_id': '699185385', 'iid': '4230556658973179', 
		   'app_type': 'normal'}

I use the package captured by the simulator here. params contains the device information: device_type,device_brand,device_platform,device_id
DEVICEID can uniquely identify a storage device, and the search interface has certain request restrictions based on this parameter.
(the device id in the parameters I posted is false and needs to be replaced with its own)
Post form parameters:

data = {
        'cursor': 0,	
        'keyword':'Ju Jingyi',
        'count': 20,
        'hot_search': 0,
        'is_pull_refresh': 1,
        'search_source': 'challenge',
        'search_id':None,
        'query_correct_type': 1
        }

headers parameter:
xgorgon is the encryption parameter required by the request, and xtttoken is used to identify the user's identity in the search interface.
X-Gorgon decryption method: https://blog.csdn.net/weixin_43582101/article/details/107099581

ts = str(time.time()).split(".")[0]
_rticket = str(time.time() * 1000).split(".")[0]
headers={
        "X-Gorgon":xgorgon,
        "X-Khronos": ts,
        "sdk-version":"1",
        "Accept-Encoding": "gzip",
        "X-SS-REQ-TICKET": _rticket,
        "Host": "aweme.snssdk.com",
        "Connection": "Keep-Alive",
        'User-Agent': 'okhttp/3.10.0.1',
        "x-tt-token":xtttoken
      } 

  • After testing, it takes about 2 minutes to search the xgorgon of the interface. Request once a second, request 130 pieces of data, and need to re acquire xgorgon.
    Of course, you can regenerate xgorgon every request.
  • There is a limit on the number of times each account requests a search interface every day, about 300.
  • If the limit is exceeded, the account needs to be changed, and the params also needs to be changed.

Return data example:

Tiktok user interface

You can search by keyword through the search interface to obtain sec_uid, or through the personal attention list. Then request the user interface.
Return user basic information and user video data.

Interface nametypelink
User information interfacegethttps://aweme.snssdk.com/aweme/v1/aweme/post/?

sec_user_id is the user ID, and headers is the same as the search interface.

params = {
	    'source': 0,
	    'max_cursor': 0,
	    'sec_user_id': 'MS4wLjABAAAA4spaJQ-K6Pv0U0dM38m4_CRmwukteZ02P6XaSc_ZocE',
	    'count': 20,
	    'os_api': 22,
	    'device_type': 'VOG-AL00',
	    'manifest_version_code': 920,
	    'dpi': 192,
	    'app_name': 'aweme',
	    'oaid': '00000000-0000-0000-0000-000000000000',
	    'version_name': '9.2.0',
	    'update_version_code': '9202',
	    'channel': 'aweGW',
	    'device_platform': 'android',
	    'version_code': '920',
	    'device_id': '4300922869784445',
	    'os_version': '5.1.1',
	    'aid': '1128',
}
headers={
        "X-Gorgon":xgorgon,
        "X-Khronos": ts,
        "sdk-version":"1",
        "Accept-Encoding": "gzip",
        "X-SS-REQ-TICKET": _rticket,
        "Host": "aweme.snssdk.com",
        "Connection": "Keep-Alive",
        'User-Agent': 'okhttp/3.10.0.1',
        "x-tt-token":xtttoken
      } 

**
Return data example:

The new user information interface can still be used.

Interface nametypelink
New user interfacegethttps://api3-core-c-lq.amemv.com/aweme/v1/user/profile/other/?sec_user_id={}
New user interfacegethttps://aweme-hl.snssdk.com/aweme/v1/user/?sec_user_id={}
New user interfacegethttps://api3-core-c-hl.amemv.com/aweme/v1/user/profile/other/?sec_user_id={}

Tiktok recommended interface

Interface nametypelink
Intra city recommendationgethttps://aweme-hl.snssdk.com/aweme/v1/nearby/feed/?

City, longitude and latitude in the parameter are location information and the latitude of the city and region

params = {
	    'source': 0,
	    'max_cursor': 0,'device_type': 'MI%205s',
	    'count': 20,'os_api': 23,
	    'roam_city_name':None,'nearby_distance': 0,'location_permission': '1',
	    'pull_type': '1',
	    'poi_class_code': '0',
	    'longitude': '121.47560254929964','latitude': '31.22725617333892',
	    'city': '310000',
	    'version_code': '918','filter_warn': '0','feed_style': '1',
	    'min_cursor': '0',
	    'device_platform':'android','ssmix':'a',
	    'iid':'4230556658973179','manifest_version_code':'981',
	    'dpi':'320','uuid':'008796763985702',
	    'app_name':'aweme','version_name':'9.8.1','ts':'1588925979',
	    'openudid':'c055533a0591b2dc',
	    'device_id':'699185389','resolution':'810*1440','os_version':'6.0.1',
	    'cdid':'46423769-97c1-4fae-a612-44f5ccf4b778',
	    'language': 'zh','device_brand': 'Xiaomi',
	    'app_type': 'normal','ac': 'wifi',
	    'update_version_code': '9802',
	    'aid': '1128','channel': 'tengxun_new',
	    '_rticket': '1588925979489',
		   }

headers={
        "X-Gorgon":xgorgon,
        "X-Khronos": ts,
        "sdk-version":"1",
        "Accept-Encoding": "gzip",
        "X-SS-REQ-TICKET": _rticket,
        "Host": "aweme.snssdk.com",
        "Connection": "Keep-Alive",
        'User-Agent': 'okhttp/3.10.0.1',
        "x-tt-token":xtttoken
      } 

**
Return data example:

User fan list

Interface nametypelink
Fan listgethttps://aweme-hl.snssdk.com/aweme/v1/user/follower/list/?
params = {
	    'user_id': 102064772608,   # ID of user sharing page
	    'sec_user_id':'MS4wLjABAAAAshzXgVS8HqF8PomFlCATZjkjC48Az0d8tk28RXRgrbA',  # User id
	    'max_time': '1589765763',		# time stamp
	    'count': 20,'os_api': 23,
	    'source_type':1,'address_book_access': 1,'gps_access': '1',
	    'device_type': 'MI%205s',		# equipment
	    'device_platform': 'android',		 #	Equipment type
	    'ssmix': 'a','iid': '4230556658973179',
	    'manifest_version_code': '981',
	    'dpi': '320','uuid': '008796763985702','version_code': '981',
	    'app_name':'aweme','version_name':'9.8.1','ts':'1589765764	',
	    'openudid':'c055533a0591b2dc',
	    'device_id':'699185386','resolution':'810*1440','os_version':'6.0.1',
	    'cdid':'46423769-97c1-4fae-a612-44f5ccf4b778',
	    'language': 'zh','device_brand': 'Xiaomi',
	    'app_type': 'normal','ac': 'wifi',
	    'update_version_code': '9802',
	    'aid': '1128','channel': 'tengxun_new',
	    '_rticket': '1588925979489',
		   }

headers={
        "X-Gorgon":xgorgon,
        "X-Khronos": ts,
        "sdk-version":"1",
        "Accept-Encoding": "gzip",
        "X-SS-REQ-TICKET": _rticket,
        "Host": "aweme.snssdk.com",
        "Connection": "Keep-Alive",
        'User-Agent': 'ttnet okhttp/3.10.0.2',
        "x-tt-token":xtttoken
      } 

Return data example:

Other interfaces

Interface nametypelink
Star Love DOU listgethttp://aweme.snssdk.com/aweme/v1/hotsearch/star/billboard/
Tiktokgethttps://lianmengapi.snssdk.com/ies/v2/discover/popular
Hot search wordsgethttps://aweme-lq.snssdk.com/aweme/v1/hot/search/list/?aid=1128&version_code=880
Video corresponding to hot search wordsgethttps://aweme-lq.snssdk.com/aweme/v1/hot/search/video/list/?hotword= Ambassador of Israel & offset = 0 & count = 20 & source = trending_ page&aid=1128&version_ code=880

---------------

Disclaimer: this content is for learning and communication only and shall not be used for commercial purposes. If infringement is involved, contact the author to delete it
 communication v: 1764328791

Keywords: Big Data crawler

Added by anthony88guy on Wed, 05 Jan 2022 07:15:29 +0200