scraping-tiktok-posts-by-location
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScraping Tiktok Posts By Location
按位置抓取TikTok帖子
Raw data collection. No assumed use case — returns the full dataset for downstream analysis.
原始数据收集。不预设使用场景——返回完整数据集以供下游分析。
Inputs
输入参数
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| array | ✅ | | TikTok location/place URLs (e.g. |
| number | Optional | Unlimited | Maximum posts to return |
| string | Optional | — | JavaScript function to transform each output object |
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| array | ✅ | | TikTok位置/场所URL(例如 |
| number | 可选 | 无限制 | 返回的最大帖子数量 |
| string | 可选 | — | 用于转换每个输出对象的JavaScript函数 |
How to Run
运行方式
Using run_actor.js (recommended)
使用run_actor.js(推荐方式)
bash
undefinedbash
undefinedQuick answer (table)
快速返回表格结果
node scripts/run_actor.js --actor "apidojo~tiktok-location-scraper" --input '{"startUrls": ["https://www.tiktok.com/place/New-York-City-123456"], "maxItems": 100}'
node scripts/run_actor.js --actor "apidojo~tiktok-location-scraper" --input '{"startUrls": ["https://www.tiktok.com/place/New-York-City-123456"], "maxItems": 100}'
Save as CSV
保存为CSV格式
node scripts/run_actor.js --actor "apidojo~tiktok-location-scraper" --input '{"startUrls": ["https://www.tiktok.com/place/New-York-City-123456"], "maxItems": 100}' --output results.csv --format csv
node scripts/run_actor.js --actor "apidojo~tiktok-location-scraper" --input '{"startUrls": ["https://www.tiktok.com/place/New-York-City-123456"], "maxItems": 100}' --output results.csv --format csv
Save as JSON
保存为JSON格式
node scripts/run_actor.js --actor "apidojo~tiktok-location-scraper" --input '{"startUrls": ["https://www.tiktok.com/place/New-York-City-123456"], "maxItems": 100}' --output results.json --format json
undefinednode scripts/run_actor.js --actor "apidojo~tiktok-location-scraper" --input '{"startUrls": ["https://www.tiktok.com/place/New-York-City-123456"], "maxItems": 100}' --output results.json --format json
undefinedREST API fallback
REST API备用方案
bash
curl -X POST "https://api.apify.com/v2/acts/apidojo~tiktok-location-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": ["https://www.tiktok.com/place/New-York-City-123456"], "maxItems": 100}'If Apify MCP is available:
Use the Apify MCP tool with actor and the input above.
call_actorapidojo~tiktok-location-scraperbash
curl -X POST "https://api.apify.com/v2/acts/apidojo~tiktok-location-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": ["https://www.tiktok.com/place/New-York-City-123456"], "maxItems": 100}'若Apify MCP可用:
使用Apify MCP的工具,指定Actor为并传入上述输入参数。
call_actorapidojo~tiktok-location-scraperOutput Fields
输出字段
| Field | Type | Description |
|---|---|---|
| string | TikTok post ID |
| string | Post caption/text |
| number | View count |
| number | Like count |
| number | Comment count |
| number | Share count |
| number | Bookmark/save count |
| array | Hashtags used in post |
| string | Creator display name |
| string | Creator @username |
| boolean | Verification status |
| number | Upload timestamp (Unix) |
| string | Upload timestamp (ISO 8601) |
| string | Video file URL |
| number | Duration in seconds |
| string | Audio track title |
| string | Full post URL |
| 字段 | 类型 | 描述 |
|---|---|---|
| string | TikTok帖子ID |
| string | 帖子标题/文案 |
| number | 浏览量 |
| number | 点赞数 |
| number | 评论数 |
| number | 分享数 |
| number | 收藏数 |
| array | 帖子中使用的话题标签 |
| string | 创作者显示名称 |
| string | 创作者@用户名 |
| boolean | 认证状态 |
| number | 上传时间戳(Unix格式) |
| string | 上传时间戳(ISO 8601格式) |
| string | 视频文件URL |
| number | 视频时长(秒) |
| string | 音频曲目名称 |
| string | 帖子完整URL |
Edge Cases
边缘情况
- No location URL: This actor requires a TikTok location page URL, not a city name. Ask user to navigate to TikTok > search the location > copy the URL.
- Low results: Some locations have few tagged posts — return what's available.
- Private videos: Excluded automatically.
- Deleted location: Returns empty. URL may be stale.
- 无位置URL:该Actor需要TikTok位置页面的URL,而非城市名称。请引导用户进入TikTok > 搜索该位置 > 复制URL。
- 结果数量少:部分位置的标签帖子数量较少——返回现有可用内容即可。
- 私密视频:自动排除。
- 已删除的位置:返回空结果。URL可能已失效。