NAV
Bash JavaScript PHP Python

Getting Started

UrlGo.In API is free to use. You just need to create a free account to get your API access token.

Get API Access Token

Replace {access_token} with your access token in HTTP Headers. Refer to Request

Request

Base URL

https://urlgo.in/api/v1

HTTP Headers

KEY VALUE
Accept application/json
Content-Type application/json
Authorization Bearer {access_token}

HTTP Methods

VERB DESCRIPTION
GET Obtain information. Query path parameters are allowed.
POST Add new information. Body is allowed.

Response

All API response is JSON formatted and it has Content-Type: application/json header.

HTTP Status Codes

HTTP CODE KEY DESCRIPTION
200 OK Request succeeded.
401 UNAUTHENTICATED_ERROR Unauthenticated.
422 VALIDATION_ERROR The given data was invalid.
404 ROUTE_NOT_FOUND_ERROR Route not found.
405 METHOD_NOT_ALLOWED_ERROR Method not allowed.
404 DATA_NOT_FOUND_ERROR Data not found.

Response Format

Success and fail response has a slightly different JSON structure

Success Response Structure

Success Format


{
    "status": "success", // Always success
    "code": 200, // Always 200
    "data": { }, // Data Object Returned
    "message": "Successfully read short url." // Success message
}

            
Parameter Type Description
status String The response result. Always `success` for success response
code Integer The response result code. Always `200` for success response
data Object The response data object
message String The general message of this response

Fail Format


{
    "status": "fail", // Always fail
    "code": 405, // Error Code
    "error_key": "METHOD_NOT_ALLOWED_ERROR", // Error Key
    "data": null,
    "message": "Method not allowed." // Error Description
}

            

Fail Response Structure

Parameter Type Description
status String The response result. Always `fail` for success response
code Integer The response result code. Refer to HTTP Status Codes
error_key String The error key of this response. Refer to HTTP Status Codes
data Object The response data object
message String The error message of this response

API

Get user info

Example request:

curl -X GET \
    -G "https://urlgo.in/api/v1/user" \
    -H "Authorization: Bearer {access_token}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://urlgo.in/api/v1/user"
);

let headers = {
    "Authorization": "Bearer {access_token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
    $response = $client->get(
        'https://urlgo.in/api/v1/user',
        [
            'headers' => [
                'Authorization' => 'Bearer {access_token}',
                'Content-Type' => 'application/json',
                'Accept' => 'application/json',
            ],
        ]
    );
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://urlgo.in/api/v1/user'
headers = {
    'Authorization': 'Bearer {access_token}',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}
response = requests.request("GET", url, headers=headers)
response.json()

Example response (200 - Success):

{
    "status": "success",
    "code": 200,
    "data": {
        "name": "John Doe",
        "email": "[email protected]",
        "email_verified_at": "2020-04-19T13:25:41.000000Z",
        "created_at": "2020-04-18T13:09:21.000000Z",
        "updated_at": "2020-04-20T14:50:44.000000Z"
    },
    "message": "Successfully retrieve authenticated user information"
}

HTTP Request

GET api/v1/user

List all short url.

Example request:

curl -X GET \
    -G "https://urlgo.in/api/v1/short-url/list?per_page=10&page=1" \
    -H "Authorization: Bearer {access_token}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://urlgo.in/api/v1/short-url/list?per_page=10&page=1"
);

