Developer

API Documentation

Integrate urlgo.io into your apps. Create short links, manage them, and retrieve analytics programmatically via our REST API.

Quick Start

All API requests require authentication via API key in the Authorization header. Sign up to get your free API key.

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Base URL: https://urlgo.io/api/v1

Rate Limits

Free
100 req/hr
Pro
10,000 req/hr
Enterprise
Unlimited

Endpoints

POST /api/v1/shorten

Create a new short link.

PARAMETERS
FieldTypeRequiredDescription
urlstringYesDestination URL to shorten
slugstringNoCustom slug (auto-generated if empty)
has_adsbooleanNoShow ads on redirect page (default: true)
EXAMPLE — cURL
curl -X POST https://urlgo.io/api/v1/shorten \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/long-page","slug":"my-link","has_ads":true}'
EXAMPLE — JavaScript
const res = await fetch("https://urlgo.io/api/v1/shorten", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ url: "https://example.com", slug: "my-link" })
});
const data = await res.json();
EXAMPLE — Python
import requests

res = requests.post("https://urlgo.io/api/v1/shorten",
  headers={"Authorization": "Bearer YOUR_API_KEY"},
  json={"url": "https://example.com", "slug": "my-link"}
)
data = res.json()
RESPONSE
{
  "success": true,
  "data": {
    "id": "abc12345",
    "short_url": "https://urlgo.io/my-link",
    "target_url": "https://example.com/long-page",
    "slug": "my-link",
    "has_ads": true,
    "created_at": "2026-05-10T12:00:00Z"
  }
}
GET /api/v1/links

List all your links with click counts.

curl https://urlgo.io/api/v1/links \
  -H "Authorization: Bearer YOUR_API_KEY"
GET /api/v1/links/:id

Get a single link with click and unique click counts.

curl https://urlgo.io/api/v1/links/abc12345 \
  -H "Authorization: Bearer YOUR_API_KEY"
PATCH /api/v1/links/:id

Update a link's slug, target URL, or ad setting.

curl -X PATCH https://urlgo.io/api/v1/links/abc12345 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"new-slug","target_url":"https://new-url.com"}'
GET /api/v1/links/:id/stats

Get detailed click analytics for a link — last 7 days, browsers, countries.

curl https://urlgo.io/api/v1/links/abc12345/stats \
  -H "Authorization: Bearer YOUR_API_KEY"
RESPONSE
{
  "success": true,
  "data": {
    "total_clicks": 1247,
    "today": 42,
    "last_7_days": [12, 18, 33, 42, 28, 15, 42],
    "browsers": [{ "name": "Chrome", "count": 620 }],
    "countries": [{ "name": "US", "count": 520 }]
  }
}
DELETE /api/v1/links/:id

Delete a short link. Earnings are preserved.

curl -X DELETE https://urlgo.io/api/v1/links/abc12345 \
  -H "Authorization: Bearer YOUR_API_KEY"
GET /api/v1/account

Get your account info, balance, and usage stats.

curl https://urlgo.io/api/v1/account \
  -H "Authorization: Bearer YOUR_API_KEY"
GET /api/v1/earnings

Get your earnings summary — balance, today's earnings, breakdown by tier.

curl https://urlgo.io/api/v1/earnings \
  -H "Authorization: Bearer YOUR_API_KEY"

WordPress & Website Integration

How It Works

The WordPress plugin automatically monetizes all outbound (external) links in your posts. When a visitor clicks an external link, they pass through urlgo.io's redirect page with ads. You earn money for every unique click.

WHAT GETS REWRITTEN
External links (example.com, google.com, etc.)
Internal links (your own domain)
Social media (facebook, twitter, youtube, instagram, tiktok, etc.)
Already monetized urlgo.io links
SETUP
1️⃣
Add website
Register domain at
/websites
2️⃣
Download plugin
Get your custom
WordPress plugin ZIP
3️⃣
Activate
Upload to WP →
Activate. Done!
GET /out

Pass-through redirect endpoint used by the WordPress plugin. Shows an ad page before redirecting to the destination URL. No short link creation needed.

PARAMETERS (query string)
ParamRequiredDescription
urlYesDestination URL to redirect to
tYesYour website site token (from /websites dashboard)
EXAMPLE
https://urlgo.io/out?url=https://example.com/page&t=wt_your_site_token

This endpoint is used internally by the WordPress plugin. You can also use it manually in any HTML page by adding links in this format.

GET /api/v1/websites

List all your registered websites with click counts and earnings.

curl https://urlgo.io/api/v1/websites \
  -H "Authorization: Bearer YOUR_API_KEY"
RESPONSE
{
  "success": true,
  "data": [
    {
      "id": "dd9583cb-...",
      "domain": "example.com",
      "api_token": "wt_abc123...",
      "total_clicks": 4521,
      "total_earnings": 12.45,
      "status": "active"
    }
  ]
}

Manual Integration (non-WordPress)

You can use the /out endpoint on any website — not just WordPress. Simply change your external links to pass through urlgo.io:

HTML
<!-- Before -->
<a href="https://example.com">Visit Site</a>

<!-- After -->
<a href="https://urlgo.io/out?url=https://example.com&t=YOUR_TOKEN">Visit Site</a>
JAVASCRIPT (auto-rewrite all links)
// Add this script to your site
document.querySelectorAll('a[href^="http"]').forEach(function(a) {
  var host = new URL(a.href).host;
  if (host === location.host) return; // skip internal
  a.href = "https://urlgo.io/out?url="
    + encodeURIComponent(a.href) + "&t=YOUR_TOKEN";
});

Error Codes

CodeMeaning
400Bad request — missing required fields
401Unauthorized — invalid or missing API key
404Not found — link does not exist
409Conflict — slug already in use
429Rate limit exceeded
500Server error
All error responses include a JSON body: {"error": "Description of the error"}

Need help with the API? Contact our support team.

Sign Up for API Access Contact Support