接口名 | 类型 | 链接 |
---|---|---|
抖音搜索接口 | post | https://aweme-hl.snssdk.com/aweme/v1/challenge/search/? |
query string parameters 参数:(链接上的附加参数)
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': '69918538596', 'iid': '4230556658973179',
'app_type': 'normal'}
我这里使用模拟器抓的包,params里面有设备信息:device_type、device_brand、device_platform、device_id
DEVICEID可唯一标识一个存储设备,搜索接口基于该参数做有一定的请求限制。
Post表单参数:
data = {
'cursor': 0,
'keyword':'鞠婧祎',
'count': 20,
'hot_search': 0,
'is_pull_refresh': 1,
'search_source': 'challenge',
'search_id':None,
'query_correct_type': 1
}
headers参数:
xgorgon是请求所需的加密参数、xtttoken在搜索接口用于用户身份的标示。
X-Gorgon解密方法就不贴了,不安全
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
}
可以先通过搜索接口根据关键词搜索获得 sec_uid ,或者通过个人关注列表获得。然后请求用户接口。
返回用户基本信息和用户视频数据。
接口名 | 类型 | 链接 |
---|---|---|
用户信息接口 | get | https://aweme.snssdk.com/aweme/v1/aweme/post/? |
sec_user_id 是用户标示,headers同搜索接口。
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
}
接口名 | 类型 | 链接 |
---|---|---|
同城推荐 | get | https://aweme-hl.snssdk.com/aweme/v1/nearby/feed/? |
参数中的city,longitude,latitude 是位置信息,所在城市和所在区域的纬度
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':'69918538596','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
}
接口名 | 类型 | 链接 |
---|---|---|
粉丝列表 | get | https://aweme-hl.snssdk.com/aweme/v1/user/follower/list/? |
params = {
'user_id': 102064772608, # 用户分享页的ID
'sec_user_id':'MS4wLjABAAAAshzXgVS8HqF8PomFlCATZjkjC48Az0d8tk28RXRgrbA', # 用户id
'max_time': '1589765763', # 时间戳
'count': 20,'os_api': 23,
'source_type':1,'address_book_access': 1,'gps_access': '1',
'device_type': 'MI%205s', # 设备
'device_platform': 'android', # 设备类型
'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':'69918538596','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
}
接口名 | 类型 | 链接 |
---|---|---|
明星爱DOU榜 | get | http://aweme.snssdk.com/aweme/v1/hotsearch/star/billboard/ |
抖音好物榜 | get | https://lianmengapi.snssdk.com/ies/v2/discover/popular |
热搜词 | get | https://aweme-lq.snssdk.com/aweme/v1/hot/search/list/?aid=1128&version_code=880 |
热搜词对应的视频 | get | https://aweme-lq.snssdk.com/aweme/v1/hot/search/video/list/?hotword=以色列大使&offset=0&count=20&source=trending_page&aid=1128&version_code=880 |