mcpField
S
scraping-tiktok-posts-by-location

scraping-tiktok-posts-by-location

github.com/apidojo-ioData & databases1807 installsUpdated 24w ago
Repository

About scraping-tiktok-posts-by-location

A raw-data collection skill that scrapes TikTok posts from location or place URLs. It is intended for downstream analysis and returns post details and engagement metrics, without assuming a particular use case.

Key features

  1. 01Scrape posts from location URLs
  2. 02Set a maximum post count
  3. 03Return captions and engagement metrics
  4. 04Include creator and video details
  5. 05Save results as CSV or JSON

Use cases

  1. 01Collect TikTok posts tagged to a place
  2. 02Compare engagement across locations
  3. 03Prepare location-based post data for analysis

MCP support

Can run the Apify tiktok-location-scraper with the Apify MCP call_actor tool.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/apidojo-io/apidojo-skills --skill scraping-tiktok-posts-by-location

After installing, type/scraping-tiktok-posts-by-locationin Claude Code to confirm it loaded.

Details

From the project README

Scraping Tiktok Posts By Location

Raw data collection. No assumed use case — returns the full dataset for downstream analysis.


Inputs

ParameterTypeRequiredDefaultNotes
startUrlsarray✅[]TikTok location/place URLs (e.g. https://www.tiktok.com/tag/newyork?location=true)
maxItemsnumberOptionalUnlimitedMaximum posts to return
customMapFunctionstringOptional—JavaScript function to transform each output object

How to Run

Using run_actor.js (recommended)
# Quick 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}'

# Save as 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
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
REST API fallback
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 call_actor tool with actor apidojo~tiktok-location-scraper and the input above.


Output Fields

FieldTypeDescription
idstringTikTok post ID
titlestringPost caption/text
viewsnumberView count
likesnumberLike count
commentsnumberComment count
sharesnumberShare count
bookmarksnumberBookmark/save count
hashtagsarrayHashtags used in post
channel.namestringCreator display name
channel.usernamestringCreator @username
channel.verifiedbooleanVerification status
uploadedAtnumberUpload timestamp (Unix)
uploadedAtFormattedstringUpload timestamp (ISO 8601)
video.urlstringVideo file URL
video.durationnumberDuration in seconds
song.titlestringAudio track title
postPagestringFull post 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.

Comments

Markdown supported