X.gd Developers

Provide API to use URL shortening function from external application.
To use the API, you need to issue an API key.

API Reference

URL shortening API

Shorten API v1.0
GET https://xgd.io/V1/shorten

Request

*ParameterTypeFormatDescriptionExample
*urlStringhttp(s)://URL you want to shortenhttps://example.com
 shortidString[0-9a-zA-Z_]{6,15}Any shortened URL, If omitted, it will be assigned randomly.example
 analyticsStringtrue / falseEnable access analysis function, If omitted, it will be valid.true
 filterbotsStringtrue / falseBot filtering when access analysis function is enabled, If omitted, it will be invalid.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_]+Short URLhttps://x.gd/example
*analyticsBooleantrue / falseAccess analysistrue
*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 (Failure)

*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 response is normal.
400There was an error in the request. The message contains details.
401The token is invalid. Check the API key.
403It cannot be used temporarily or permanently.
409I can't issue a shortened URL under the requested conditions. The message contains details.
429You have reached the API usage limit. Please wait until the restriction is lifted and try the call again.
500There is a temporary system error. Please try the call again after a certain period of time.
503The service is temporarily unavailable. Please try the call again after a certain period of time.

API Key Issuance

The URL for issuing the API key will be sent to the email address you entered.
The procedure must be completed within 24 hours after submission.