Sqworl

The Sqworl API allows fetching data about Sqworl Users, Groups and therefore Links. It also allows for creating new Sqworl groups/links as well as adding new links to existing groups remotely.

Developers can now use Sqworl data and even create groups and add links from their own website or application. Feel free to create Sqworl browser extensions, iPhone apps, Wordpress plug-ins and much much more.

To get your API Key, go to your Sqworl Account Settings.

Note: While in beta, creating groups and adding links are limited to 50 per day. If you need more API Calls, email help@sqworl.com and (if you're not a spammer) I'll raise it right away. All requests are user/API Key specific.

API Example: Fetch a User's Groups
URL String:

http://sqworl.com/api/api.php?key=API_KEY&type=user&usrname=ANY_SQWORL_USERNAME

Parameters:

  • API Key
  • required
  • Type
  • required
  • User Name
  • required

    
    Results:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <
    rss xmlns:sqworl="http://sqworl.com" version="2.0">
    <
    channel
      <
    title>Sqworl User Request</title>
      <
    language>en-us</language>
      <
    description>Sqworl User Request</description>
      <
    link>http://sqworl.com/</link>
      <
    sqworl_user>calebrown</sqworl_user>
      <
    sqworl_groupCount>2</sqworl_groupCount>

        <
    item>
        <
    title>Tech Sites</title>
        <
    link>http://sqworl.com/bd847a</link>
        <
    description>A collection of tech sites I dig.</description>
        <
    pubDate>Tue16 Sep 2008 00_00_00 -0400</pubDate>
        <
    sqworl_groupCount>672</sqworl_groupCount>
        </
    item>
        
        <
    item>
        <
    title>Food Blogs</title>
        <
    link>http://sqworl.com/20323a</link>
        <
    description>My collection of great food blogs</description>
        <
    pubDate>Mon29 Jun 2009 21_45_39 -0400</pubDate>
        <
    sqworl_groupCount>86</sqworl_groupCount>
        </
    item>
        
    </
    channel>
    </
    rss>
    API Example: Fetch Specific Group Data
    URL String:

    http://sqworl.com/api/api.php?key=API_KEY&type=getgroup&group_id=ANY_GROUP_ID

    Parameters:

  • API Key
  • required
  • Type
  • required
  • Group ID
  • required

    
    Results:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <
    rss xmlns:sqworl="http://sqworl.com" version="2.0">
    <
    channel
      <
    title>Clif Bar Recipe</title>
      <
    language>en-us</language>
      <
    description>My quest for the perfect Clif bar recipe.</description>
      <
    link>http://sqworl.com/</link>
      <
    sqworl_user>calebrown</sqworl_user>
      <
    sqworl_linkTotal>3</sqworl_linkTotal>

        <
    item>
        <
    title>scottdavisanderson</title>
        <
    link>http://bit.ly/DMr6V</link>
        <
    description>no bake Clif Bar recipe</description>
        <
    sqworl_thumbnail>http://sqworl.com/full_img/6923.jpg</sqworl_thumbnail>
        </
    item>

        <
    item>
        <
    title>ellenskitchen</title>
        <
    link>http://www.ellenskitchen.com/recipebox/powrec.html</link>
        <
    description>A few different power bar recipes</description>
        <
    sqworl_thumbnail>http://sqworl.com/full_img/6926.jpg</sqworl_thumbnail>
        </
    item>

        <
    item>
        <
    title>foodnetwork</title>
        <
    link>http://tinyurl.com/3rgnpb</link>
        <
    description>Alton Brown power bar (not clif specific)</description>
        <
    sqworl_thumbnail>http://sqworl.com/full_img/6928.jpg</sqworl_thumbnail>
        </
    item>

    </
    channel>
    </
    rss>
    API Example: Create a Group (w/ optional URLs)
    URL String:

    http://sqworl.com/api/api.php?key=API_KEY&type=group&title=My Favorite Search Engines&desc=A few popular search engines&url1=http://www.google.com/&desc1=Google

    Parameters:

  • API Key
  • required
  • Type
  • required
  • Title
  • required
  • Desc
  • optional
  • URL1
  • optional
  • Desc1
  • optional
  • URL2
  • optional
  • Desc2
  • optional
  • URL3
  • optional
  • Desc3
  • optional

    
    Results:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <
    rss xmlns:sqworl="http://sqworl.com" version="2.0">
    <
    channel
      <
    title>Sqworl Group Success</title>
      <
    language>en-us</language>
      <
    description>API Success</description>
      <
    link>http://sqworl.com/srk8ua<link>
      
    <sqworl_groupTitle>My Favorite Search Engines</sqworl_groupTitle>
      <
    sqworl_key>srk8ua</sqworl_key>

        <
    item>
        <
    title>google</title>
        <
    link>http://www.google.com/<link>
        <description>Google</description>
        </
    item>

    </
    channel>
    </
    rss>
    API Example: Add URLs to Specific Group (up to 5 at a time)
    URL String:

    http://sqworl.com/api/api.php?key=API_KEY&type=add&group=GROUP_ID_YOU_OWN&url1=http://amazon.com &desc1=Amazon&url2=http://ebay.com&desc2=auction site

    Parameters:

  • API Key
  • required
  • Type
  • required
  • Group
  • required
  • URL1
  • required
  • Desc1
  • optional
  • URL2
  • optional
  • Desc2
  • optional
  • URL3
  • optional
  • Desc3
  • optional
  • URL4
  • optional
  • Desc4
  • optional
  • URL5
  • optional
  • Desc5
  • optional

    
    Results:

    <?xml version="1.0" encoding="UTF-8"?>
    <
    rss xmlns:sqworl="http://sqworl.com" version="2.0">
    <
    channel
      <
    title>Sqworl Group Success</title>
      <
    language>en-us</language>
      <
    description>API Success</description>
      <
    link>http://sqworl.com/xxxxxx</link>
      <
    sqworl_key>xxxxxx</sqworl_key>

        <
    item>
        <
    title>amazon</title>
        <
    link>http://amazon.com/</link>
        <
    description>Amazon</description>
        </
    item>

        <
    item>
        <
    title>ebay</title>
        <
    link>http://ebay.com</link>
        <
    description>auction site</description>
        </
    item>
        
    </
    channel>
    </
    rss>


    API Example: Check Your API Stats
    URL String:

    http://sqworl.com/api/api.php?key=API_KEY&type=userdata

    Parameters:

  • API Key
  • required
  • Type
  • required

    
    Results:

    <?xml version="1.0" encoding="UTF-8"?>
    <
    rss xmlns:sqworl="http://sqworl.com" version="2.0">
    <
    channel
      <
    title>Sqworl API User Info</title>
      <
    language>en-us</language>
      <
    description>Data about your API Usage</description>
      <
    link>http://sqworl.com/</link>
      <
    sqworl_APICallsLeftToday>97</sqworl_APICallsLeftToday>
      <
    sqworl_GroupsAddedToday>1</sqworl_GroupsAddedToday>
      <
    sqworl_LinksAddedToday>2</sqworl_LinksAddedToday>
      <
    sqworl_TotalGroupsAddedFromAPI>5</sqworl_TotalGroupsAddedFromAPI>
      <
    sqworl_TotalLinksAddedFromAPI>20</sqworl_TotalLinksAddedFromAPI>
    </
    channel>
    </
    rss>


    Code Example: Display and Style your Groups
    This PHP example uses simplexml_load_file to fetch the feed. This is a PHP5 function. If your PHP server doesn't allow simplexml_load_file, or you're using an older version of PHP, cURL could be used instead.

    Also, this is simply an example that shows how easily the API result can be parsed, not necessarily best practice. If an API request result can be cached, it probably should be.


    <?php
    // Load and parse the feed 
    $rss =  simplexml_load_file('http://sqworl.com/api/api.php?key=YOUR_KEY&type=user&usrname=calebrown');
    ?>
    <html xml:lang="en" lang="en">
    <head>
      <title>My Sqworl Groups</title>
      <style type="text/css">
      #sqworlgroups {
      background-color:#ddd;
      width:350px;
      text-align:left;
      border-width: 2px;
      border-top-style:solid;
      border-top-color:#CCCCCC;
      }
      </style>

    </head>
    <body>
    <h2>My Sqworl Groups</h2>
    <?php
    // Now we'll loop through the groups and display them as we please
    foreach ($rss->channel->item as $item) {
      echo 
    '<p><div id="sqworlgroups"><strong><a href="' $item->link '">' $item->title '</a></strong>';
      echo 
    '<br />' $item->description'<br />';
      echo 
    '(This group has '.$item->sqworl_groupCount.' views)</div></p>';
    }
    ?>
    </body>
    </html>

    Output: