API documentation

Get API credentials  Try the bookmarklet 

The Linktrack API lets you access data from our web site in your own application. Below you'll find code requirements, examples, samples, and more. If you have any questions, please feel free to email us anytime.

  • Endpoint: https://linktrack.info/api/v1_0/makeLink
  • Method: GET or POST
  • Parameters accepted: [login], [pass], [external_url]
  • Parameters required: [login], [pass], [external_url]
  • Returns: Tracking link or error message in plain text
https://linktrack.info/api/v1_0/makeLink?login=YourApiLoginHere&pass=YourApiPasswordHere&external_url=http://www.google.com

Copy and paste the textarea above as-is and replace the "http://www.google.com" part with whatever you want to link to. The API will make the link for you like normal, and will stick it in your links page for later.

  • Endpoint: https://linktrack.info/api/v1_0/makeLink
  • Method: POST
  • Parameters accepted: [login], [pass], [external_url], [host], [title], [vanity_link], [description], [notes], [alert_at], [deactivate_at], [has_alert_email], [password], [is_active], [is_public], [has_plus_tracking], [has_public_tracking], [has_conversion_tracking], [expires_at], [group]
  • Parameters required: [login], [pass], [external_url]
  • Returns: Tracking link or error message in plain text
  • Please note: You must have the appropriate account type to pass all but the [login], [pass], [external_url] parameters.
[POST] => Array
    (
        [login] => YourApiLoginHere 
        [pass] => YourApiPasswordHere 
        [external_url] => http://www.google.com 
        [expires_at] => 2017-09-19 14:14:16 
        [vanity_link] => my_vanity_link
        [title] => My Title 
        [description] => A description here 
        [notes] => Some notes here 
        [password] => letmein 
        [host] => alternate_domain.com 
        [alert_at] => 100 
        [deactivate_at] => 100 
        [is_public] => 1 
        [has_public_tracking] => 1 
        [is_active] => 1 
        [has_alert_email] => 1 
        [has_plus_tracking] => 1 
        [has_conversion_tracking] => 1 
        [group] => My Group
    )
                    

Here's an example of this request using PHP's curl function:

<?php
  $vars = array();
  $vars['external_url'] = 'http://www.google.com';
  $vars['login'] = 'YourApiLoginHere';
  $vars['pass'] = 'YourApiPasswordHere';

  $ch = curl_init();

  curl_setopt($ch, CURLOPT_URL, 'https://linktrack.info/api/v1_0/makeLink');
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS,$vars);
  curl_setopt($ch, CURLOPT_VERBOSE, true);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

  $return_data = curl_exec($ch);
?>
                    
  • Endpoint: https://linktrack.info/api/v1_0/getLink
  • Method: GET
  • Parameters accepted: [login], [pass], [redirect_hash], [format]
  • Parameters required: [login], [pass]
  • Returns: Link properties in either XML (default) or JSON format with the [format] parameter. Use either 'format=xml' or 'format=json' to set the return format.
https://linktrack.info/api/v1_0/getLink?login=YourApiLoginHere&pass=YourApiPasswordHere&redirect_hash=YourLinkIdHere&format=xml
  • Endpoint: https://linktrack.info/api/v1_0/getLink
  • Method: GET
  • Parameters accepted: [login], [pass], [sort], [order], [limit], [links], [groups], [format]
  • Parameters required: [login], [pass]
  • Returns: Ordered list of links in either XML (default) or JSON format with the [format] parameter. Use either 'format=xml' or 'format=json' to set the return format.

Parameter Options

  • [sort]: Sets the property to sort results by.

    "l.external_url" - sort by the link's destination point
    "l.redirect_hash" - sort by the link's redirect hash identifier
    "l.created_at" - sort by the link's creation date (default)
    "lc.count_day" - sort by the number of clicks in the last day
    "lc.count_total" - sort by the total number of clicks
    "lc.updated_at" - sort by the last click recorded
    "d.title" - sort by the link's title
    "g.name" - sort by the link's group
  • [order]: Sets the order to return results.

    "asc" - ascending order
    "desc" - descending order (default)
  • [format]: Sets the return output format.

    "xml" - returns XML format (default)
    "json" - returns in JSON format
  • [limit]: Sets a limit on the number of results returned. This parameter must be numeric and can not exceed results. Default
  • [links]: Limits the result set to specific links. Accepts a comma-separated string of redirect hashes.

    Example: links=hash1,hash2,hash2
  • [groups]: Limits the result set to specific groups. Accepts a comma-separated string of group names.

    Example: groups=group_name1,group_name2,group_name3
  • Returns: Sorted and ordered list of links
https://linktrack.info/api/v1_0/getLinks?login=YourApiLoginHere&pass=YourApiPasswordHere&links=hash1,hash2,hash2&groups=group_name1,group_name2,group_name3&sort=l.created_at&order=desc&limit=10&format=xml

Notice: The "getLink" method detailed above is more efficient for querying a link's click totals.

  • Endpoint: https://linktrack.info/api/v1_0/getLinkHistory
  • Method: GET
  • Parameters accepted: [login], [pass], [sort], [order], [limit], [start_date], [end_date], [redirect_hash], [format]
  • Parameters required: [login], [pass], [redirect_hash]
  • Returns: tracking history for a link in either XML (default) or JSON format with the [format] parameter. Use either 'format=xml' or 'format=json' to set the return format.

Parameter Options

  • [sort]: Sets the property to sort results by.

    "h.created_at" - sort by the item's creation date (default). No other sorting options are available at this time.
  • [order]: Sets the order to return results.

    "asc" - ascending order
    "desc" - descending order (default)
  • [format]: Sets the return output format.

    "xml" - returns XML format (default)
    "json" - returns in JSON format
  • [limit]: Sets a limit on the number of results returned. This parameter must be numeric and can not exceed 1000 results.
  • [start_date] & [end_date]: Limits the results by date range. All times are CDT. [start_date] can not be older than 30 days.

    Accepted formats are "2017-08-20 14:14:16" and "2017-08-20".

    If left unset, this value defaults to the current day.
    &start_date=2017-08-20 //Returns results older than 2017-08-20 00:00:00
    &end_date=2017-08-20 14:14:16 //Returns results prior to 2017-08-20 14:14:16
  • [redirect_hash]: The unique identifier for your link

    Example: "YourLinkIdHere"
  • Returns: Sorted and ordered tracking history.
https://linktrack.info/api/v1_0/getLinkHistory?login=YourApiLoginHere&pass=YourApiPasswordHere&redirect_hash=YourLinkIdHere&sort=h.created_at&order=desc&limit=10&format=xml&start_date=2017-08-20 00:00:00
  • Endpoint: https://linktrack.info/api/ping
  • Method: GET
  • Parameters accepted: none
  • Parameters required: none
  • Returns: fully qualified domain name and local time in ISO 8601 format.