{"id":27454,"library":"tiktok-business-api-sdk-official","title":"TikTok Business API SDK","description":"Official TikTok Business API SDK for Python, version 1.1.3. Provides classes and methods to interact with TikTok's advertising platform (Business API). Released as needed; currently stable.","status":"active","version":"1.1.3","language":"python","source_language":"en","source_url":"https://github.com/tiktok/tiktok-business-api-sdk","tags":["tiktok","business-api","ads","sdk"],"install":[{"cmd":"pip install tiktok-business-api-sdk-official","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"No common wrong import","wrong":"","symbol":"TikTokBusinessApiClient","correct":"from tiktok_business_api_sdk import TikTokBusinessApiClient"},{"note":"","wrong":"","symbol":"AdGroup","correct":"from tiktok_business_api_sdk.models import AdGroup"},{"note":"","wrong":"","symbol":"Campaign","correct":"from tiktok_business_api_sdk.models import Campaign"}],"quickstart":{"code":"from tiktok_business_api_sdk import TikTokBusinessApiClient\n\nclient = TikTokBusinessApiClient(\n    app_id=os.environ.get('TIKTOK_APP_ID', ''),\n    secret=os.environ.get('TIKTOK_SECRET', ''),\n    access_token=os.environ.get('TIKTOK_ACCESS_TOKEN', '')\n)\n# Example: list campaigns (adjust endpoint as needed)\ncampaigns = client.get('/open_api/v1.2/campaign/get/', params={'advertiser_id': 'YOUR_ADVERTISER_ID'})\nprint(campaigns)","lang":"python","description":"Initialize client and make a GET request."},"warnings":[{"fix":"Update imports to use 'tiktok_business_api_sdk' instead of 'tiktok_business_sdk'.","message":"SDK v1.1.x changed the import path from 'tiktok_business_sdk' to 'tiktok_business_api_sdk'. Old imports will raise ModuleNotFoundError.","severity":"breaking","affected_versions":">=1.1.0"},{"fix":"Implement token refresh logic externally or regenerate tokens via OAuth before expiry.","message":"Access token is required; the SDK does not handle token refresh automatically.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass 'base_url' parameter to client constructor: TikTokBusinessApiClient(..., base_url='https://sandbox-ads.tiktok.com')","message":"Base URL is hardcoded to 'https://business-api.tiktok.com'. For sandbox, you must override it.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace client.get_advertiser(advertiser_id) with client.get('/open_api/v1.2/advertiser/info/', params={'advertiser_id': advertiser_id})","message":"The 'get_advertiser' method in v1.0 has been deprecated; use generic 'get' or 'post' instead.","severity":"deprecated","affected_versions":">=1.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from tiktok_business_api_sdk import TikTokBusinessApiClient' instead.","cause":"Old import path used; SDK renamed in v1.1.0.","error":"ModuleNotFoundError: No module named 'tiktok_business_sdk'"},{"fix":"Use client.get('/open_api/v1.2/advertiser/info/', params={'advertiser_id': id})","cause":"Deprecated method removed in v1.1.0.","error":"AttributeError: 'TikTokBusinessApiClient' object has no attribute 'get_advertiser'"},{"fix":"Ensure access_token is provided and valid. Regenerate if necessary.","cause":"Access token missing or expired.","error":"requests.exceptions.HTTPError: 401 Client Error: Unauthorized"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}