Smurl.es API Service
For faster shrinking, do it on your website!



<?php

      ###########################################################
      #                                                         #
      #                   Smurl.es API Service                  #
      #         You may edit if you know what you're doing!     #
      #                                                         #
      #         Obtain an API key once you've logged in:        #
      #                   http://smurl.es/usercp                #
      ###########################################################


      $apikey = ""; // You can find your API key in your UserCP.
      $url = $_POST['url']; // this is where you get the URL for Smurl.es to process.

      if(isset($_POST['submit'])) { // Process after pressing the submit button.
        $url = "http://smurl.es/api.php?api={$apikey}&url={$url}";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $link = curl_exec($ch);
        curl_close($ch);
      
      echo $link; // Returns the response from Smurles.
      } 
?>
<!DOCTYPE html>
<html>
  <head>
  //Put your header stuff here!
  </head>
    <body>
      <h1>Shrink your URLs</h1>
      <form method="POST">
        <input type="text" name="url" placeholder="Paste URL here!" /><br />
        <input type="submit" name="submit" value="Shrink URL" />
      </form>
    </body>
</html>
Controlling our API

We understand not every website is the same, and not every error message would be the same either. We have given you the ability to put your own error messages to be displayed on your site if a user has done something wrong. Eg: using prohibited characters in their URL.

The code above is a basic script which you are allowed to edit upon. You may implement this to your script or do anything you like to help customize and print responses.

This feature is completely free, however users may be subject to an API ban if we think you are attempting to "flood" our database.

2018 - smurl.es © All Rights Reserved. Terms   XZNetworks   Avenged-Pkz