All URIs are relative to https://api.unifapi.com
| Method | HTTP request | Description |
|---|---|---|
| tiktok_feed_recommended_post | POST /tiktok/feed/recommended | Get TikTok recommendation videos |
| tiktok_hashtags_id_get | GET /tiktok/hashtags/{id} | Get a TikTok hashtag by ID |
| tiktok_hashtags_id_videos_get | GET /tiktok/hashtags/{id}/videos | List videos tagged with a TikTok hashtag |
| tiktok_music_id_get | GET /tiktok/music/{id} | Get a TikTok music track by ID |
| tiktok_music_id_videos_get | GET /tiktok/music/{id}/videos | List videos using a TikTok music track |
| tiktok_search_get | GET /tiktok/search | General TikTok search (returns videos) |
| tiktok_search_hashtags_get | GET /tiktok/search/hashtags | Search TikTok hashtags by keyword |
| tiktok_search_users_get | GET /tiktok/search/users | Search TikTok users by keyword |
| tiktok_search_videos_get | GET /tiktok/search/videos | Search TikTok videos by keyword |
| tiktok_users_id_followers_get | GET /tiktok/users/{id}/followers | List a TikTok user's followers |
| tiktok_users_id_following_get | GET /tiktok/users/{id}/following | List users a TikTok user is following |
| tiktok_users_id_get | GET /tiktok/users/{id} | Get a TikTok user profile |
| tiktok_users_id_likes_get | GET /tiktok/users/{id}/likes | List videos liked by a TikTok user |
| tiktok_users_id_videos_get | GET /tiktok/users/{id}/videos | List videos posted by a TikTok user |
| tiktok_users_resolve_get | GET /tiktok/users/resolve | Resolve a TikTok username to a user id |
| tiktok_videos_batch_post | POST /tiktok/videos/batch | Batch-fetch TikTok videos by ID |
| tiktok_videos_id_comments_comment_id_replies_get | GET /tiktok/videos/{id}/comments/{comment_id}/replies | List replies to a TikTok comment |
| tiktok_videos_id_comments_get | GET /tiktok/videos/{id}/comments | List top-level comments on a TikTok video |
| tiktok_videos_id_get | GET /tiktok/videos/{id} | Get a TikTok video by ID |
| tiktok_videos_resolve_get | GET /tiktok/videos/resolve | Resolve a TikTok share URL to a video |
tiktok_feed_recommended_post(opts)
Get TikTok recommendation videos
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
opts = {
tiktok_feed_recommended_post_request: Unifapi::TiktokFeedRecommendedPostRequest.new # TiktokFeedRecommendedPostRequest |
}
begin
# Get TikTok recommendation videos
result = api_instance.tiktok_feed_recommended_post(opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_feed_recommended_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_feed_recommended_post_with_http_info(opts)
begin
# Get TikTok recommendation videos
data, status_code, headers = api_instance.tiktok_feed_recommended_post_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokFeedRecommendedPost200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_feed_recommended_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| tiktok_feed_recommended_post_request | TiktokFeedRecommendedPostRequest | [optional] |
TiktokFeedRecommendedPost200Response
- Content-Type: application/json
- Accept: application/json
tiktok_hashtags_id_get(id)
Get a TikTok hashtag by ID
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String |
begin
# Get a TikTok hashtag by ID
result = api_instance.tiktok_hashtags_id_get(id)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_hashtags_id_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_hashtags_id_get_with_http_info(id)
begin
# Get a TikTok hashtag by ID
data, status_code, headers = api_instance.tiktok_hashtags_id_get_with_http_info(id)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokHashtagsIdGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_hashtags_id_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String |
TiktokHashtagsIdGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_hashtags_id_videos_get(id, opts)
List videos tagged with a TikTok hashtag
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String |
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# List videos tagged with a TikTok hashtag
result = api_instance.tiktok_hashtags_id_videos_get(id, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_hashtags_id_videos_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_hashtags_id_videos_get_with_http_info(id, opts)
begin
# List videos tagged with a TikTok hashtag
data, status_code, headers = api_instance.tiktok_hashtags_id_videos_get_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokHashtagsIdVideosGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_hashtags_id_videos_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokHashtagsIdVideosGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_music_id_get(id)
Get a TikTok music track by ID
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String |
begin
# Get a TikTok music track by ID
result = api_instance.tiktok_music_id_get(id)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_music_id_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_music_id_get_with_http_info(id)
begin
# Get a TikTok music track by ID
data, status_code, headers = api_instance.tiktok_music_id_get_with_http_info(id)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokMusicIdGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_music_id_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String |
- Content-Type: Not defined
- Accept: application/json
tiktok_music_id_videos_get(id, opts)
List videos using a TikTok music track
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String |
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# List videos using a TikTok music track
result = api_instance.tiktok_music_id_videos_get(id, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_music_id_videos_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_music_id_videos_get_with_http_info(id, opts)
begin
# List videos using a TikTok music track
data, status_code, headers = api_instance.tiktok_music_id_videos_get_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokHashtagsIdVideosGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_music_id_videos_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokHashtagsIdVideosGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_search_get(q, opts)
General TikTok search (returns videos)
Returns TikTok videos for the keyword q. Use type-specific endpoints when needed.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
q = 'q_example' # String | Search keyword
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# General TikTok search (returns videos)
result = api_instance.tiktok_search_get(q, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_search_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_search_get_with_http_info(q, opts)
begin
# General TikTok search (returns videos)
data, status_code, headers = api_instance.tiktok_search_get_with_http_info(q, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokHashtagsIdVideosGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_search_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| q | String | Search keyword | |
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokHashtagsIdVideosGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_search_hashtags_get(q, opts)
Search TikTok hashtags by keyword
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
q = 'q_example' # String | Search keyword
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# Search TikTok hashtags by keyword
result = api_instance.tiktok_search_hashtags_get(q, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_search_hashtags_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_search_hashtags_get_with_http_info(q, opts)
begin
# Search TikTok hashtags by keyword
data, status_code, headers = api_instance.tiktok_search_hashtags_get_with_http_info(q, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokSearchHashtagsGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_search_hashtags_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| q | String | Search keyword | |
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokSearchHashtagsGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_search_users_get(q, opts)
Search TikTok users by keyword
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
q = 'q_example' # String | Search keyword
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# Search TikTok users by keyword
result = api_instance.tiktok_search_users_get(q, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_search_users_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_search_users_get_with_http_info(q, opts)
begin
# Search TikTok users by keyword
data, status_code, headers = api_instance.tiktok_search_users_get_with_http_info(q, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokSearchUsersGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_search_users_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| q | String | Search keyword | |
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokSearchUsersGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_search_videos_get(q, opts)
Search TikTok videos by keyword
Returns a paginated list of TikTok videos matching the keyword q. Use next_cursor from the response as the next request's cursor.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
q = 'q_example' # String | Search keyword
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# Search TikTok videos by keyword
result = api_instance.tiktok_search_videos_get(q, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_search_videos_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_search_videos_get_with_http_info(q, opts)
begin
# Search TikTok videos by keyword
data, status_code, headers = api_instance.tiktok_search_videos_get_with_http_info(q, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokHashtagsIdVideosGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_search_videos_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| q | String | Search keyword | |
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokHashtagsIdVideosGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_users_id_followers_get(id, opts)
List a TikTok user's followers
Returns a paginated list of users following the given user.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String | TikTok sec_uid, numeric user id, or public handle.
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# List a TikTok user's followers
result = api_instance.tiktok_users_id_followers_get(id, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_followers_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_users_id_followers_get_with_http_info(id, opts)
begin
# List a TikTok user's followers
data, status_code, headers = api_instance.tiktok_users_id_followers_get_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokSearchUsersGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_followers_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | TikTok sec_uid, numeric user id, or public handle. | |
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokSearchUsersGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_users_id_following_get(id, opts)
List users a TikTok user is following
Returns a paginated list of users the given user is following.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String | TikTok sec_uid, numeric user id, or public handle.
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# List users a TikTok user is following
result = api_instance.tiktok_users_id_following_get(id, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_following_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_users_id_following_get_with_http_info(id, opts)
begin
# List users a TikTok user is following
data, status_code, headers = api_instance.tiktok_users_id_following_get_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokSearchUsersGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_following_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | TikTok sec_uid, numeric user id, or public handle. | |
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokSearchUsersGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_users_id_get(id)
Get a TikTok user profile
Returns the canonicalized public profile for the TikTok user with the given sec_uid, numeric user id, or handle.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String | TikTok sec_uid, numeric user id, or public handle.
begin
# Get a TikTok user profile
result = api_instance.tiktok_users_id_get(id)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_users_id_get_with_http_info(id)
begin
# Get a TikTok user profile
data, status_code, headers = api_instance.tiktok_users_id_get_with_http_info(id)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokUsersIdGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | TikTok sec_uid, numeric user id, or public handle. |
- Content-Type: Not defined
- Accept: application/json
tiktok_users_id_likes_get(id, opts)
List videos liked by a TikTok user
Returns a paginated list of videos the user has liked where the user has made their likes public.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String | TikTok sec_uid, numeric user id, or public handle.
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# List videos liked by a TikTok user
result = api_instance.tiktok_users_id_likes_get(id, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_likes_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_users_id_likes_get_with_http_info(id, opts)
begin
# List videos liked by a TikTok user
data, status_code, headers = api_instance.tiktok_users_id_likes_get_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokHashtagsIdVideosGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_likes_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | TikTok sec_uid, numeric user id, or public handle. | |
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokHashtagsIdVideosGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_users_id_videos_get(id, opts)
List videos posted by a TikTok user
Returns a paginated list of public videos posted by the user. Use next_cursor from the response as the next request's cursor.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String | TikTok sec_uid, numeric user id, or public handle.
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# List videos posted by a TikTok user
result = api_instance.tiktok_users_id_videos_get(id, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_videos_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_users_id_videos_get_with_http_info(id, opts)
begin
# List videos posted by a TikTok user
data, status_code, headers = api_instance.tiktok_users_id_videos_get_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokHashtagsIdVideosGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_id_videos_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | TikTok sec_uid, numeric user id, or public handle. | |
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokHashtagsIdVideosGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_users_resolve_get(username)
Resolve a TikTok username to a user id
Accepts a public TikTok username (handle) and returns the user's stable opaque id for other /tiktok/users/{id} endpoints.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
username = 'username_example' # String | Public TikTok handle, e.g. 'jennmelon'
begin
# Resolve a TikTok username to a user id
result = api_instance.tiktok_users_resolve_get(username)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_resolve_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_users_resolve_get_with_http_info(username)
begin
# Resolve a TikTok username to a user id
data, status_code, headers = api_instance.tiktok_users_resolve_get_with_http_info(username)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokUsersResolveGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_users_resolve_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| username | String | Public TikTok handle, e.g. 'jennmelon' |
TiktokUsersResolveGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_videos_batch_post(opts)
Batch-fetch TikTok videos by ID
Returns canonicalized metadata for up to 20 TikTok videos.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
opts = {
tiktok_videos_batch_post_request: Unifapi::TiktokVideosBatchPostRequest.new({ids: ['ids_example']}) # TiktokVideosBatchPostRequest |
}
begin
# Batch-fetch TikTok videos by ID
result = api_instance.tiktok_videos_batch_post(opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_batch_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_videos_batch_post_with_http_info(opts)
begin
# Batch-fetch TikTok videos by ID
data, status_code, headers = api_instance.tiktok_videos_batch_post_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokFeedRecommendedPost200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_batch_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| tiktok_videos_batch_post_request | TiktokVideosBatchPostRequest | [optional] |
TiktokFeedRecommendedPost200Response
- Content-Type: application/json
- Accept: application/json
tiktok_videos_id_comments_comment_id_replies_get(id, comment_id, opts)
List replies to a TikTok comment
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String |
comment_id = 'comment_id_example' # String |
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# List replies to a TikTok comment
result = api_instance.tiktok_videos_id_comments_comment_id_replies_get(id, comment_id, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_id_comments_comment_id_replies_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_videos_id_comments_comment_id_replies_get_with_http_info(id, comment_id, opts)
begin
# List replies to a TikTok comment
data, status_code, headers = api_instance.tiktok_videos_id_comments_comment_id_replies_get_with_http_info(id, comment_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokVideosIdCommentsCommentIdRepliesGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_id_comments_comment_id_replies_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
| comment_id | String | ||
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokVideosIdCommentsCommentIdRepliesGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_videos_id_comments_get(id, opts)
List top-level comments on a TikTok video
Returns a paginated list of top-level comments on the given video. Use next_cursor from the response as the next request's cursor.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String |
opts = {
cursor: 'cursor_example', # String |
limit: 56 # Integer |
}
begin
# List top-level comments on a TikTok video
result = api_instance.tiktok_videos_id_comments_get(id, opts)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_id_comments_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_videos_id_comments_get_with_http_info(id, opts)
begin
# List top-level comments on a TikTok video
data, status_code, headers = api_instance.tiktok_videos_id_comments_get_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokVideosIdCommentsCommentIdRepliesGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_id_comments_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
| cursor | String | [optional] | |
| limit | Integer | [optional][default to 20] |
TiktokVideosIdCommentsCommentIdRepliesGet200Response
- Content-Type: Not defined
- Accept: application/json
tiktok_videos_id_get(id)
Get a TikTok video by ID
Returns canonicalized metadata for a single TikTok video. The {id} must be the numeric TikTok video id.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
id = 'id_example' # String |
begin
# Get a TikTok video by ID
result = api_instance.tiktok_videos_id_get(id)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_id_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_videos_id_get_with_http_info(id)
begin
# Get a TikTok video by ID
data, status_code, headers = api_instance.tiktok_videos_id_get_with_http_info(id)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokVideosIdGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_id_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| id | String |
- Content-Type: Not defined
- Accept: application/json
tiktok_videos_resolve_get(url)
Resolve a TikTok share URL to a video
Accepts a TikTok share URL (long or short / vm.tiktok.com) and returns the canonical Video object.
require 'time'
require 'unifapi'
# setup authorization
Unifapi.configure do |config|
# Configure Bearer authorization: bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Unifapi::TiktokApi.new
url = 'url_example' # String | TikTok share URL (long or short form)
begin
# Resolve a TikTok share URL to a video
result = api_instance.tiktok_videos_resolve_get(url)
p result
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_resolve_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> tiktok_videos_resolve_get_with_http_info(url)
begin
# Resolve a TikTok share URL to a video
data, status_code, headers = api_instance.tiktok_videos_resolve_get_with_http_info(url)
p status_code # => 2xx
p headers # => { ... }
p data # => <TiktokVideosIdGet200Response>
rescue Unifapi::ApiError => e
puts "Error when calling TiktokApi->tiktok_videos_resolve_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| url | String | TikTok share URL (long or short form) |
- Content-Type: Not defined
- Accept: application/json