Skip to main content
GET
https://api-v2.adrop.io
/
request
Native Ads
curl --request GET \
  --url https://api-v2.adrop.io/request \
  --header 'Authorization: <authorization>'
{
    "code": 0,
    "msg": "OK",
    "result": {
        "id": "ad_123456",
        "format": "nativeAd",
        "unit": "YOUR_UNIT_ID",
        "w": 320,
        "h": 250,
        "ad": "<div>...</div>",
        "headline": "Ad Title",
        "body": "Ad body content goes here.",
        "callToAction": "Learn More",
        "destinationURL": "https://example.com/landing",
        "target": "external",
        "profile": {
            "displayLogo": "https://cdn.adrop.io/logo.png",
            "displayName": "Advertiser Name",
            "link": "https://advertiser.com"
        }
    }
}
Native ads are returned as structured data, allowing you to implement custom UI that matches your app or website design.

Request Parameters

Headers

Authorization
string
required
App Key (found in adrop_service.json)

Query Parameters

unit
string
required
Native ad unit ID
uid
string
User unique identifier. Used for frequency capping and targeting.
pf
string
Platform. One of android, ios, web
lcl
string
Locale. e.g., en_US, ko_KR
theme
string
Theme mode. light or dark
contextId
string
Context targeting ID
trackMode
integer
Set to 1 to receive asset URLs and tracking pixels. You must implement impression and click tracking manually in this case.
adId
string
Advertising identifier (required for device preview)

Response

code
integer
required
Response code. 0 indicates success.
msg
string
required
Response message
result
object
Ad data
{
    "code": 0,
    "msg": "OK",
    "result": {
        "id": "ad_123456",
        "format": "nativeAd",
        "unit": "YOUR_UNIT_ID",
        "w": 320,
        "h": 250,
        "ad": "<div>...</div>",
        "headline": "Ad Title",
        "body": "Ad body content goes here.",
        "callToAction": "Learn More",
        "destinationURL": "https://example.com/landing",
        "target": "external",
        "profile": {
            "displayLogo": "https://cdn.adrop.io/logo.png",
            "displayName": "Advertiser Name",
            "link": "https://advertiser.com"
        }
    }
}

Tracking Implementation

When using trackMode=1, you must track impression and click events manually.

Impression Tracking

Call the imprTracker URL when the ad is displayed on screen:
// When ad enters viewport
fetch(response.result.imprTracker);

Click Tracking

Call the clickTracker URL first when the user clicks the ad, then navigate to destinationURL:
function handleAdClick(adData) {
    // Track click
    fetch(adData.clickTracker).then(() => {
        // Navigate to landing page
        window.open(adData.destinationURL, '_blank');
    });
}

Custom Rendering Example

<div class="native-ad" id="native-ad-container">
    <div class="ad-profile">
        <img class="ad-logo" />
        <span class="ad-advertiser"></span>
    </div>
    <img class="ad-image" />
    <h3 class="ad-headline"></h3>
    <p class="ad-body"></p>
    <button class="ad-cta"></button>
</div>

<script>
fetch('https://api-v2.adrop.io/request?unit=YOUR_UNIT_ID&trackMode=1', {
    headers: { 'Authorization': 'YOUR_APP_KEY' }
})
.then(res => res.json())
.then(data => {
    if (data.code === 0) {
        const ad = data.result;

        // Render ad content
        document.querySelector('.ad-logo').src = ad.profile.logo;
        document.querySelector('.ad-advertiser').textContent = ad.profile.name;
        document.querySelector('.ad-image').src = ad.asset;
        document.querySelector('.ad-headline').textContent = ad.headline;
        document.querySelector('.ad-body').textContent = ad.body;
        document.querySelector('.ad-cta').textContent = ad.callToAction;

        // Track impression
        fetch(ad.imprTracker);

        // Click event
        document.getElementById('native-ad-container').onclick = () => {
            fetch(ad.clickTracker).then(() => {
                window.open(ad.destinationURL, '_blank');
            });
        };
    }
});
</script>