Provided by TikHub
TikTok search ads
Search ads from TikTok via TikHub. One request per call; TikHub bills the request whether or not data comes back, and an empty data envelope is reported as no result.
How to run it
Step 1Set up
Once: paste this into your agent's chat. The Skill installs the CLI and logs in by itself. For an agent that cannot use a shell, connect it over MCP instead.
set up https://glasser.ai/SKILL.md
Show me how to use the TikHub endpoint /api/v1/tiktok/ads/search_ads on Glasser.glasser run -p tikhub -e '/api/v1/tiktok/ads/search_ads' -i '{}' --endpoint-version 2Uses endpoint version 2. Inspect the current price before running. Install and log in first on Get Started.
Once per Run:
IDEMPOTENCY_KEY=$(uuidgen)Run it, and copy this same block to send it again:
curl -X POST https://api.glasser.ai/v1/runs \
-H "Authorization: Bearer gl_..." \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"tikhub","endpoint":"/api/v1/tiktok/ads/search_ads","input":{},"endpoint_version":2}'Reuse the same Idempotency-Key to send it again: the second send is a read of the first Run. A new key is a new Run and a new Charge. Uses endpoint version 2; inspect the current price before running.
Step 2Try a specific example task
When you need to plan campaign messaging, you might research relevant ads to find angles worth considering for your creative brief.
Copy this prompt into your agent to research messaging angles for your campaign.
Use tikhub:/api/v1/tiktok/ads/search_ads on Glasser.
Find messaging angles in the returned ad data that relate to my campaign topic.Endpoint structure
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"like": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Optional performance percentile; omit it to include all percentiles"
},
"page": {
"type": "integer",
"description": "Page number, default 1"
},
"limit": {
"type": "integer",
"description": "Items per page, default 20, max 50"
},
"period": {
"type": "integer",
"description": "Time period in days, e.g., 7, 30, 120, 180 days"
},
"keyword": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Search keyword, optional, returns all ads if empty"
},
"duration": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Optional video duration filter value"
},
"industry": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Industry ID list, multiple IDs separated by commas. Full industry ID list: https://github.com/TikHub/TikTok-Ads-Industry-Code"
},
"order_by": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Sort method, \"for_you\"=Recommended, \"likes\"=Sort by likes"
},
"ad_format": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Optional ad format; 1=Spark Ads, 2=Non-Spark Ads"
},
"objective": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Optional ad objective; omit it to include all objectives"
},
"search_id": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "搜索ID(可选)/Search ID (optional)"
},
"ad_language": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Optional ad language code, e.g., en, zh-Hant"
},
"country_code": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Country code, e.g., US, UK, JP"
},
"pattern_label": {
"type": "string",
"maxLength": 2048,
"minLength": 1,
"description": "Optional creative pattern label"
}
},
"additionalProperties": false
}{}This Endpoint publishes no output schema. You get the Provider's own response body, unchanged — we do not warrant a shape we cannot guarantee.
How pricing works
| Data returned or no match | The same price with or without matching data. | $0.001 |
|---|---|---|
| Provider error | The Provider failed to answer. | $0.00 |
| Timed out | The Run exceeded its time limit. | $0.00 |
| Internal failure | An internal error prevented completion. | $0.00 |