let headers = {
    "Authorization": "Bearer {access_token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
    $response = $client->get(
        'https://urlgo.in/api/v1/short-url/list?per_page=10&page=1',
        [
            'headers' => [
                'Authorization' => 'Bearer {access_token}',
                'Content-Type' => 'application/json',
                'Accept' => 'application/json',
            ],
        ]
    );
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://urlgo.in/api/v1/short-url/list?per_page=10&page=1'
headers = {
    'Authorization': 'Bearer {access_token}',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}
response = requests.request("GET", url, headers=headers)
response.json()

Example response (200 - Success):

{
    "status": "success",
    "code": 200,
    "data": {
        "current_page": 1,
        "data": [
            {
                "uid": "somelonguidherev2sp30ranli4quwhvcdb2xflr",
                "original": "https://revnology.com",
                "short_key": "abc123",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-23T14:50:11.000000Z",
                "updated_at": "2020-04-23T14:50:11.000000Z",
                "shortened_url": "https://urlgo.in/abc123",
                "statistic_url": "https://urlgo.in/stats/somelonguidherev2sp30ranli4quwhvcdb2xflr"
            },
            {
                "uid": "somelonguidheretzoutbkve8tjusgu5rf2erhl6",
                "original": "https://revnology.com/?example",
                "short_key": "revnology-1",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-23T14:47:35.000000Z",
                "updated_at": "2020-04-23T14:47:35.000000Z",
                "shortened_url": "https://urlgo.in/revnology-1",
                "statistic_url": "https://urlgo.in/stats/somelonguidheretzoutbkve8tjusgu5rf2erhl6"
            },
            {
                "uid": "somelonguidhereus1ntjkl2z8d3yw5rlpi67a43",
                "original": "https://revnology.com/?test=1",
                "short_key": "revnology-2",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-23T14:45:42.000000Z",
                "updated_at": "2020-04-23T14:45:42.000000Z",
                "shortened_url": "https://urlgo.in/revnology-2",
                "statistic_url": "https://urlgo.in/stats/somelonguidhereus1ntjkl2z8d3yw5rlpi67a43"
            },
            {
                "uid": "somelonguidherew4h2qcnaowk1kn55si47woljq",
                "original": "https://revnology.com/?test",
                "short_key": "revnology-3",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-23T14:45:21.000000Z",
                "updated_at": "2020-04-23T14:45:21.000000Z",
                "shortened_url": "https://urlgo.in/revnology-3",
                "statistic_url": "https://urlgo.in/stats/somelonguidherew4h2qcnaowk1kn55si47woljq"
            },
            {
                "uid": "somelonguidhere9brlyxkyb6mk0ann7ff1ge3ps",
                "original": "https://revnology.com/?1",
                "short_key": "revnology-4",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-19T15:04:04.000000Z",
                "updated_at": "2020-04-19T15:04:04.000000Z",
                "shortened_url": "https://urlgo.in/revnology-4",
                "statistic_url": "https://urlgo.in/stats/somelonguidhere9brlyxkyb6mk0ann7ff1ge3ps"
            },
            {
                "uid": "somelonguidheredrexmc1hzlilcglany5iydf7e",
                "original": "https://revnology.com/",
                "short_key": "revnology-5",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-19T15:01:15.000000Z",
                "updated_at": "2020-04-19T15:01:15.000000Z",
                "shortened_url": "https://urlgo.in/revnology-5",
                "statistic_url": "https://urlgo.in/stats/somelonguidheredrexmc1hzlilcglany5iydf7e"
            },
            {
                "uid": "somelonguidherei3uv83tylwakw2bvabsmcdfa5",
                "original": "https://revnology.com?test=1",
                "short_key": "revnology-6",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-19T15:01:08.000000Z",
                "updated_at": "2020-04-19T15:01:08.000000Z",
                "shortened_url": "https://urlgo.in/revnology-6",
                "statistic_url": "https://urlgo.in/stats/somelonguidherei3uv83tylwakw2bvabsmcdfa5"
            },
            {
                "uid": "somelonguidhere9dx7byhh9y9aqnmj3qyyhzkff",
                "original": "https://revnology.com?8",
                "short_key": "revnology-7",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-19T15:00:58.000000Z",
                "updated_at": "2020-04-19T15:00:58.000000Z",
                "shortened_url": "https://urlgo.in/revnology-7",
                "statistic_url": "https://urlgo.in/stats/somelonguidhere9dx7byhh9y9aqnmj3qyyhzkff"
            },
            {
                "uid": "somelonguidheredcbm3n8dxytqrkdry1j95jtzj",
                "original": "https://revnology.com?9",
                "short_key": "revnology-8",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-19T15:00:41.000000Z",
                "updated_at": "2020-04-19T15:00:41.000000Z",
                "shortened_url": "https://urlgo.in/revnology-8",
                "statistic_url": "https://urlgo.in/stats/somelonguidheredcbm3n8dxytqrkdry1j95jtzj"
            },
            {
                "uid": "somelonguidherezcc54o25s0dmgx5opxtomlazc",
                "original": "https://revnology.com?10",
                "short_key": "revnology-9",
                "redirect_option": "direct",
                "disabled_at": null,
                "created_at": "2020-04-19T14:59:39.000000Z",
                "updated_at": "2020-04-19T14:59:39.000000Z",
                "shortened_url": "https://urlgo.in/revnology-9",
                "statistic_url": "https://urlgo.in/stats/somelonguidherezcc54o25s0dmgx5opxtomlazc"
            }
        ],
        "first_page_url": "https://urlgo.in/api/v1/short-url/list?page=1",
        "from": 1,
        "last_page": 3,
        "last_page_url": "https://urlgo.in/api/v1/short-url/list?page=3",
        "next_page_url": "https://urlgo.in/api/v1/short-url/list?page=2",
        "path": "https://urlgo.in/api/v1/short-url/list",
        "per_page": 10,
        "prev_page_url": null,
        "to": 10,
        "total": 27
    },
    "message": "Successfully list short url."
}

HTTP Request

GET api/v1/short-url/list?per_page={per_page}&page={page}

Query Params

Param Type Description
per_page Integer Pagination total records to be display per page
page Integer Pagination page number

Get short url

Example request:

curl -X GET \
    -G "https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl" \
    -H "Authorization: Bearer {access_token}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl"
);

