# 당근마켓 지역 광고 분석 스크래퍼 (`sunface/daangn-ad-scraper`) Actor

지역/키워드 기준으로 당근마켓 동네업체 및 비즈 소식글을 수집하고, 문의/관심/조회/단골 수를 파싱해 우리 광고 vs 경쟁사 광고를 비교 분석합니다.

- **URL**: https://apify.com/sunface/daangn-ad-scraper.md
- **Developed by:** [Sun Kwak](https://apify.com/sunface) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 당근마켓 지역 광고 분석 스크래퍼 (daangn-ad-scraper)

당근마켓 특정 지역 + 키워드 기준으로 동네업체 및 비즈 소식글(광고)을 수집하여,
**문의 수 / 관심(좋아요) 수 / 조회 수 / 단골(팔로워) 수 / 댓글 수**를 파싱하고
우리 업체 vs 경쟁 업체 광고 성과를 자동으로 비교 분석하는 Apify Actor입니다.

### 이런 분께 유용합니다

- 당근 비즈니스 광고를 운영 중이며, 우리 지역 경쟁 업체들의 광고 반응을 알고 싶은 소상공인/마케터
- 특정 업종(헬스, 필라테스, 미용 등)의 지역 내 광고 트렌드를 파악하고 싶은 경우

***

### 🔑 필수 입력값: `locationSlug` 찾는 방법

이 Actor는 당근마켓의 **지역 코드(locationSlug)** 를 입력받아야 합니다. 아래 순서로 확인하세요.

1. PC 또는 모바일 브라우저로 **https://www.daangn.com** 접속 (로그인 불필요)
2. 화면 좌측 상단(또는 메뉴)에서 **"동네 설정"** 클릭 → 분석하려는 동네(예: "수지구 동천동") 검색 후 선택
3. 아무 키워드로 한 번 검색해봅니다 (예: "헬스")
4. 브라우저 주소창의 URL을 확인합니다:
   ```
   https://www.daangn.com/kr/local-profile/?in=동천동-1694&search=헬스
   ```
5. `in=` 뒤에 있는 값이 `locationSlug`입니다. 위 예시라면:
   ```
   동천동-1694
   ```

> 💡 같은 동 이름이라도 지역마다 뒤에 붙는 숫자 코드가 다릅니다 (예: 수지구 동천동과 다른 지역 동천동은 번호가 다름). 반드시 원하는 지역을 "동네 설정"에서 정확히 선택한 뒤 URL을 확인하세요.

> 📱 모바일 앱에서는 URL이 보이지 않으므로, 모바일 브라우저(Safari, Chrome 등)로 위 사이트에 접속해서 확인하는 것을 권장합니다.

***

### Input 파라미터

| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
| `locationSlug` | string | ✅ | 위에서 찾은 지역 코드 (예: `동천동-1694`) |
| `searchKeywords` | string\[] | ✅ | 검색할 업종/키워드 배열 (예: `["헬스", "필라테스", "여성전용"]`) |
| `myBusinessNames` | string\[] | ❌ | 우리 업체명 (경쟁사와 구분해 `isMine: true`로 표시) |
| `maxBusinessesPerKeyword` | integer | ❌ | 키워드당 최대 수집 업체 수 (기본값 존재) |
| `maxPostsPerBusiness` | integer | ❌ | 업체당 최대 수집 게시글 수 (기본값 존재) |
| `proxyConfiguration` | object | ❌ | Apify 프록시 설정 |

### 출력 데이터

- **business\_post** 타입 레코드: 개별 광고 게시글의 문의/관심/조회/댓글/단골 수
  - `keywordMatches`: 이 업체(게시글)가 검색된 **모든 키워드**와 각 키워드에서의 노출 순위 배열.
    한 업체가 여러 키워드로 동시에 검색될 경우(예: "여성전용"에서 4위, "헬스"에서 6위) 정보 손실 없이 전부 기록됩니다.
    ```json
    "keywordMatches": [
      { "keyword": "여성전용", "searchRank": 4 },
      { "keyword": "헬스", "searchRank": 6 }
    ]
    ```
  - `keywordMatched` / `searchRank`: 하위 호환용 필드로, `keywordMatches` 중 순위가 가장 좋은(숫자가 작은) 키워드 하나만 남긴 값입니다. 여러 키워드 분석이 필요하면 `keywordMatches`를 사용하세요.
- **summary** 타입 레코드: 우리 광고(`myAds`) vs 경쟁사 광고(`competitorAds`)의 평균 지표 비교

***

### 사용법 (로컬 개발)

```bash
npm install
npm start
```

Input 예시는 `.actor/input_schema.json` 참고. 로컬 실행 시 `storage/key_value_stores/default/INPUT.json` 파일에 입력값을 넣어서 테스트합니다.

### Apify 클라우드 배포

```bash
apify login
apify push
```

### 주의사항

- 당근마켓 이용약관 및 robots.txt 준수 확인 필요
- 검색은 당근 자체 `local-profile` 페이지의 공개 JSON-LD(ItemList) 데이터를 직접 파싱 (외부 검색엔진 경유 없음)
- 개인 식별 정보(채팅 문의 내용, 연락처 등)는 수집하지 않음 — 공개된 집계 수치(문의/관심/조회/단골 수)만 수집
- 검색 결과는 최대 300건까지 노출되는 것으로 확인됨 (매우 인기 키워드의 경우 일부 누락 가능)

# Actor input Schema

## `locationSlug` (type: `string`):

당근 URL의 in= 파라미터 값 (예: 동천동-1694). 당근 앱/웹에서 동네업체 검색 시 URL을 확인해 얻습니다.

## `searchKeywords` (type: `array`):

업종/서비스 키워드 목록

## `myBusinessNames` (type: `array`):

결과에서 '우리 광고'로 태깅할 업체명 (부분 일치)

## `maxBusinessesPerKeyword` (type: `integer`):

검색 결과에서 수집할 업체 수 상한 (비용 통제용)

## `maxPostsPerBusiness` (type: `integer`):

각 업체의 비즈 소식글을 몇 개까지 수집할지

## `proxyConfiguration` (type: `object`):

Apify 프록시 사용 설정

## Actor input object example

```json
{
  "locationSlug": "동천동-1694",
  "searchKeywords": [
    "여성운동",
    "여성전용 헬스",
    "여성 PT"
  ],
  "myBusinessNames": [],
  "maxBusinessesPerKeyword": 20,
  "maxPostsPerBusiness": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `datasetOverview` (type: `string`):

No description

## `datasetApi` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locationSlug": "동천동-1694",
    "searchKeywords": [
        "여성운동",
        "여성전용 헬스",
        "여성 PT"
    ],
    "myBusinessNames": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("sunface/daangn-ad-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "locationSlug": "동천동-1694",
    "searchKeywords": [
        "여성운동",
        "여성전용 헬스",
        "여성 PT",
    ],
    "myBusinessNames": [],
}

# Run the Actor and wait for it to finish
run = client.actor("sunface/daangn-ad-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locationSlug": "동천동-1694",
  "searchKeywords": [
    "여성운동",
    "여성전용 헬스",
    "여성 PT"
  ],
  "myBusinessNames": []
}' |
apify call sunface/daangn-ad-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sunface/daangn-ad-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/O7OwLXnABhXQLvI7G/builds/14We58fVpfRQ2fEUx/openapi.json
