X.gd Developers

외부 애플리케이션에서 URL 단축 기능을 이용하기 위한 API를 제공합니다. API 이용을 위해서는 API 키 발급이 필요합니다.

URL 단축 API

Shorten API v1.0

GET https://xgd.io/V1/shorten

요청

*ParameterTypeFormatDescriptionExample
*urlStringhttp(s)://단축할 URLhttps://example.com
shortidString[0-9a-zA-Z_]{6,15}임의의 단축 URL. 생략 시 무작위 할당example
analyticsStringtrue / false액세스 분석 활성화. 생략 시 활성화true
filterbotsStringtrue / false분석 활성화 시 봇 필터링. 생략 시 비활성화false
*keyString[0-9a-f]{32}발급된 API 키0af50e06255c7004f9ad71338f5ad56e
요청 예시 (URL)
https://xgd.io/V1/shorten?url=https://example.com&key={Your API Key}
요청 예시 (cURL)
curl -X GET 'https://xgd.io/V1/shorten?url=https://example.com&key={Your API Key}'

응답 (성공)

*ParameterTypeFormatDescriptionExample
*statusNumber200상태 코드200
*shorturlStringhttps://x.gd/[0-9a-zA-Z_]+단축 URLhttps://x.gd/example
*analyticsBooleantrue / false액세스 분석true
*filterbotsBooleantrue / false봇 필터링false
*originalurlStringhttp(s)://원본 URLhttps://example.com
응답 예시
status: 200
content-type: application/json

{
    "status": 200,
    "shorturl": "https://x.gd/example",
    "analytics": true,
    "filterbots": false,
    "originalurl": "https://example.com/"
}

응답 (실패)

*ParameterTypeFormatDescriptionExample
*statusNumber400 / 401 / 403 / 409 / 429 / 500 / 503상태 코드429
*messageString-오류 메시지Too many requests.
응답 예시
status: 200
content-type: application/json

{
    "status": 429,
    "message": "Too many requests."
}

상태 코드

StatusDescription
200응답이 정상입니다.
400요청에서 오류가 발생했습니다. 메시지에 자세한 내용이 포함되어 있습니다.
401토큰이 유효하지 않습니다. API 키를 확인해 주세요.
403일시적 또는 영구적으로 이용할 수 없습니다.
409요청한 조건으로 단축 URL을 발급할 수 없습니다. 메시지에 자세한 내용이 포함되어 있습니다.
429API 사용 제한에 도달했습니다. 제한이 해제될 때까지 기다렸다가 다시 시도하세요.
500일시적으로 시스템 오류가 발생했습니다. 일정 시간 경과 후 다시 시도하세요.
503일시적으로 서비스를 이용할 수 없습니다. 일정 시간 경과 후 다시 시도하세요.

API 키 발급

입력하신 이메일 주소로 API 키 발급용 URL을 전송합니다.
전송 후 24시간 이내에 절차를 완료해야 합니다.