X.gd Developers

X.gd provides an API for using URL shortening from external applications. An API key is required to use the API.

URL Shortening API

Shorten API v1.0

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

Request

*ParameterTypeFormatDescriptionExample
*urlStringhttp(s)://URL to shortenhttps://example.com
shortidString[0-9a-zA-Z_]{6,15}Custom short URL. If omitted, one is assigned randomly.example
analyticsStringtrue / falseEnable access analytics. Enabled by default if omitted.true
filterbotsStringtrue / falseBot filtering when analytics is enabled. Disabled by default if omitted.false
*keyString[0-9a-f]{32}Issued API key0af50e06255c7004f9ad71338f5ad56e
Request Example (URL)
https://xgd.io/V1/shorten?url=https://example.com&key={Your API Key}
Request Example (cURL)
curl -X GET 'https://xgd.io/V1/shorten?url=https://example.com&key={Your API Key}'

Response (Success)

*ParameterTypeFormatDescriptionExample
*statusNumber200Status code200
*shorturlStringhttps://x.gd/[0-9a-zA-Z_]+Shortened URLhttps://x.gd/example
*analyticsBooleantrue / falseAccess analyticstrue
*filterbotsBooleantrue / falseBot filteringfalse
*originalurlStringhttp(s)://Original URLhttps://example.com
Response Example
status: 200
content-type: application/json

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

Response (Failed)

*ParameterTypeFormatDescriptionExample
*statusNumber400 / 401 / 403 / 409 / 429 / 500 / 503Status code429
*messageString-Error messageToo many requests.
Response Example
status: 200
content-type: application/json

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

Status Code

StatusDescription
200The request was successful.
400The request contains an error. Details are included in the message.
401The token is invalid. Please check your API key.
403The service is temporarily or permanently unavailable.
409A shortened URL cannot be issued under the requested conditions. Details are included in the message.
429The API usage limit has been reached. Please wait until the limit is reset and try again.
500A temporary system error has occurred. Please try again later.
503The service is temporarily unavailable. Please try again later.

API Key

We will send an API key issuance link to the email address you entered.
You must complete the process within 24 hours after submission.