2D Referrals

Scannable shortened links with analytics
Compress text documents or host HTML pages
Variable pass through & callback for user specific logging

2Dr Documentation


TweetDeck allows you to manage multiple social media accounts within one place and schedule Status messages for automatic sending in the future. Twitter only allows you to enter messages up to 140 characters long. You can have TweetDeck automatically shorten your web links using 2Dr. One benefit of this is you will know how many clicks you links get over time and how they get reposted around the web.

To setup TweetDeck simply:

  1. Click the Settings button (a little spanner button found in the top right corner)
  2. Click "Services" in the left panel
  3. In the "shorten URLs section, select "Other" in the drop box
  4. Enter the following, replacing "APIKey" with your APIKey (that is shown at the top of the page when you log in):


  5. Click "Save Settings"

Now every time you type a URL that would be shorter using 2Dr, TweekDeck will automatically convert it for you and we will start counting the clicks you get.

Customise Facebook Links

Customise Facebook Links

When you want to post a Link on Facebook you Copy and Paste your web link (URL) into a text box and Facebook automatically grabs the Title and Description of that page and gives you a selection of images to choose from.

Wouldn't it be nice if you could specify the Title, Description and Image AND know how many clicks your Link has had and where on the web it has been re-posted?

Shortlinks for Facebook and Twitter

2Dr makes it easy to create shortlinks that can be used on Facebook to give you click through analytics. Simply click on "Create Link Ad" and complete the short form.

Remember to enter your email address and specify a password if you want to be able to access analytics on your Link.

The 2Dr Application Programming Interface

Our Application Programming Interface (API) allows website developers to easily integrate the power of 2Dr into their web applications.

All calls to our API are made to: http://2dr.eu/api.php

Credit Usage
r=stats is 1 credit
r=newcode is 5 credits
r=listcodes is 25 credits

Each time you access the API you use "credits". We issue your account with 50 free credits every minute, and you are allowed to use up to 2000 credits each hour. If you require more then please let us know.
Having multiple accounts is fine, and we will be aware of this, but it is not a good way of overcoming our default API limits; if you want more just let us know.

All versions of our API will always be supported, and the output will always be backward compatible.

With the exception of "v", you can choose to send variables to our API using GET or a combination of GET and POST.

Your call to the API must always begin: http://2dr.eu/api.php?v=1
This specifies that you want to use Version 1 of our API, in the future you may have the option of using a version 2, 3... should you wish. These formats would contain extra features.


"Short Link"       A short URL issued by us eg. "http://2dr.eu/2DrDoc"
"Code"             A unique short string comprising of characters: [a-z],[A-Z],[0-9],-,_ 
                   eg. "2DrDoc"
"Scan2Read Code"   An image consisting of three 2D barcodes.
"Print Link"       A URL that returns the Scan2Read code for your Short Link on screen.
                   Please copy and host these images on your own web server.
                   eg. http://2dr.eu/print/2DrDoc
"Download Link"    A URL that returns the Scan2Read code as a download file.
                   eg. http://2dr.eu/download/2DrDoc


 v=1               GET      Version 1 of this API
 k=<Your APIKey>   GET/POST Your APIKey as shown when logged in
 r=                GET/POST
   newcode                  Generates a new code within your account pointing to "d"
   listcodes                Returns a list of all codes within your account
   stats                    Retrieves analytics on your code stated in "d"
 o=                GET/POST
   text                     Outputs in plain text format
   csv                      Outputs in CSV format
   xml                      Outputs full details in XML format
   json                     Outputs full details in JSON format
   when GET      "r=newcode" urlencoded URL for the new short code to point to
                             eg. "http%3A%2F%2F2dr.eu%2F"
   when POST     "r=newcode" URL for the new short code to point to
                             eg. "http://2dr.eu/"
   when GET/POST "r=stats"   this contains your short link code
                             eg. "2DrDoc" (if your short link is "http://2Dr.eu/2DrDoc")


 To create a new short link to the page http://2dr.eu/documentation.php
 you could send all variables using GET:
  http://2dr.eu/api.php?v=1&k=d3cfa5366fe01ce2a&r=newcode&o=text      ...
  This would return the value of the short code created. e.g. "2DrDoc"

 To create a new short link to the page http://2dr.eu/documentation.php using POST:
  GET    http://2dr.eu/api.php?v=1
  POST   k=d3cfa5366fe01ce2a&r=newcode&o=text&d=http://2dr.eu/documentation.php
  This would return the value of the short code created. e.g. "2DrDoc"

 To get a list of all your short codes using GET and in CSV format:

 To retrieve usage stats on this short code using GET and in JSON format:

 To retrieve usage stats on this short code using POST and in XML format:
  GET    http://2dr.eu/api.php?v=1
  POST   k=d3cfa5366fe01ce2a&r=stats&o=xml&d=2DrDoc


Please use the APIKey d3cfa5366fe01ce2a while developing your application.
This will save creating multiple codes within your personal account.
Codes created using this APIKey will be automatically deleted 48 hours after creation.

 "cURL" can be used in PHP or as a linux command line.
 "wget" is a command line tool that you could call using shell, perl or PHP.

 "cURL" can be used installed and called.
 "WebBrowser.Navigate" can be used in ASP.

  wget -O r.txt "http://2dr.eu/api.php?v=1&k=d3cfa5366fe01ce2a&r=stats&o=xml&d=2DrDoc"

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_HEADER, false);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
  curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_TIMEOUT, 5);

if you are sending variables by GET:
  curl_setopt($ch, CURLOPT_URL,

if you are sending variables by POST:
  curl_setopt($ch, CURLOPT_POST, true );
  curl_setopt($ch, CURLOPT_POSTFIELDS, "k=d3cfa5366fe01ce2a&r=stats&o=xml&d=2DrDoc");
  curl_setopt($ch, CURLOPT_URL, "http://2dr.eu/api.php?v=1");

  $result = curl_exec($ch);
  echo $result;

Downloads: PHP Code - GET Method, PHP Code - POST Method

If you want a 1x1 pixel transparent image for web/email opening analytics,
or want us to host any PDF, .doc, .xls, .ppt, .svg, .png, .jpg, .gif ... type documents
please contact us on 0044 7703 184 699 to setup an account (we charge £1 per Gigabyte of data transfer)
eg. a 1x1 pixel transparent .gif costs you £1 per 10,000,000 views = VERY CHEAP!

Corporate 2D Barcode Linking Services | 2D Barcode Product Purchasing Services