Examples
Add Tasks
Add keyword search tasks to extract top ads from TikTok
The v1 API, for batchesSquids, tasks and runs: many calls on a schedule, delivered where you work. For one call that answers in seconds, use the API v2.
POST
https://api.lobstr.io/v1/tasksAdd keyword-based search tasks to your squid. The scraper will extract top performing ads from TikTok's Creative Center based on your search terms.
Crawler ID:
b5079ede3002655d286a03ad29604ac6Headers
AuthorizationstringheaderrequiredYour API authentication token. Value: Token YOUR_API_KEY
Content-TypestringheaderrequiredRequest body format. Value: application/json
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| squid | string | Yes | Hash of your squid configured with the tiktok-top-ads-scraper crawler |
| tasks | array | Yes | Array of task objects, each containing a keyword field |
Task Fields
| Field | Type | Required | Description |
|---|---|---|---|
| keyword | string | Yes | Search term you want to get TikTok Ads from (e.g., "fitness", "skincare", "cooking") |
Use specific keywords related to your industry or niche for more relevant ad results.
You can add multiple keywords in a single request to analyze ads across different topics.
Results are retrieved from TikTok's Creative Center Top Ads library.
Code Examples
curl -X POST "https://api.lobstr.io/api/v2/squid/YOUR_SQUID_ID/task" \ -H "Authorization: Token YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "keyword": "fitness" }'
Response
200
{ "id": "task_abc123", "squid_id": "YOUR_SQUID_ID", "status": "pending", "keyword": "fitness", "created_at": "2024-01-15T10:30:00Z" }