API Documentation

Use the API to generate permanent or temporary short links from bots, websites and automation tools.

Authentication

Send your API key in the X-API-Key header.

POST /api/v1/shorten.php

{ "url": "https://example.com/article", "link_type": "temporary", "expires_in": 86400 }

Response

{ "success": true, "data": { "short_url": "https://yourdomain.com/s/AbC123", "code": "AbC123" } }

Python Example

import requests r = requests.post("https//viralplay.top/api/v1/shorten.php", headers={"X-API-Key":"YOUR_API_KEY"}, json={"url":"https://example.com","link_type":"permanent"}) print(r.json())

Errors

400 Invalid request ยท 401 Invalid API key ยท 429 Rate limit exceeded