Skip to content

Latest commit

 

History

History
1784 lines (1288 loc) · 59.9 KB

File metadata and controls

1784 lines (1288 loc) · 59.9 KB

unifapi.TiktokApi

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

TiktokFeedRecommendedPost200Response tiktok_feed_recommended_post(tiktok_feed_recommended_post_request=tiktok_feed_recommended_post_request)

Get TikTok recommendation videos

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_feed_recommended_post200_response import TiktokFeedRecommendedPost200Response
from unifapi.models.tiktok_feed_recommended_post_request import TiktokFeedRecommendedPostRequest
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    tiktok_feed_recommended_post_request = unifapi.TiktokFeedRecommendedPostRequest() # TiktokFeedRecommendedPostRequest |  (optional)

    try:
        # Get TikTok recommendation videos
        api_response = api_instance.tiktok_feed_recommended_post(tiktok_feed_recommended_post_request=tiktok_feed_recommended_post_request)
        print("The response of TiktokApi->tiktok_feed_recommended_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_feed_recommended_post: %s\n" % e)

Parameters

Name Type Description Notes
tiktok_feed_recommended_post_request TiktokFeedRecommendedPostRequest [optional]

Return type

TiktokFeedRecommendedPost200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_hashtags_id_get

TiktokHashtagsIdGet200Response tiktok_hashtags_id_get(id)

