API Documentation
Integrate SpotUrl into your applications with our simple REST API.
Shorten URL
POST https://spoturl.com/api/shorten
Headers
Content-Type: application/json
Request Body
url
string (required)
The URL to shorten
isPublic
boolean (optional)
Whether the URL should be publicly listed. Default: false
Example Request
curl -X POST https://spoturl.com/api/shorten \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/very-long-url", "isPublic": false }'
Success Response
{ "success": true, "slug": "abc123", "shortUrl": "https://spoturl.com/abc123", "editUrl": "https://spoturl.com/manage/abc123/token123" }
JavaScript Example
const response = await fetch('https://spoturl.com/api/shorten', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url: 'https://example.com/very-long-url', isPublic: false }) }); const data = await response.json(); console.log(data.shortUrl); // https://spoturl.com/abc123
Rate Limits
API requests are limited to 100 URLs per hour per IP address.
Need higher limits? Contact us for enterprise options.
CORS Support
The API supports CORS (Cross-Origin Resource Sharing), allowing you to make requests directly from browser-based applications.