API Reference for Developers
Getting Started
Welcome to the YouTube URL Shortener API documentation. This API enables you to shorten YouTube URLs and obtain responses in either JSON or plain text formats. Below, you will find detailed instructions, examples, and usage guidelines.
Base URL :
GET
https://appopener.recut.in/v1/api
Example Request
GET : https://appopener.recut.in/v1/api?url={youtube_url}&json=1
Request Parameters
Parameter | Description |
---|---|
url (required) | The YouTube URL you want to shorten. |
json (optional) | to 1 to receive a JSON response (default). |
plain (optional) | Set to 1 to receive a plain text response. |
fetch('https://appopener.recut.in/v1/api?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ&json=1')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Server response
{
"error": 0,
"id": "3",
"shorturl": "https://rcut.in/smartlink"
}
Error Responses
If there is an issue with the URL or if the content is not found, the API will return an error response.
{
"error": 1,
"message": "An error occurred"
}