mcpField
S
scraping-instagram-location-content

scraping-instagram-location-content

github.com/apidojo-io营销与增长1850 次安装24 周前更新
代码仓库

关于 scraping-instagram-location-content

用于收集指定地点标记的 Instagram 公开帖子。适合研究人员和营销人员查看地点相关用户内容、识别创作者,并整理 UGC 或拓展联系报告。

主要功能

  1. 01按地点 URL 或 ID 收集帖子
  2. 02按日期或数量限制结果
  3. 03查看帖子说明与互动数据
  4. 04识别热门帖子和创作者
  5. 05比较创作者人数与帖子量

适用场景

  1. 01收集与某场所相关的公开帖子
  2. 02查找多次到访某地的创作者
  3. 03制作基于地点的 UGC 报告

MCP 相关

如已安装 Apify MCP 服务,可通过它运行 Apify Actor。

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/apidojo-io/apidojo-skills --skill scraping-instagram-location-content

安装后在 Claude Code 中输入/scraping-instagram-location-content确认已加载。

详细介绍

抓取 Instagram 位置内容

收集特定位置标记的所有公开 Instagram 帖子,可用于收集 UGC、查找发布场所相关内容的访客,或发现真正喜爱某个地方的创作者。

前提条件

  • 已设置 APIFY_TOKEN 环境变量
  • 可选:已安装 Apify MCP 服务

输入

参数类型必填默认值说明
startUrls数组可选[]Instagram 位置页面 URL
locationIds数组可选[]Instagram 位置 ID
maxItems数字可选不限要返回的帖子数量上限
until字符串可选—日期筛选(YYYY-MM-DD)
customMapFunction字符串可选—用于转换每个输出对象的 JavaScript 函数

工作流

Progress:
- [ ] Step 1: Find the Instagram location ID for the target venue
- [ ] Step 2: Run instagram-location-scraper
- [ ] Step 3: Fetch and filter posts
- [ ] Step 4: Identify top creators and posts
- [ ] Step 5: Deliver UGC report or creator list
步骤 1:查找位置 ID

Instagram 位置标签使用数字位置 ID,而非文本名称。查找方法:

  1. 在 Instagram 移动应用中搜索该位置
  2. 打开位置页面——URL 格式为:instagram.com/explore/locations/[LOCATION_ID]/[location-name]/
  3. 复制数字 LOCATION_ID

或者,请用户提供完整的 Instagram 位置 URL,并从中提取 ID。

如果用户只有名称(例如“巴黎埃菲尔铁塔”): 简要搜索 Google,查询 site:instagram.com/explore/locations "[venue name]",找到位置页面 URL 并提取 ID。

步骤 2:运行 Actor

推荐 — run_actor.js(自动处理等待、输出和文件保存):

# Quick answer (prints table to chat)
node scripts/run_actor.js \
  --actor "apidojo~instagram-location-scraper" \
  --input '{"param": "value"}'

# Save as CSV
node scripts/run_actor.js \
  --actor "apidojo~instagram-location-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.csv --format csv

# Save as JSON
node scripts/run_actor.js \
  --actor "apidojo~instagram-location-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.json --format json

必须在环境或 .env 文件中设置 APIFY_TOKEN。

如果 Apify MCP 可用:

Tool: apify:run-actor
Actor: "apidojo~instagram-location-scraper"
Input:
{
  "locationIds": ["[LOCATION_ID]"],
  "maxItems": 100
}

REST API 备用方案:

curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~instagram-location-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "locationIds": ["[LOCATION_ID]"],
    "maxItems": 100
  }'

等待状态变为 SUCCEEDED。获取结果。

步骤 3:筛选帖子

从数据集中提取每篇帖子的以下信息:

  • url — 帖子链接
  • caption — 帖子文本
  • ownerUsername — 创作者的用户名
  • likesCount — 帖子获赞数
  • commentsCount — 帖子评论数
  • timestamp — 发布时间
  • isVideo — true/false(Reels 或照片)

筛选选项(询问用户适用哪些选项):

  • 日期范围 — 仅查看近期帖子(例如,最近 90 天)
  • 最低获赞数 — 筛出质量更高的帖子(例如,≥50 个赞)
  • 发布者最低粉丝数 — 筛出受众真实的创作者发布的帖子
步骤 4:识别热门内容和创作者

按获赞数 + 评论数为帖子排名。找出前 10 篇帖子,供转发或推荐。

对于在该位置发布多篇帖子的创作者,他们是真正的粉丝——将他们标记出来,以便开展网红合作。

计算独立创作者数量与帖子总数的比值(可反映重复访客情况)。

步骤 5:整理报告

输出格式

# Instagram Location Content: [VENUE NAME]
Location ID: [ID] | Posts collected: [N] | Date: [DATE]

## Overview
Total posts at this location: [N] (based on sample)
Unique creators: [N]
Date range of posts: [oldest] – [newest]
Avg engagement per post: [N] likes + [N] comments

## Top 10 Posts (by Engagement)
| # | Creator | Likes | Comments | Date | Type | Post URL |
|---|---------|-------|----------|------|------|----------|
| 1 | @[handle] | [N] | [N]   | [date] | [Photo/Reel] | [url] |

## Top Creators at This Location
Creators who appear most frequently in location posts:
1. @[handle] — [N] posts here | [N] followers (if available)
2. @[handle] — [N] posts here
3. @[handle] — [N] posts here

## Caption Themes
Common topics in captions at this location:
- [Theme] (e.g., "date night", "anniversary") — [N] posts
- [Theme] (e.g., "work trip") — [N] posts

## Outreach Picks
Top creators whose content could be repurposed as UGC or who are strong partnership candidates:
1. @[handle] — [post URL] — "[caption excerpt]"

故障排除

未找到位置 ID: 一些较小的场所未被编入 Instagram 位置索引。请尝试使用附近的地标或城市作为备用位置。 帖子数量很少: 人流较少的场所,带位置标签的帖子可能有限。请降低最低获赞数筛选条件。 帖子来自错误位置: 对于名称相似的场所,Instagram 的位置匹配可能不够准确。请手动检查排名靠前的结果。

评论

支持 Markdown