Developer Reference

DankADS HTTP API

Everything you need to integrate ad serving into your Telegram bot. Simple HTTP endpoints — no libraries or SDKs required. Just make REST calls from any language or framework.

Quick Start

1

Register Your Bot

Sign up as a publisher and add your Telegram bot to get an API key.

2

Fetch Ads

Call GET /v1/fetch-ad from your bot to get an ad to display.

3

Get Paid

Impressions and clicks are tracked automatically. Withdraw via crypto.

Base URL

https://ads.myrx.pw

Authentication

All API requests require your bot's API key sent via the x-ad-api-key header. Advertiser endpoints use JWT bearer tokens via the Authorization: Bearer <token> header (or access_token cookie for browser sessions).

# Publisher (bot) authentication
curl -H "x-ad-api-key: YOUR_API_KEY" \
     "https://ads.myrx.pw/v1/fetch-ad?user_telegram_id=12345&user_lang=en"

# Advertiser authentication
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
     "https://ads.myrx.pw/v1/campaigns"

Ad Serving

GET /v1/fetch-ad

Fetch a targeted ad for a user. Returns ad content, click URL, and impression tracking URL.

Query Params: user_telegram_id (required), user_lang (optional), user_country (optional), tags (optional)
Headers: x-ad-api-key: YOUR_KEY
GET /track/impression

Register an ad impression. Called automatically via the impression URL returned by /v1/fetch-ad.

GET /c/{short_code}

Track an ad click and redirect to the advertiser's destination URL. Called when users tap the ad button.

Campaign Management

GET /v1/campaigns

List all campaigns for the authenticated advertiser.

POST /v1/campaigns

Create a new campaign with bid amount, budget, and pricing model (CPC/CPM).

PATCH /v1/campaigns/{campaign_id}

Update a campaign's name, bid amount, daily budget, total budget, or date range.

DELETE /v1/campaigns/{campaign_id}

Delete a campaign (only if no spend has occurred).

GET /v1/campaigns/{campaign_id}/stats

Get performance stats for a campaign (clicks, impressions, spend, CTR over time).

Ad Management

GET /v1/ads

List all ads for a campaign.

POST /v1/ads

Create a new ad with title, body text, destination URL, and optional media.

PATCH /v1/ads/{ad_id}

Update an ad's content, destination, tags, or targeting settings.

DELETE /v1/ads/{ad_id}

Delete an ad.

Stats & Revenue

GET /v1/advertiser/stats

Advertiser dashboard stats — aggregated clicks, impressions, and spend across all campaigns.

POST /v1/publisher/deposit

Request a withdrawal of earnings to a crypto wallet.

Response Format

All endpoints return JSON. Successful responses include the result data. Errors follow this structure:

{
    "detail": "Error description"
}

Rate Limits

Ad serving endpoints are rate-limited per IP to prevent abuse. Exceeding limits will return 429 Too Many Requests. Standard dashboard endpoints are rate-limited to 60 requests per minute per user.

Need Help?

Check out the integration guide in your publisher dashboard, or reach out for support.