# 애드팝콘 SSP Report API

{% hint style="warning" %}
white ip 등록을 위해 연동 전 IP를 애드팝콘 SSP 사업팀에 전달해주세요.
{% endhint %}

{% hint style="danger" %}
해당 API는 2024년 말 지원 종료 예정입니다. 이후 리포트 API는 <https://adpopcornssp.gitbook.io/ssp-sdk/api/publisher-api-report> 를 사용해주세요.
{% endhint %}

## URL

* <http://dev.ssp-web-apis.adpopcorn.com/v3/analytics/data/{company\\_key}?fromDate={from\\_date}\\&toDate={to\\_date}>

## Method

* GET

## Content-Type

* application/json

## Parameter

<table><thead><tr><th>Parameter</th><th>설명</th><th width="65">필수</th><th>예시</th></tr></thead><tbody><tr><td>companyKey</td><td>리포트 조회할 회사키</td><td><mark style="color:red;">Y</mark></td><td>1234567</td></tr><tr><td>fromDate</td><td>시작일</td><td><mark style="color:red;">Y</mark></td><td>since=2019-01-01 또는 since=20190101</td></tr><tr><td>endDate</td><td>종료일</td><td><mark style="color:red;">Y</mark></td><td>until=2019-01-01 또는 until=20190101</td></tr><tr><td>country</td><td>국가별 데이터 포함 여부</td><td>N</td><td>0, 1 (default: 0)</td></tr></tbody></table>

## 제한사항

* 조회 기간은 <mark style="color:red;">최대 7일</mark>입니다.
* 시작일, 종료일이 포함되지 않은 경우 기본 값은 전일 포함 7일 입니다.

## Response parameter

| Name  | Type                | 설명            |
| ----- | ------------------- | ------------- |
| count | int                 | 레포트 row 수     |
| items | array (ReportModel) | 레포트 데이터 리스트   |
| media | array (MediaModel)  | 미디어 메타 정보 리스트 |

### ReportModel

<table><thead><tr><th width="177">Name</th><th width="84">Type</th><th width="320">설명</th><th>예시</th></tr></thead><tbody><tr><td>click</td><td>int</td><td>클릭 수</td><td>100</td></tr><tr><td>impression</td><td>int</td><td>노출 수</td><td>1000</td></tr><tr><td>media_key</td><td>string</td><td>미디어 키</td><td>"123456"</td></tr><tr><td>placement_id</td><td>string</td><td>placement ID</td><td>"abcdefg"</td></tr><tr><td>report_type</td><td>int</td><td>1: DSP, 2: 애드서버, 4: 미디에이션</td><td>1</td></tr><tr><td>request</td><td>int</td><td>요청수 (일부 미디에이션의 경우 미제공)</td><td>0</td></tr><tr><td>response</td><td>int</td><td>응답수 (일부 미디에이션의 경우 미제공)</td><td>0</td></tr><tr><td>revenue</td><td>double</td><td>수익(USD)</td><td>100</td></tr><tr><td>thirdparty_name</td><td>string</td><td>서드파티 이름</td><td>"appier"</td></tr><tr><td>ymd</td><td>string</td><td>날짜</td><td>"20201022"</td></tr><tr><td>country</td><td>string</td><td>국가코드 (국가별 데이터 포함 여부 파라미터 사용 시)</td><td></td></tr></tbody></table>

### MediaModel

<table><thead><tr><th width="137">Name</th><th width="173">Type</th><th>설명</th><th>예시</th></tr></thead><tbody><tr><td>key</td><td>string</td><td>미디어키</td><td>"12333444"</td></tr><tr><td>name</td><td>string</td><td>미디어명</td><td>"test_media"</td></tr><tr><td>placements</td><td>array (PlacementModel)</td><td>지면 메타 정보 리스트</td><td></td></tr></tbody></table>

### PlacementModel

<table><thead><tr><th width="148">Name</th><th width="98">Type</th><th width="347">설명</th><th>예시</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>지면 id</td><td>"abcdefghijk"</td></tr><tr><td>name</td><td>string</td><td>지면 이름</td><td>"테스트 지면"</td></tr><tr><td>type</td><td>int</td><td>1: 배너, 2: 전면, 3: 네이티브, 4: 동영상</td><td>1</td></tr></tbody></table>

{% tabs %}
{% tab title="200" %}
{% code title="json" %}

```json
// Response
{
  "count": 0,
  "items": [
    {
      "click": 0,
      "impression": 0,
      "media_key": "123456790",
      "placement_id": "abcdefghijklmno",
      "report_type": 1,
      "request": 0,
      "response": 0,
      "revenue": 0,
      "thirdparty_name": "appier",
      "ymd": "20200101"
    }
  ],
  "media": [
    {
      "key": "123456789",
      "name": "TEST MEDIA",
      "placements": [
        {
          "id": "abcdefghijklmno",
          "name": "TEST PLACEMENT",
          "type": 1
        }
      ],
      "type": 1
    }
  ]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://adpopcornssp.gitbook.io/ssp-sdk/undefined-2/api/ssp-report-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