let headers = {
    "Authorization": "Bearer {access_token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
    $response = $client->get(
        'https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl',
        [
            'headers' => [
                'Authorization' => 'Bearer {access_token}',
                'Content-Type' => 'application/json',
                'Accept' => 'application/json',
            ],
        ]
    );
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl'
headers = {
    'Authorization': 'Bearer {access_token}',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}
response = requests.request("GET", url, headers=headers)
response.json()

Example response (200 - Success):

{
    "status": "success",
    "code": 200,
    "data": {
        "uid": "somelonguidherez3h1d2bwkzvadwgfh4oifwkhl",
        "original": "https://revnology.com",
        "short_key": "revnology-99",
        "shortened_url": "https://urlgo.in/revnology-99",
        "redirect_option": "direct",
        "disabled_at": null,
        "statistic_url": "https://urlgo.in/stats/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl",
        "created_at": "2020-04-26T12:50:43.000000Z",
        "updated_at": "2020-04-26T12:50:43.000000Z",
        "total_clicks": 1,
        "total_clicks_for_mobile": 0,
        "total_clicks_for_desktop": 1,
        "total_clicks_for_tablet": 0,
        "top_country": "United States",
        "top_browser": "Chrome 81.0.4044"
    },
    "message": "Successfully read short url."
}

Example response (404 - Data Not Found):

{
    "status": "fail",
    "code": 404,
    "error_key": "DATA_NOT_FOUND_ERROR",
    "data": null,
    "message": "Short url not found."
}

HTTP Request

GET api/v1/short-url/read/{uid}

URI Params

Param Type Description
uid String The uid of the short url

List short url's click log.

Example request:

curl -X GET \
    -G "https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl/click-log/list?per_page=10&page=1" \
    -H "Authorization: Bearer {access_token}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl/click-log/list?per_page=10&page=1"
);

