WARNING: 이 서비스를 대한민국 법령을 위반하는 사이트에 연결할 경우 해당 단축 URL 사용이 중지됩니다.
이의 신청은 [email protected] 로 신청해주세요.
API는 모두 GET 메서드를 사용합니다
https://api.aramy.net/v1/shorten?url={단축할 URL}
// node-fetch
let link = '단축할 URL'
const fetch = require('node-fetch')
fetch(`https://api.aramy.net/v1/shorten?url=${encodeURI(link)}`)
.then(res => res.json())
.then(json => {
console.log(`원래 링크 : ${json.original}`)
console.log(`변환된 링크 : ${json.url}`)
console.log(`URL 해시 : ${json.code}`)
});
// request
let link = '단축할 URL'
let api_url = `https://api.aramy.net/v1/shorten?url=${encodeURI(link)}`
const request = require('request');
let options = {
url: api_url
}
request.get(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
let json = JSON.parse(body)
console.log(`원래 링크 : ${json.original}`)
console.log(`변환된 링크 : ${json.url}`)
console.log(`URL 해시 : ${json.code}`)
} else {
console.log('error = ' + response.statusCode);
}
});
import requests
response = requests.get("<https://api.aramy.net/v1/shorten?url=https://aramy.net>")
result = response.json()
if response.status_code == 200:
print(result)
else:
print(f"Error Code: {response.status_code}")