logo
API Setup

API

The API provides publishers with access to a list of available offers tailored to their app.

{
  "success": true,
  "current_page": 1,
  "total_pages": 2,
  "total_offers": 176,
  "count": 100,
  "offers": [
    {
      "offer_id": "6754933000",
      "offer_name": "Coin Master - Android",
      "payout": "4.64",
      "reward": 2320,
      "country": ["US", "CA"],
      "device": "android",
      "description": "<p><strong>Coin Master</strong> is a fun casual game where you spin to earn coins, build villages, and raid other players. Progress through different village levels and collect rewards as you advance.</p>",
      "requirement": "Install the app and reach Village 20 within 14 days",
      "offer_image": "https://cdn.targo.io/offers/image.png",
      "preview_url": "https://play.google.com/store/apps/details?id=com.moonactive.coinmaster",
      "tracking_url": "https://targo.io/api/v1/track/6754933558/[APP_ID]?signature=eyJpdiI6...&user_id=",
      "category": "cpi",
      "state_type": "all",
      "states": [],
      "events": [
        {
          "event_id": 814965,
          "event_name": "Install the app",
          "event_description": "Install the app",
          "event_payout": 1.54,
          "event_reward": 770
        },
        {
          "event_id": 681646,
          "event_name": "Reach villages 5",
          "event_description": "Reach villages 5 In 1 Days",
          "event_payout": 1.54,
          "event_reward": 770
        }
      ]
    }
  ]
}

By integrating this API, publishers can effortlessly retrieve and present these offers directly within their own user interface. This enables the development of fully native, personalized in-app experiences that align seamlessly with the app’s design and user journey driving higher user engagement and boosting conversion rates.

1. Authentication

All requests to the API require authentication using your API Key and APP ID .

1. Navigate to your Publisher Dashboard and select your App.

2. In the "Basic Info" tab, find the API Key section.

3. If you don't have an API key, click Request API Key and wait for approval.

4. Once approved, copy your API Key.

2. Endpoint

Endpoint URLhttps://targo.io/api/v1/offers/[APP_ID]
       HTTP Method GET
       HeadersAuthorization: Bearer YOUR_API_KEY``Accept: application/json
       Refresh rate5 minutes

Replace [APP_ID] with the unique ID of the application you are querying

2.1 Example

<?php

$app_id = "YOUR_APP_ID";
$api_key = "YOUR_API_KEY";
$limit = 100;

$all_offers = [];
$current_page = 1;

do {
    $url = "https://targo.io/api/v1/offers/{$app_id}?limit={$limit}&page={$current_page}";

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        "Authorization: Bearer {$api_key}",
        "Accept: application/json"
    ]);

    $response = curl_exec($ch);
    curl_close($ch);

    $data = json_decode($response, true);

    if (isset($data['success']) && $data['success'] === true) {
        $all_offers = array_merge($all_offers, $data['offers']);

        $total_pages = $data['total_pages'];
        $current_page++;
    } else {
        echo "Error fetching page {$current_page}
";
        break;
    }

} while ($current_page <= $total_pages);

echo "Successfully fetched " . count($all_offers) . " total offers!";

3. Query Parameters

All query parameters are optional and allow you to filter the inventory returned by the API. If no parameters are provided, the API will return all available offers for your App.

Query parameterTypeDescription
limitintThe number of results to return per page. Maximum is 100.
pageintThe current page number for pagination
countrystringISO Alpha-2 Country Code (e.g., US, GB). Filters offers available in that country
devicestringFilters offers by device type. Accepts android, ios, desktop, or all
statestringFilters offers by US State (e.g., CA, NY). Accepts comma-separated values (e.g., CA,NY)
payoutfloatFilters for offers with a total payout greater than or equal to this amount
offer_idintFetch details for a specific offer
user_idstringThe ID of the user on your system. We dynamically insert this into the tracking_url provided in the response

4. Pagination

The API implements standard pagination. The root of the JSON response contains the following simplified pagination properties:

  • current_page: The current page number you are viewing.

  • total_pages: The total number of pages available based on your limit.

  • total_offers: The absolute total number of valid offers available across all pages.

  • count: How many offers are returned in this specific response.

By passing ?page=2&limit=50, you can loop through the entire inventory seamlessly until current_page reaches total_pages.

5. Response Fields

AttributeTypeDescriptionExample
offer_idintThe TarGo offer ID.4327408000
offer_namestringTitle of the offer."Coin Master"
payoutfloatThe Total Maximum USD Payout you receive if the user completes all events.7.50
rewardfloatThe Total Maximum Virtual Currency the user receives (calculated via your App's Currency Multiplier)5629.43
countryarrayArray of supported 2-letter country codes ["US", "CA"]
devicestringThe targeted device OS android, ios, desktop, or all)"android"
descriptionstringDescription of the offer
requirementstringInstructional requirement for the user.
offer_imagestring URL to the offer thumbnail/icon.  https://cdn.targo.io/offers/image.png
preview_urlstringThe Google Play, App Store, or web destination link for the offerhttps://play.google.com/store/apps/details?id=com.moonactive.coinmaster
tracking_urlstringRedirect your users to this URL when they click on the offer. Please note that the user_id= parameter is required and must be included in the tracking URL.https://targo.io/api/v1/track/000000/[APP_ID]?signature=eyNDQxMDWNjZDQ0M2Q0YjE5NCIsInRhZyI6IiJ9&user_id=[USER_ID]
categorystringThe type of offer"cpi"
state_typestringThe mechanism of filtering if US states are targeted (e.g., include, exclude, or all)include
statesarrayArray of targeted 2-letter US State codes["NY", "CA"]
eventsarrayAn array of multi-reward steps (applicable for multi-level games)[...]
event_idintID of a event in the offer814900
event_namestringThe name of the event step.  Install the app
event_descriptionstringDetailed instructions for the event step.    Play 30 Minutes In 2 Days
event_payoutfloatThe actual USD amount you receive when the user completes this specific step1.20
event_rewardfloatThe exact amount of virtual currency to explicitly credit your user.555.76

The tracking_url****included in the offers list is a securely generated, time-sensitive redirect link. The link is valid for 30 minutes if a user attempts to access it after that period, it will have expired.

You can append data directly to the URL string provided in the JSON:

AttributeTypeRequiredDescriptionExample
user_idstringYesAutomatically filled if you passed user_id to the API request, otherwise append your user's ID here."user_123"
gaidstringYes (Android)(Android Only) The Google Advertising ID of the device.3f9c2a7e-8b41-4d6a-9c2f-1e7b5a4d8c90
idfastringYes (iOS)(iOS Only) The Identifier for Advertisers of theA7F3C9D2-5E8B-4A1F-9D6C-2B7E4F8A3C91
sub1stringNo(e.g., Campaign tracking, traffic source IDs). We will append these back in the postback!campaign_x
sub2stringNo(e.g., Campaign tracking, traffic source IDs). We will append these back in the postback!source_y

6.2 Example

https://targo.io/api/v1/track/6754933000/[APP_ID]?signature=eyJpdiI6...&user_id=user_123&gaid=e925665f-4d8e...&sub1=campaign_x