# API de informes

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

:link: [<mark style="color:azul;">**Haz clic para probar la API de informes**</mark> ](https://offer18.readme.io/reference/reports-api-1)

### Parámetros comunes <a href="#parameters" id="parameters"></a>

| **Consulta** | **Tipo** | **Descripción**      |
| ------------ | -------- | -------------------- |
| mid          | Entero   | Tu MID de anunciante |
| aid          | Entero   | ID de afiliado       |
| key          | Cadena   | Clave API            |

***

### Filtros

<table data-header-hidden><thead><tr><th width="150">Consulta</th><th width="150"> </th><th width="368.2"> </th></tr></thead><tbody><tr><td><strong>Consulta</strong></td><td><strong>Tipo</strong></td><td><strong>Descripción</strong></td></tr><tr><td>date_from</td><td>Fecha</td><td>Fecha de inicio del informe (AAAA-MM-DD)</td></tr><tr><td>date_end</td><td>Fecha</td><td>Fecha de fin del informe (AAAA-MM-DD)</td></tr><tr><td>datetime_from</td><td>Fecha y hora</td><td>Fecha y hora de inicio del informe (AAAA-MM-DD hh:mm:ss)</td></tr><tr><td>datetime_end</td><td>Fecha y hora</td><td>Fecha y hora de fin del informe (AAAA-MM-DD hh:mm:ss)</td></tr><tr><td>results</td><td>Cadena</td><td>N.º de resultados</td></tr><tr><td>page</td><td>Entero</td><td>N.º de página (comienza desde cero)</td></tr><tr><td>timezone</td><td>Decimal</td><td>Predeterminado 0.0 UTC</td></tr><tr><td>offer</td><td>Cadena</td><td>ID de oferta</td></tr><tr><td>report_type</td><td>Cadena</td><td><strong>Valores permitidos:</strong><br>click, conversion, imps</td></tr><tr><td>aff_sub1</td><td>Cadena</td><td>Primer ID de subafiliado (datos de afiliado)</td></tr><tr><td>aff_sub2</td><td>Cadena</td><td>Segundo ID de subafiliado (datos de afiliado)</td></tr><tr><td>aff_sub3</td><td>Cadena</td><td>Tercer ID de subafiliado (datos de afiliado)</td></tr><tr><td>aff_sub4</td><td>Cadena</td><td>Cuarto ID de subafiliado (datos de afiliado)</td></tr><tr><td>aff_sub5</td><td>Cadena</td><td>Quinto ID de subafiliado (datos de afiliado)</td></tr></tbody></table>

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

#### Especifica los campos a visualizar

<table data-header-hidden><thead><tr><th width="150">Consulta</th><th width="150"> </th><th width="424.20000000000005"> </th></tr></thead><tbody><tr><td><strong>Consulta</strong></td><td><strong>Tipo</strong></td><td><strong>Descripción</strong></td></tr><tr><td>fields</td><td>Cadena</td><td><p><strong>Valores permitidos:</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 %}

#### Método adicional de ordenación

<table data-header-hidden><thead><tr><th width="150">Consulta</th><th width="150"> </th><th width="388"> </th></tr></thead><tbody><tr><td><strong>Consulta</strong></td><td><strong>Tipo</strong></td><td><strong>Descripción</strong></td></tr><tr><td>sort_by</td><td>Cadena</td><td><strong>Valores permitidos:</strong> clicks, unique_clicks, conversions, date, time, hour<br>(solo se permite usar una opción) </td></tr><tr><td>sort_type</td><td>Cadena</td><td><strong>Valores permitidos:</strong> asc y 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 %}

***

### Ejemplo de solicitud de API

![](https://497363578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F41f2EboJipeUA6flsLGK%2Fuploads%2FZti2IGSBlAmtmfoDZ7nT%2Fimage.png?alt=media\&token=b288cac0-a1aa-47fe-8f9e-d7ef8edd25e1)

***

### **Respuesta de la 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: 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://knowledgebase.offer18.com/es/afiliado/api-de-afiliados/api-de-informes.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.
