# \[EN] Linkrall Offline API for Publisher v3.7

{% hint style="info" %}
Linkrall is a **lower-cost Traffic Tracking Platform** with multi-dimensional reports, optimization solutions and easy- using panels. For more information, please visit：[http://www.linkrall.com](http://www.linkrall.com/)​
{% endhint %}

### 0. Update History

**\[2020/08/20]** v3.6: For iOS14 new policy，added three click URL parameters：ip, lang, ua

**\[2021/01/11]** v3.7: Added two response parameters: click\_cap, cap\_timezone

### 1. Introduction

Linkrall offline API is designed for the publishers to retrieve oﬀers from the server. This document describes how publishers request Linkrall ads via the API call.

#### Notice <a href="#notice" id="notice"></a>

* The API is accessible by HTTP GET request and returns data in JSON format.
* This is an OFFLINE API which should NOT be called from end-user devices.&#x20;
* The API is recommended to be requested every 10-15 minutes.&#x20;
* The IDFA/GAID MUST be appended to the click URL if the parameter 'deviceid\_required'=1

### 2. API Request Method

#### Request URL: http\://\[*Advertiser Domain*]/v3/api\_v3?key=\[*API key*]

#### Request Method: GET

#### Request Parameters

| Parameters | Description                               | Required |
| ---------- | ----------------------------------------- | :------: |
| key        | The API key given by your Account Manager |    Yes   |
| limit      | The page size, default 3000               |    No    |
| page       | The page number                           |    No    |
| os         | Device OS, value ios/android              |    No    |

#### Response parameters

| Parameter          | Description                                                                                   |
| ------------------ | --------------------------------------------------------------------------------------------- |
| message            | The message of API request                                                                    |
| data               | Array of Offers                                                                               |
| id                 | Offer id                                                                                      |
| name               | Offer title                                                                                   |
| payout             | Offer payout                                                                                  |
| currency           | <p>Payment currency</p><p>Value: USD</p>                                                      |
| countires          | <p>List of countries, multiple countries are separated by comma</p><p>Value: US,IN,JP</p>     |
| click\_url         | Offer click URL                                                                               |
| preview\_link      | Offer preview URL(GP/Appstore)                                                                |
| package            | Offer package name                                                                            |
| description        | Offer description, including KPI                                                              |
| device             | <p>Device type </p><p>Value: all/mobile/tablet</p>                                            |
| os                 | <p>Device OS </p><p>Value: ios/android</p>                                                    |
| min\_osv           | <p>The minimum OS version </p><p>0 stands for no limited</p>                                  |
| incentive          | <p>0: non-incentive offer</p><p>1: incentive offer</p>                                        |
| deviceid\_required | <p>Whether IDFA/GAID is required. </p><p>0: No requirement </p><p>1: IDFA/GAID is a must.</p> |
| icon               | Icon URL                                                                                      |
| cap                | Offer daily conversion cap, 99999 means unlimited.                                            |
| click\_cap         | Offer daily click cap, -1 means unlimited.                                                    |
| cap\_timezone      | <p>Cap Timezone</p><p>eg. 8 means GMT+8</p>                                                   |
| creatives          | Array of creative                                                                             |
| creatives.type     | <p>Type of creative</p><p>Value: image/zip</p>                                                |
| creatives.size     | File size(KB) of creative                                                                     |
| creatives.width    | Width of an image                                                                             |
| creatives.height   | Height of an image                                                                            |
| creatives.url      | URL of creative                                                                               |
| video              | Array of video                                                                                |
| video.size         | File size(KB) of video                                                                        |
| video.url          | URL of video                                                                                  |
| status             | <p>Offer status, paused offers will be removed from API feed. </p><p>Value: active</p>        |
| convert\_type      | Value: CPI/CPE/CPS                                                                            |
| page               | Page number                                                                                   |
| totalData          | The total number of offers                                                                    |
| limit              | Page size                                                                                     |

#### Response Example

```
{
  "message": "Success",
  "data": [
      {
          "id": 12345,
          "name": "Lazada IN",
          "payout": "2.66",
          "currency": "USD",
          "countries": "IN",
          "click_url":"http://xxx.com/clk.php?offer_id=1&aff_id=123",
          "preview_link": "https://play.google.com/store/apps/details?id=com.lazada.in",
          "package": "com.lazada.in",
          "description": "",
          "device": "all",
          "os": "android",
          "min_osv": "0",
          "incentive": 0,
          "deviceid_required": 0,
          "icon": "http://xxx.com/creatives/icon?id=12345",
          "cap": 99999,
          "click_cap": -1,
          "cap_timezone": 8,
          "creatives": [{
              "type": "image",
              "size": "37",
              "width": "728",
              "height": "90",
              "url": "http://xxx.com/creative/1.jpg"
          }],
          "video": [{
              "url": "http://xxx.com/creative/1.mp4",
              "size": "741"
          }],
          "status": "active",
          "convert_type": "CPI"
      }
  ],
  "page": 1,
  "totalData": 6,
  "limit": 1
}

```

### 3. Click URL Parameters

| Parameter   | Description                                                                                                                                                                                                                                                                                                   |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aff\_sub1   | Your click id                                                                                                                                                                                                                                                                                                 |
| aff\_sub2   | User-defined parameter                                                                                                                                                                                                                                                                                        |
| aff\_sub3   | User-defined parameter                                                                                                                                                                                                                                                                                        |
| aff\_sub4   | User-defined parameter                                                                                                                                                                                                                                                                                        |
| aff\_sub5   | User-defined parameter                                                                                                                                                                                                                                                                                        |
| source\_id  | Your source id                                                                                                                                                                                                                                                                                                |
| google\_aid | Google Advertising ID                                                                                                                                                                                                                                                                                         |
| ios\_idfa   | IOS Identifier for Advertising                                                                                                                                                                                                                                                                                |
| app\_name   | Your app name                                                                                                                                                                                                                                                                                                 |
| pkg\_name   | Your package name                                                                                                                                                                                                                                                                                             |
| ip          | <p>Device IP, <strong>only for iOS Version>14.0</strong></p><p>Value: 192.168.0.0</p>                                                                                                                                                                                                                         |
| lang        | <p>Device Language, <strong>only for</strong> <strong>iOS Version>14.0</strong></p><p>Value: en-US</p>                                                                                                                                                                                                        |
| ua          | <p>User Agent, need to be URL encoded, <strong>only for iOS Version>14.0</strong></p><p>Value: Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%2</p><p>11\_0%20like%20Mac%20OS%20X)%20AppleWebKit%2F604.1.38%20</p><p>(KHTML%2C%20like%20Gecko)%20Version%2F11.0%20Mobile%2F1</p><p>5A372%20Safari%2F604.1</p> |

