API & Webhooks
Build powerful integrations with our comprehensive REST API. Automate workflows with real-time webhooks and connect to your existing tools.

Built for developers
A developer-first API designed for reliability, performance, and ease of use.
RESTful API
Clean, predictable REST API with comprehensive endpoints for all platform features.
Webhooks
Real-time event notifications. Get notified when links are clicked, created, or modified.
API Keys
Secure API key management with scoped permissions and rotation support.
Rate Limits
Generous rate limits with burst allowances. Scale to millions of requests.
OAuth 2.0
Full OAuth 2.0 support for secure third-party integrations and user authorization.
Documentation
Comprehensive docs with code examples in multiple languages and interactive API explorer.
Simple, powerful API
Get started in minutes with our intuitive API design.
// Create a short link
const response = await fetch('https://api.9to.io/v1/links', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/my-long-url',
slug: 'my-custom-slug',
tags: ['marketing', 'q1-campaign']
})
});
const link = await response.json();
console.log(link.short_url); // https://9to.in/my-custom-slug// Webhook payload for click events
{
"event": "link.clicked",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"link_id": "lnk_abc123",
"short_url": "https://9to.in/my-link",
"click": {
"ip": "192.168.1.1",
"country": "US",
"city": "San Francisco",
"device": "mobile",
"browser": "Chrome",
"referrer": "https://twitter.com"
}
}
}