API Documentation
RESTful API for URL shortening and link management
Getting Started
Base URL: http://urlfy.org/api/v1
POST
/api/v1/shorten
Create a short URL
Request
{"url": "https://example.com"}
Response
{"shortUrl": "SHORT_URL", "cid": 304}
Examples
cURL
curl -X POST http://urlfy.org/api/v1/shorten \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
JavaScript
fetch('http://urlfy.org/api/v1/shorten', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com'})
})
.then(res => res.json())
.then(result => console.log(result.shortUrl));
Python
import requests
response = requests.post('http://urlfy.org/api/v1/shorten',
json={'url': 'https://example.com'})
result = response.json()
print(result['shortUrl'])
Error Codes
400
- Bad Request401
- Unauthorized404
- Not Found429
- Too Many Requests500
- Internal Server ErrorReady to Start?
Test the API directly or integrate it into your application