API Reference
URL shortening API
Shorten API v1.0
GET https://xgd.io/V1/shorten
GET https://xgd.io/V1/shorten
Request
| * | Parameter | Type | Format | Description | Example |
|---|---|---|---|---|---|
| * | url | String | http(s):// | URL you want to shorten | https://example.com |
| shortid | String | [0-9a-zA-Z_]{6,15} | Any shortened URL, If omitted, it will be assigned randomly. | example | |
| analytics | String | true / false | Enable access analysis function, If omitted, it will be valid. | true | |
| filterbots | String | true / false | Bot filtering when access analysis function is enabled, If omitted, it will be invalid. | 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_]+ | Short URL | https://x.gd/example |
| * | analytics | Boolean | true / false | Access analysis | 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 (Failure)
| * | 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 response is normal. |
| 400 | There was an error in the request. The message contains details. |
| 401 | The token is invalid. Check the API key. |
| 403 | It cannot be used temporarily or permanently. |
| 409 | I can't issue a shortened URL under the requested conditions. The message contains details. |
| 429 | You have reached the API usage limit. Please wait until the restriction is lifted and try the call again. |
| 500 | There is a temporary system error. Please try the call again after a certain period of time. |
| 503 | The 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.