#### Click URL Example

http\://\[Advertiser Domain]/clk.php?offer\_id=12345\&aff\_id=123\&aff\_sub1=\[CLICK ID]\&source\_id=\[SOURCE ID]\&google\_aid=\[GAID]\&ios\_idfa=\[IDFA]\&app\_name=\[APP NAME]\&ip=\[CLIENT IP]\&lang=\[CLIENT LANGUAGE]\&ua=\[CLIENT UA]

### 4. Postback Parameters

| Macro           | Description                    |
| --------------- | ------------------------------ |
| {aff\_sub1}     | Click ID                       |
| {aff\_sub2}     | User-defined Parameter         |
| {aff\_sub3}     | User-defined Parameter         |
| {aff\_sub4}     | User-defined Parameter         |
| {aff\_sub5}     | User-defined Parameter         |
| {source\_id}    | Source ID                      |
| {google\_aid}   | Google Advertising ID          |
| {ios\_idfa}     | IOS Identifier for Advertising |
| {app\_name}     | App Name                       |
| {pkg\_name}     | Package Name                   |
| {payout}        | Conversion Price               |
| {offer\_id}     | Offer ID                       |
| {country\_code} | Country Code (eg. US)          |
| {click\_ip}     | Client Click IP                |
| {click\_time}   | Client Click Time              |
| {conv\_ip}      | Conversion IP                  |
| {conv\_time}    | Conversion Time                |


---

# 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://doc.linkrall.com/master.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.
