> For the complete documentation index, see [llms.txt](https://knowledgebase.offer18.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.offer18.com/zh/lian-meng-huo-ban/lian-meng-huo-ban-api/bao-gao-api.md).

# 报告 API

```
GET https://api.offer18.com/api/af/report
```

:link: [<mark style="color:蓝色;">**点击测试报告 API**</mark> ](https://offer18.readme.io/reference/reports-api-1)

### 常用参数 <a href="#parameters" id="parameters"></a>

| **查询** | **类型** | **描述**    |
| ------ | ------ | --------- |
| mid    | 整数     | 您的广告主 MID |
| aid    | 整数     | 联盟 ID     |
| key    | 字符串    | API 密钥    |

***

### 筛选条件

<table data-header-hidden><thead><tr><th width="150">查询</th><th width="150"> </th><th width="368.2"> </th></tr></thead><tbody><tr><td><strong>查询</strong></td><td><strong>类型</strong></td><td><strong>描述</strong></td></tr><tr><td>date_from</td><td>日期</td><td>报告开始日期 (YYYY-MM-DD)</td></tr><tr><td>date_end</td><td>日期</td><td>报告结束日期 (YYYY-MM-DD)</td></tr><tr><td>datetime_from</td><td>日期时间</td><td>报告开始日期和时间 (YYYY-MM-DD hh:mm:ss)</td></tr><tr><td>datetime_end</td><td>日期时间</td><td>报告结束日期和时间 (YYYY-MM-DD hh:mm:ss)</td></tr><tr><td>results</td><td>字符串</td><td>结果数量</td></tr><tr><td>page</td><td>整数</td><td>页码（从 0 开始）</td></tr><tr><td>timezone</td><td>小数</td><td>默认 0.0 UTC</td></tr><tr><td>offer</td><td>字符串</td><td>Offer ID</td></tr><tr><td>report_type</td><td>字符串</td><td><strong>允许的值：</strong><br>click, conversion, imps</td></tr><tr><td>aff_sub1</td><td>字符串</td><td>第一个子联盟 ID（联盟数据）</td></tr><tr><td>aff_sub2</td><td>字符串</td><td>第二个子联盟 ID（联盟数据）</td></tr><tr><td>aff_sub3</td><td>字符串</td><td>第三个子联盟 ID（联盟数据）</td></tr><tr><td>aff_sub4</td><td>字符串</td><td>第四个子联盟 ID（联盟数据）</td></tr><tr><td>aff_sub5</td><td>字符串</td><td>第五个子联盟 ID（联盟数据）</td></tr></tbody></table>

```
https://api.offer18.com/api/af/report?key=000000000&aid=0000&mid=0000
```

#### 指定要查看的字段

<table data-header-hidden><thead><tr><th width="150">查询</th><th width="150"> </th><th width="424.20000000000005"> </th></tr></thead><tbody><tr><td><strong>查询</strong></td><td><strong>类型</strong></td><td><strong>描述</strong></td></tr><tr><td>fields</td><td>字符串</td><td><p><strong>允许的值：</strong></p><p>clicks, conversion, affiliate_price, date, time, hour, offer, offer_name, s_affiliate, event, impressions, unique_clicks, affiliate_model, ip, currency, isp, country, conn_speed, location, browser, os, os_ver, device, device_brand, device_model, referral_domain, useragent, referral_url, aff_click_id, aff_sub1, aff_sub2, aff_sub3, aff_sub4, aff_sub5, adv_sub4, adv_sub5, aff_sub6, aff_sub7, aff_sub8, aff_sub9, aff_sub10, ios_idfa, source, google_aid, android_id, device_id, cr, ctr, cpc, ecpm, e_cost_per_conversion, cr_unique, coupon</p></td></tr></tbody></table>

{% code overflow="wrap" %}

```
https://api.offer18.com/api/af/report?key=000000000&aid=0000&mid=0000&fields=clicks,conversion,affiliate_price,date,time,hour,offer,offer_name,s_affiliate,event,impressions,unique_clicks,affiliate_model,ip,currency,isp,country,conn_speed,location,browser,os,os_ver,device,device_brand,device_model,referral_domain,useragent,referral_url,aff_click_id,aff_sub1,aff_sub2,aff_sub3,aff_sub4,aff_sub5,aff_sub6,aff_sub7,aff_sub8,aff_sub9,aff_sub10,adv_sub4,adv_sub5,ios_idfa,source,google_aid,android_id,device_id,cr,ctr,cpc,ecpm,e_cost_per_conversion,cr_unique,coupon
```

{% endcode %}

#### 额外排序方式

<table data-header-hidden><thead><tr><th width="150">查询</th><th width="150"> </th><th width="388"> </th></tr></thead><tbody><tr><td><strong>查询</strong></td><td><strong>类型</strong></td><td><strong>描述</strong></td></tr><tr><td>sort_by</td><td>字符串</td><td><strong>允许的值：</strong> clicks, unique_clicks, conversions, date, time, hour<br>（仅允许使用一个选项） </td></tr><tr><td>sort_type</td><td>字符串</td><td><strong>允许的值：</strong> asc 和 desc</td></tr></tbody></table>

{% code overflow="wrap" %}

```
https://api.offer18.com/api/af/report?key=000000000&aid=0000&mid=0000&sort_by=000000&sort_type=0000
```

{% endcode %}

***

### 示例 API 请求

![](/files/65156f30ab9e6ba386049af2ba9c17a7e16bd799)

***

### **API 响应**

```
{
	"status": 200,
	"records": 3,
	"timezone": "+5:30",
	"reports": [
	{
		"Date": "2021-09-09",
		"Time": "2021-09-09 17:16:24",
		"Hour": "2021-09-09 17:00",
		"OfferID": "0001",
		"Sub_Affiliate": "",
		"Event": "",
		"Impressions": 0,
		"Clicks": 8,
		"UniqueClicks": 0,
		"Conversions": 0,
		"Affiliate_Model": "CPA",
		"Affiliate_Price": 0,
		"IP": "1.1.1.1",
		"Currency": "USD",
		"ISP": "Mountain_View_Communications",
		"Country": "AU",
		"Connection_Speed": "cable_dsl",
		"Location": "Australia, Oceania",
		"Browser": "ch",
		"OS": "windows",
		"OSver": 10,
		"Device": "desktop",
		"Device_Brand": "Lenovo",
		"Device_Model": "ideapad-x310s-ua",
		"Referral_Domain": "",
		"UserAgent": "Mozilla%2F5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F93.0.4577.63+Safari%2F537.36",
		"Referral_URL": "",
		"Aff_Click_ID": "",
		"Aff_Sub_1": "",
		"Aff_Sub_2": "",
		"Aff_Sub_3": "",
		"Aff_Sub_4": "",
		"Aff_Sub_5": "",
		"Adv_Sub_4": "",
		"Adv_Sub_5": "",
		"iOS_IDFA": "",
		"Source": "",
		"Google_AID": "",
		"Android_ID": "",
		"Device_ID": ""
	},	
	]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://knowledgebase.offer18.com/zh/lian-meng-huo-ban/lian-meng-huo-ban-api/bao-gao-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
