Integrate urlgo.io into your apps. Create short links, manage them, and retrieve analytics programmatically via our REST API.
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
Create a new short link.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Destination URL to shorten |
| slug | string | No | Custom slug (auto-generated if empty) |
| has_ads | boolean | No | Show ads on redirect page (default: true) |
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}'
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();
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()
{
"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"
}
}
List all your links with click counts.
curl https://urlgo.io/api/v1/links \ -H "Authorization: Bearer YOUR_API_KEY"
Get a single link with click and unique click counts.
curl https://urlgo.io/api/v1/links/abc12345 \ -H "Authorization: Bearer YOUR_API_KEY"
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 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"
{
"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 a short link. Earnings are preserved.
curl -X DELETE https://urlgo.io/api/v1/links/abc12345 \ -H "Authorization: Bearer YOUR_API_KEY"
Get your account info, balance, and usage stats.
curl https://urlgo.io/api/v1/account \ -H "Authorization: Bearer YOUR_API_KEY"
Get your earnings summary — balance, today's earnings, breakdown by tier.
curl https://urlgo.io/api/v1/earnings \ -H "Authorization: Bearer YOUR_API_KEY"
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.
Pass-through redirect endpoint used by the WordPress plugin. Shows an ad page before redirecting to the destination URL. No short link creation needed.
| Param | Required | Description |
|---|---|---|
| url | Yes | Destination URL to redirect to |
| t | Yes | Your website site token (from /websites dashboard) |
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.
List all your registered websites with click counts and earnings.
curl https://urlgo.io/api/v1/websites \ -H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"data": [
{
"id": "dd9583cb-...",
"domain": "example.com",
"api_token": "wt_abc123...",
"total_clicks": 4521,
"total_earnings": 12.45,
"status": "active"
}
]
}
You can use the /out endpoint on any website — not just WordPress. Simply change your external links to pass through urlgo.io:
<!-- 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>
// 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"; });
| Code | Meaning |
|---|---|
| 400 | Bad request — missing required fields |
| 401 | Unauthorized — invalid or missing API key |
| 404 | Not found — link does not exist |
| 409 | Conflict — slug already in use |
| 429 | Rate limit exceeded |
| 500 | Server error |
{"error": "Description of the error"}Need help with the API? Contact our support team.