API Reference
Build powerful integrations with TortugAds's RESTful API.
Getting Started
The TortugAds API allows you to programmatically access your tracking data, manage campaigns, and automate your workflow. All API requests should be made to:
Authentication
All API requests require authentication using an API key. Include your API key in the request header:
Authorization: Bearer YOUR_API_KEY
You can generate API keys in your account settings under Settings > API Keys.
// Example with cURL
curl -X GET "https://tortugads.com/api/v1/campaigns" \
-H "Authorization: Bearer YOUR_API_KEY"
Rate Limiting
API requests are limited to 100 requests per minute per API key. If you exceed this limit, you'll receive a 429 status code. The rate limit resets every minute.
Campaigns
Retrieve a list of all campaigns in your account.
| Parameter | Type | Description |
|---|---|---|
| status | string | Filter by status: active, paused, archived |
| limit | integer | Results per page (default: 50, max: 100) |
// Response { "data": [ { "id": "camp_abc123", "name": "Summer Promo", "status": "active", "clicks": 15420, "conversions": 342 } ] }
Create a new campaign.
| Parameter | Type | Description |
|---|---|---|
| namerequired | string | Campaign name |
| traffic_source_idrequired | string | ID of the traffic source |
| offer_idrequired | string | ID of the offer to promote |
Conversions
Retrieve conversion data with filtering options.
| Parameter | Type | Description |
|---|---|---|
| campaign_id | string | Filter by campaign ID |
| date_from | string | Start date (YYYY-MM-DD) |
| date_to | string | End date (YYYY-MM-DD) |
Record a conversion via server-to-server postback.
| Parameter | Type | Description |
|---|---|---|
| click_idrequired | string | The click ID from the tracking URL |
| payout | number | Conversion payout amount |
| status | string | Status: approved, pending, rejected |
Reports
Get aggregated statistics for your account.
| Parameter | Type | Description |
|---|---|---|
| date_fromrequired | string | Start date (YYYY-MM-DD) |
| date_torequired | string | End date (YYYY-MM-DD) |
| group_by | string | Group: day, week, month, campaign |
// Response { "data": { "clicks": 125840, "conversions": 2847, "revenue": 35420.50, "profit": 16920.50, "roi": 91.46 } }