Get a TikTok hashtag by ID

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_hashtags_id_get200_response import TiktokHashtagsIdGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | 

    try:
        # Get a TikTok hashtag by ID
        api_response = api_instance.tiktok_hashtags_id_get(id)
        print("The response of TiktokApi->tiktok_hashtags_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_hashtags_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id str

Return type

TiktokHashtagsIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_hashtags_id_videos_get

TiktokHashtagsIdVideosGet200Response tiktok_hashtags_id_videos_get(id, cursor=cursor, limit=limit)

List videos tagged with a TikTok hashtag

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_hashtags_id_videos_get200_response import TiktokHashtagsIdVideosGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | 
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # List videos tagged with a TikTok hashtag
        api_response = api_instance.tiktok_hashtags_id_videos_get(id, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_hashtags_id_videos_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_hashtags_id_videos_get: %s\n" % e)

Parameters

Name Type Description Notes
id str
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokHashtagsIdVideosGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_music_id_get

TiktokMusicIdGet200Response tiktok_music_id_get(id)

Get a TikTok music track by ID

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_music_id_get200_response import TiktokMusicIdGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | 

    try:
        # Get a TikTok music track by ID
        api_response = api_instance.tiktok_music_id_get(id)
        print("The response of TiktokApi->tiktok_music_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_music_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id str

Return type

TiktokMusicIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_music_id_videos_get

TiktokHashtagsIdVideosGet200Response tiktok_music_id_videos_get(id, cursor=cursor, limit=limit)

List videos using a TikTok music track

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_hashtags_id_videos_get200_response import TiktokHashtagsIdVideosGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | 
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # List videos using a TikTok music track
        api_response = api_instance.tiktok_music_id_videos_get(id, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_music_id_videos_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_music_id_videos_get: %s\n" % e)

Parameters

Name Type Description Notes
id str
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokHashtagsIdVideosGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_search_get

TiktokHashtagsIdVideosGet200Response tiktok_search_get(q, cursor=cursor, limit=limit)

General TikTok search (returns videos)

Returns TikTok videos for the keyword q. Use type-specific endpoints when needed.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_hashtags_id_videos_get200_response import TiktokHashtagsIdVideosGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    q = 'q_example' # str | Search keyword
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # General TikTok search (returns videos)
        api_response = api_instance.tiktok_search_get(q, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_search_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_search_get: %s\n" % e)

Parameters

Name Type Description Notes
q str Search keyword
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokHashtagsIdVideosGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_search_hashtags_get

TiktokSearchHashtagsGet200Response tiktok_search_hashtags_get(q, cursor=cursor, limit=limit)

Search TikTok hashtags by keyword

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_search_hashtags_get200_response import TiktokSearchHashtagsGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    q = 'q_example' # str | Search keyword
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # Search TikTok hashtags by keyword
        api_response = api_instance.tiktok_search_hashtags_get(q, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_search_hashtags_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_search_hashtags_get: %s\n" % e)

Parameters

Name Type Description Notes
q str Search keyword
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokSearchHashtagsGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_search_users_get

TiktokSearchUsersGet200Response tiktok_search_users_get(q, cursor=cursor, limit=limit)

Search TikTok users by keyword

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_search_users_get200_response import TiktokSearchUsersGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    q = 'q_example' # str | Search keyword
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # Search TikTok users by keyword
        api_response = api_instance.tiktok_search_users_get(q, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_search_users_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_search_users_get: %s\n" % e)

Parameters

Name Type Description Notes
q str Search keyword
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokSearchUsersGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_search_videos_get

TiktokHashtagsIdVideosGet200Response tiktok_search_videos_get(q, cursor=cursor, limit=limit)

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.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_hashtags_id_videos_get200_response import TiktokHashtagsIdVideosGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    q = 'q_example' # str | Search keyword
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # Search TikTok videos by keyword
        api_response = api_instance.tiktok_search_videos_get(q, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_search_videos_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_search_videos_get: %s\n" % e)

Parameters

Name Type Description Notes
q str Search keyword
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokHashtagsIdVideosGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_users_id_followers_get

TiktokSearchUsersGet200Response tiktok_users_id_followers_get(id, cursor=cursor, limit=limit)

List a TikTok user's followers

Returns a paginated list of users following the given user.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_search_users_get200_response import TiktokSearchUsersGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | TikTok sec_uid, numeric user id, or public handle.
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # List a TikTok user's followers
        api_response = api_instance.tiktok_users_id_followers_get(id, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_users_id_followers_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_users_id_followers_get: %s\n" % e)

Parameters

Name Type Description Notes
id str TikTok sec_uid, numeric user id, or public handle.
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokSearchUsersGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_users_id_following_get

TiktokSearchUsersGet200Response tiktok_users_id_following_get(id, cursor=cursor, limit=limit)

List users a TikTok user is following

Returns a paginated list of users the given user is following.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_search_users_get200_response import TiktokSearchUsersGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | TikTok sec_uid, numeric user id, or public handle.
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # List users a TikTok user is following
        api_response = api_instance.tiktok_users_id_following_get(id, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_users_id_following_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_users_id_following_get: %s\n" % e)

Parameters

Name Type Description Notes
id str TikTok sec_uid, numeric user id, or public handle.
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokSearchUsersGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_users_id_get

TiktokUsersIdGet200Response 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.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_users_id_get200_response import TiktokUsersIdGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | TikTok sec_uid, numeric user id, or public handle.

    try:
        # Get a TikTok user profile
        api_response = api_instance.tiktok_users_id_get(id)
        print("The response of TiktokApi->tiktok_users_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_users_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id str TikTok sec_uid, numeric user id, or public handle.

Return type

TiktokUsersIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_users_id_likes_get

TiktokHashtagsIdVideosGet200Response tiktok_users_id_likes_get(id, cursor=cursor, limit=limit)

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.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_hashtags_id_videos_get200_response import TiktokHashtagsIdVideosGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | TikTok sec_uid, numeric user id, or public handle.
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # List videos liked by a TikTok user
        api_response = api_instance.tiktok_users_id_likes_get(id, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_users_id_likes_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_users_id_likes_get: %s\n" % e)

Parameters

Name Type Description Notes
id str TikTok sec_uid, numeric user id, or public handle.
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokHashtagsIdVideosGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_users_id_videos_get

TiktokHashtagsIdVideosGet200Response tiktok_users_id_videos_get(id, cursor=cursor, limit=limit)

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.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_hashtags_id_videos_get200_response import TiktokHashtagsIdVideosGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | TikTok sec_uid, numeric user id, or public handle.
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # List videos posted by a TikTok user
        api_response = api_instance.tiktok_users_id_videos_get(id, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_users_id_videos_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_users_id_videos_get: %s\n" % e)

Parameters

Name Type Description Notes
id str TikTok sec_uid, numeric user id, or public handle.
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokHashtagsIdVideosGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_users_resolve_get

TiktokUsersResolveGet200Response 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.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_users_resolve_get200_response import TiktokUsersResolveGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    username = 'username_example' # str | Public TikTok handle, e.g. 'jennmelon'

    try:
        # Resolve a TikTok username to a user id
        api_response = api_instance.tiktok_users_resolve_get(username)
        print("The response of TiktokApi->tiktok_users_resolve_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_users_resolve_get: %s\n" % e)

Parameters

Name Type Description Notes
username str Public TikTok handle, e.g. 'jennmelon'

Return type

TiktokUsersResolveGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_videos_batch_post

TiktokFeedRecommendedPost200Response tiktok_videos_batch_post(tiktok_videos_batch_post_request=tiktok_videos_batch_post_request)

Batch-fetch TikTok videos by ID

Returns canonicalized metadata for up to 20 TikTok videos.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_feed_recommended_post200_response import TiktokFeedRecommendedPost200Response
from unifapi.models.tiktok_videos_batch_post_request import TiktokVideosBatchPostRequest
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    tiktok_videos_batch_post_request = unifapi.TiktokVideosBatchPostRequest() # TiktokVideosBatchPostRequest |  (optional)

    try:
        # Batch-fetch TikTok videos by ID
        api_response = api_instance.tiktok_videos_batch_post(tiktok_videos_batch_post_request=tiktok_videos_batch_post_request)
        print("The response of TiktokApi->tiktok_videos_batch_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_videos_batch_post: %s\n" % e)

Parameters

Name Type Description Notes
tiktok_videos_batch_post_request TiktokVideosBatchPostRequest [optional]

Return type

TiktokFeedRecommendedPost200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_videos_id_comments_comment_id_replies_get

TiktokVideosIdCommentsCommentIdRepliesGet200Response tiktok_videos_id_comments_comment_id_replies_get(id, comment_id, cursor=cursor, limit=limit)

List replies to a TikTok comment

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_videos_id_comments_comment_id_replies_get200_response import TiktokVideosIdCommentsCommentIdRepliesGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | 
    comment_id = 'comment_id_example' # str | 
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # List replies to a TikTok comment
        api_response = api_instance.tiktok_videos_id_comments_comment_id_replies_get(id, comment_id, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_videos_id_comments_comment_id_replies_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_videos_id_comments_comment_id_replies_get: %s\n" % e)

Parameters

Name Type Description Notes
id str
comment_id str
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokVideosIdCommentsCommentIdRepliesGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_videos_id_comments_get

TiktokVideosIdCommentsCommentIdRepliesGet200Response tiktok_videos_id_comments_get(id, cursor=cursor, limit=limit)

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.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_videos_id_comments_comment_id_replies_get200_response import TiktokVideosIdCommentsCommentIdRepliesGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | 
    cursor = 'cursor_example' # str |  (optional)
    limit = 20 # int |  (optional) (default to 20)

    try:
        # List top-level comments on a TikTok video
        api_response = api_instance.tiktok_videos_id_comments_get(id, cursor=cursor, limit=limit)
        print("The response of TiktokApi->tiktok_videos_id_comments_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_videos_id_comments_get: %s\n" % e)

Parameters

Name Type Description Notes
id str
cursor str [optional]
limit int [optional] [default to 20]

Return type

TiktokVideosIdCommentsCommentIdRepliesGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_videos_id_get

TiktokVideosIdGet200Response 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.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_videos_id_get200_response import TiktokVideosIdGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    id = 'id_example' # str | 

    try:
        # Get a TikTok video by ID
        api_response = api_instance.tiktok_videos_id_get(id)
        print("The response of TiktokApi->tiktok_videos_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_videos_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id str

Return type

TiktokVideosIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tiktok_videos_resolve_get

TiktokVideosIdGet200Response 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.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.tiktok_videos_id_get200_response import TiktokVideosIdGet200Response
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.TiktokApi(api_client)
    url = 'url_example' # str | TikTok share URL (long or short form)

    try:
        # Resolve a TikTok share URL to a video
        api_response = api_instance.tiktok_videos_resolve_get(url)
        print("The response of TiktokApi->tiktok_videos_resolve_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TiktokApi->tiktok_videos_resolve_get: %s\n" % e)

Parameters

Name Type Description Notes
url str TikTok share URL (long or short form)

Return type

TiktokVideosIdGet200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]