API Reference

The Payelancer Adsense API allows you to programmatically manage your ad spaces and campaigns. Build custom solutions, automate reports, and integrate directly into your internal tools.

Why use our API?

01. Automation

Automate your daily earning reports or campaign adjustments without manual logins.

02. Integration

Connect your performance data directly to Slack, Discord, or your custom admin panel.

03. Scalability

Manage hundreds of ad sites or thousands of campaigns programmatically at scale.

Authentication

Your API Key

Log in to view your secret API key.

Login

Use the X-API-KEY header to authorize your requests.

curl -X GET "https://adsense.payelancer.com/backend/api/v1/stats.php" \ -H "X-API-KEY: YOUR_API_KEY"

Real-time Stats API

GET /backend/api/v1/stats.php

Retrieve a detailed summary of your account performance. The response adapts based on whether you are a Publisher or an Advertiser.

Response Object

  • impressions Total views
  • clicks Total clicks
  • earnings Total $ (Publishers)
  • spent Total $ (Advertisers)

Sample JSON

{
  "success": true,
  "role": "publisher",
  "stats": {
    "impressions": 1402,
    "clicks": 52,
    "earnings": 4.15
  }
}

Campaigns API

POST /backend/api/v1/campaigns.php

Create new advertising campaigns programmatically. Make sure your account has sufficient balance before initiating a campaign via the API.

Request Body (JSON)

  • name string (required)
  • budget float (required)
  • target_url string (required)

Sample JSON Request

{
  "name": "Summer Shoe Sale",
  "budget": 500.00,
  "target_url": "https://example.com/sale"
}

Ad Formats

GET /backend/api/v1/ad-formats.php

Retrieve a list of all currently supported ad formats, including display banners and native ad sizes, along with their respective IDs for campaign creation.

Response Content

  • id Format Identifier
  • name Human-readable name
  • dimensions Width x Height

Sample JSON

{
  "success": true,
  "formats": [
    {
      "id": "banner_300x250",
      "name": "Medium Rectangle",
      "dimensions": "300x250"
    },
    {
      "id": "banner_728x90",
      "name": "Leaderboard",
      "dimensions": "728x90"
    }
  ]
}

Webhooks

Send your app's performance data anywhere with webhooks.

Configure webhook endpoints in your dashboard. We will send HTTP POST requests with a JSON body whenever a specific event occurs.

Example Webhook Payload (Conversion)

{
  "event": "conversion.tracked",
  "data": {
    "campaign_id": "982734A",
    "ad_id": "459021B",
    "payout": 1.25,
    "timestamp": "2026-03-13T20:55:00Z"
  }
}

How developers use this?

1

Build Custom Dashboards

Don't like our UI? Use the Stats API to build your own dashboard using React, Vue, or Tailwind and show exactly what matters to your business.

2

Real-time Performance Alerts

Write a simple script to monitor your stats. If clicks drop below a certain threshold or your balance is low, trigger an instant email or SMS through your internal systems.

3

Payment Reconciliation

Synchronize your Payelancer earnings with your accounting software (like Quickbooks or Xero) automatically for easier taxes and bookkeeping.

Payments & Billing

Minimum payout for publishers is $50.00. Payments are processed via PayPal, Razorpay, or Wire Transfer.

Advertisers can top up their balance starting at $25.00 using secured payment gateways.

Error Codes

Status Message Description
401 API key required Missing X-API-KEY header
401 Invalid API key The provided key does not exist or is revoked
429 Rate limit exceeded Too many requests in a short period