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
| * | Parameter | Type | Format | Description | Example |
|---|---|---|---|---|---|
| * | url | String | http(s):// | URL to shorten | https://example.com |
| shortid | String | [0-9a-zA-Z_]{6,15} | Custom short URL. If omitted, one is assigned randomly. | example | |
| analytics | String | true / false | Enable access analytics. Enabled by default if omitted. | true | |
| filterbots | String | true / false | Bot filtering when analytics is enabled. Disabled by default if omitted. | false | |
| * | key | String | [0-9a-f]{32} | Issued API key | 0af50e06255c7004f9ad71338f5ad56e |
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)
| * | Parameter | Type | Format | Description | Example |
|---|---|---|---|---|---|
| * | status | Number | 200 | Status code | 200 |
| * | shorturl | String | https://x.gd/[0-9a-zA-Z_]+ | Shortened URL | https://x.gd/example |
| * | analytics | Boolean | true / false | Access analytics | true |
| * | filterbots | Boolean | true / false | Bot filtering | false |
| * | originalurl | String | http(s):// | Original URL | https://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)
| * | Parameter | Type | Format | Description | Example |
|---|---|---|---|---|---|
| * | status | Number | 400 / 401 / 403 / 409 / 429 / 500 / 503 | Status code | 429 |
| * | message | String | - | Error message | Too many requests. |
Response Example
status: 200
content-type: application/json
{
"status": 429,
"message": "Too many requests."
}Status Code
| Status | Description |
|---|---|
| 200 | The request was successful. |
| 400 | The request contains an error. Details are included in the message. |
| 401 | The token is invalid. Please check your API key. |
| 403 | The service is temporarily or permanently unavailable. |
| 409 | A shortened URL cannot be issued under the requested conditions. Details are included in the message. |
| 429 | The API usage limit has been reached. Please wait until the limit is reset and try again. |
| 500 | A temporary system error has occurred. Please try again later. |
| 503 | The 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.