let headers = {
    "Authorization": "Bearer {access_token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
    $response = $client->get(
        'https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl/click-log/list?per_page=10&page=1',
        [
            'headers' => [
                'Authorization' => 'Bearer {access_token}',
                'Content-Type' => 'application/json',
                'Accept' => 'application/json',
            ],
        ]
    );
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl/click-log/list?per_page=10&page=1'
headers = {
    'Authorization': 'Bearer {access_token}',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}
response = requests.request("GET", url, headers=headers)
response.json()

Example response (200 - Success):

{
    "status": "success",
    "code": 200,
    "data": {
        "current_page": 1,
        "data": [
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T14:33:23.000000Z",
                "updated_at": "2020-04-19T14:33:23.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T05:15:06.000000Z",
                "updated_at": "2020-04-19T05:15:06.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T05:14:54.000000Z",
                "updated_at": "2020-04-19T05:14:54.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T05:14:35.000000Z",
                "updated_at": "2020-04-19T05:14:35.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T05:12:57.000000Z",
                "updated_at": "2020-04-19T05:12:57.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T05:11:05.000000Z",
                "updated_at": "2020-04-19T05:11:05.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T05:04:50.000000Z",
                "updated_at": "2020-04-19T05:04:50.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T04:59:39.000000Z",
                "updated_at": "2020-04-19T04:59:39.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T04:58:12.000000Z",
                "updated_at": "2020-04-19T04:58:12.000000Z",
                "device_type": "desktop"
            },
            {
                "full_url": "https://urlgo.in/revnology-99",
                "short_key": "revnology-99",
                "short_url_id": 75,
                "status": "redirected",
                "ip": "127.0.0.0",
                "iso_code": "US",
                "country": "United States",
                "city": "New Haven",
                "state": "CT",
                "state_name": "Connecticut",
                "postal_code": "06510",
                "latitude": "41.31",
                "longitude": "-72.92",
                "timezone": "America/New_York",
                "continent": "NA",
                "currency": "USD",
                "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
                "is_mobile": 0,
                "is_tablet": 0,
                "is_desktop": 1,
                "is_bot": 0,
                "is_chrome": 1,
                "is_firefox": 0,
                "is_opera": 0,
                "is_safari": 0,
                "is_edge": 0,
                "is_ie": 0,
                "is_windows": 1,
                "is_linux": 0,
                "is_mac": 0,
                "is_android": 0,
                "browser_name": "Chrome 80.0.3987",
                "browser_family": "Chrome",
                "browser_version": "80.0.3987",
                "browser_version_major": "80",
                "browser_version_minor": "0",
                "browser_version_patch": "3987",
                "browser_engine": "Blink",
                "platform_name": "Windows 10",
                "platform_family": "Windows",
                "platform_version": "10",
                "platform_version_major": "10",
                "platform_version_minor": "0",
                "platform_version_patch": "0",
                "device_family": "Unknown",
                "device_model": "",
                "mobile_grade": "",
                "created_at": "2020-04-19T04:57:34.000000Z",
                "updated_at": "2020-04-19T04:57:34.000000Z",
                "device_type": "desktop"
            }
        ],
        "first_page_url": "https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl/click-log/list?page=1",
        "from": 1,
        "last_page": 2,
        "last_page_url": "https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl/click-log/list?page=2",
        "next_page_url": "https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl/click-log/list?page=2",
        "path": "https://urlgo.in/api/v1/short-url/read/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl/click-log/list",
        "per_page": 10,
        "prev_page_url": null,
        "to": 10,
        "total": 19
    },
    "message": "Successfully list short url's click logs."
}

HTTP Request

GET api/v1/short-url/read/{uid}/click-log/list?per_page={per_page}&page={page}

URI Params

Param Type Description
uid String The uid of the short url

Query Params

Param Type Description
per_page Integer Pagination total records to be display per page
page Integer Pagination page number

Generate short url.

Example request:

curl -X POST \
    "https://urlgo.in/api/v1/short-url/generate" \
    -d '{"url":"https://revnology.com","short_key":"revnology-99"}' \
    -H "Authorization: Bearer {access_token}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://urlgo.in/api/v1/short-url/generate"
);

let headers = {
    "Authorization": "Bearer {access_token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify({"url":"https://revnology.com","short_key":"revnology-99"})
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://urlgo.in/api/v1/short-url/generate',
    [
        'headers' => [
            'Authorization' => 'Bearer {access_token}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'url' => 'https://revnology.com',
            'short_key' => 'revnology-99',
        ]
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://urlgo.in/api/v1/short-url/generate'
payload = {"url":"https://revnology.com","short_key":"revnology-99"}
headers = {
    'Authorization': 'Bearer {access_token}',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=json.dumps(payload))
response.json()

Example response (200 - Success):

{
    "status": "success",
    "code": 200,
    "data": {
        "uid": "somelonguidherez3h1d2bwkzvadwgfh4oifwkhl",
        "original": "https://revnology.com",
        "short_key": "revnology-99",
        "shortened_url": "https://urlgo.in/revnology-99",
        "redirect_option": "direct",
        "disabled_at": null,
        "statistic_url": "https://urlgo.in/stats/somelonguidherez3h1d2bwkzvadwgfh4oifwkhl",
        "created_at": "2020-04-26T12:50:43.000000Z",
        "updated_at": "2020-04-26T12:50:43.000000Z"
    },
    "message": "Successfully created short url."
}

Example response (422 - Validation Error):

{
    "status": "fail",
    "code": 422,
    "error_key": "VALIDATION_ERROR",
    "data": {
        "url": [
            "The url field is required."
        ],
        "short_key": [
            "The short key has already been taken."
        ]
    },
    "message": "The given data was invalid."
}

HTTP Request

POST api/v1/short-url/generate

Post Data

Param Type Description
url Url The url must starts with http:// or https:// that you wish to redirect to.
short_key String Optional. Min 5 alpha-numeric characters, as well as dashes and underscores. Leave it empty to randomly generate a short key. You may define your own but must not be taken by others.